// // CartGeneralNotesViewController.m // iSales-NPD // // Created by Ray on 2/16/16. // Copyright © 2016 United Software Applications, Inc. All rights reserved. // #import "CartGeneralNotesViewController.h" #import "RANetwork.h" @interface CartGeneralNotesViewController () @end @implementation CartGeneralNotesViewController - (void)viewDidLoad { [super viewDidLoad]; #ifdef SCANNER_ORDER self.title = @"Special Instructions"; #endif self.tv_notes.text = self.notes; // Do any additional setup after loading the view. if (@available(iOS 11, *)) { self.tv_notes.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } // else { // //// self.tv_notes.scrollView.contentInsetAdjustmentBehavior =UIScrollViewContentInsetAdjustmentNever; // // self.automaticallyAdjustsScrollViewInsets = NO; // } // self.automaticallyAdjustsScrollViewInsets = NO; // self.navigationController.navigationBar.translucent = NO; self.tv_notes.layer.borderColor = [UIColor lightGrayColor].CGColor; self.tv_notes.layer.borderWidth = 1.0f; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)onCloseClicked:(id)sender { [self dismissViewControllerAnimated:NO completion:^{ }]; } - (IBAction)onSaveClicked:(id)sender { // [self.tv_notes endEditing:true]; self.notes = self.tv_notes.text; NSString* notes=self.tv_notes.text; UIApplication * app = [UIApplication sharedApplication]; AppDelegate *appDelegate = (AppDelegate *)[app delegate]; // __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Update General Notes" completion:^{ PopWaitAlert* pop = [RAUtils waiting_pop:@"Update General Notes" completion:nil]; [RANetwork request_update_cartgeneralnote:appDelegate.order_code notes:notes completionHandler:^(NSMutableDictionary *result) { NSDictionary* cart_json = result; // [waitalert dismissViewControllerAnimated:YES completion:^{ [pop hide]; // [waitalert dismissViewControllerAnimated:YES completion:nil]; if([[cart_json valueForKey:@"result"] intValue]==2) { [self dismissViewControllerAnimated:NO completion:^{ if(self.onSetValue) self.onSetValue(self.notes); }]; } else { [RAUtils message_box:@"Update General Notes" message:[cart_json valueForKey:@"err_msg"] completion:nil]; } // }]; }]; // }]; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end