| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- //
- // NotesViewController.m
- // Granite Expo eSign
- //
- // Created by Ray on 28/02/2017.
- // Copyright © 2017 United Software Applications, Inc. All rights reserved.
- //
- #import "DocnotesViewController.h"
- #import "RANetwork.h"
- #import "RAUtils.h"
- @interface DocnotesViewController ()
- @end
- @implementation DocnotesViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.editDocNumber.text = self.docNumber;
- self.tvNotes.text = self.docNotes;
-
- if(self.docNumber.length>0)
- {
- self.editDocNumber.enabled = false;
- self.btnScan.enabled = false;
- }
- self.edgesForExtendedLayout = UIRectEdgeNone;
-
-
- self.tvNotes.layer.borderColor = [UIColor darkGrayColor].CGColor;
- self.tvNotes.layer.borderWidth = 0.5;
-
-
- UIBarButtonItem *closeButton =nil;
-
-
-
- closeButton=[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
- style:UIBarButtonItemStylePlain
- target:self
- action:@selector( onCloseClick:)];
- //[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Close", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onCloseClick:)];
- // closeButton.title = @"Close";
-
- self.navigationItem.rightBarButtonItem = closeButton;
- // Do any additional setup after loading the view.
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (void)onCloseClick:(UIButton *)sender {
-
-
- [self dismissViewControllerAnimated:false completion:nil];
-
- // [self.navigationController popViewControllerAnimated:FALSE];
- }
- - (IBAction)onUpdateClick:(id)sender {
-
- self.docNumber = self.editDocNumber.text;
- self.docNotes = self.tvNotes.text;
-
- // UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Update Notes"];
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Update Notes" completion:^{
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
-
- NSMutableDictionary* json=[[RANetwork updateNotes:self.docNumber notes:self.docNotes ] mutableCopy];
-
- dispatch_async(dispatch_get_main_queue(), ^{
- // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-
- [waitalert dismissViewControllerAnimated:YES completion:^{
- if([json[@"result"] intValue]==RESULT_TRUE)
-
- {
- [self dismissViewControllerAnimated:false completion:nil];
- // DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
- //
- // // dvc.templateName = @"debug.json";
- // dvc.templateName = @"GEIC - Home Improvement Contract 2017.json";
- // dvc.pdfName = @"GEIC - Home Improvement Contract 2017.pdf";
- // dvc.docment_id = json[@"doc_number"];
- // dvc.OnSave=^(NSString* file, NSString* subject)
- // {
- //
- // [weakSelf previewPDF:file title:json[@"doc_number"] subject:subject];
- // };
- //
- // [self.navigationController pushViewController:dvc animated:true];
- }
- else
- {
- [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Create Customer" controller:self] ;
- }
- }];
-
-
-
-
- });
- });
- }];
-
-
-
- }
- - (IBAction)onScanClick:(id)sender {
- }
- /*
- #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
|