| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- //
- // ItemNotesViewController.m
- // iSales-NPD
- //
- // Created by Ray on 2/16/16.
- // Copyright © 2016 United Software Applications, Inc. All rights reserved.
- //
- #import "ItemNotesViewController.h"
- #import "RANetwork.h"
- @interface ItemNotesViewController ()
- @end
- @implementation ItemNotesViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- 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.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;
-
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Update Item Notes" completion:^{
- [RANetwork request_update_cartitemnote:self.cart_id notes:self.tv_notes.text completionHandler:^(NSMutableDictionary *result) {
-
- NSDictionary* cart_json = result;
- [waitalert dismissViewControllerAnimated:YES completion:^{
- if([[cart_json valueForKey:@"result"] intValue]==2)
- {
- [self dismissViewControllerAnimated:NO
- completion:^{
- if(self.onSaveNote)
-
- self.onSaveNote(self.notes);
-
- }];
- }
- else
- {
- [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Update Item Notes" controller:self] ;
- }
- }];
-
-
-
-
- }];
- }];
-
-
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //
- // NSDictionary* cart_json = nil;
- //
- //
- //
- // cart_json = [RANetwork cart_setItemNote:self.cart_id notes:self.tv_notes.text];
- //
- // dispatch_async(dispatch_get_main_queue(), ^{
- //
- //
- // [waitalert dismissViewControllerAnimated:YES completion:nil];
- // if([[cart_json valueForKey:@"result"] intValue]==2)
- // {
- // [self dismissViewControllerAnimated:NO
- // completion:^{
- // if(self.onSaveNote)
- //
- // self.onSaveNote(self.notes);
- //
- // }];
- // }
- // else
- // {
- // [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Update Item Notes" controller:self] ;
- // }
- //
- //
- //
- //
- // });
- // });
- }
- /*
- #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
|