// // DocumentListViewController.m // Granite Expo eSign // // Created by Ray on 12/28/16. // Copyright © 2016 United Software Applications, Inc. All rights reserved. // #import "DocumentListViewController.h" #import "ACNetwork.h" #import "DocListTableViewCell.h" #import "RAUtils.h" #import "GEContractFilterViewController.h" #import "RAPDFViewController.h" #import "AppDelegate.h" #import "ExtDocumentsViewController.h" #import "DocnotesViewController.h" #import "AddExtDocumentViewController.h" #import "DocumentPageViewController.h" @interface DocumentListViewController () @property (nonatomic,strong) NSOperationQueue *dataOperationQueue; @end @implementation DocumentListViewController - (NSOperationQueue *)dataOperationQueue { if (!_dataOperationQueue) { _dataOperationQueue = [[NSOperationQueue alloc] init]; _dataOperationQueue.maxConcurrentOperationCount = 1; } return _dataOperationQueue; } - (void)viewDidLoad { [super viewDidLoad]; self.offset = 0; self.limit = 20; self.table_data = [[NSMutableArray alloc] init]; self.filterparams = [[NSMutableDictionary alloc]init]; self.label_net_err.layer.borderColor = [UIColor darkGrayColor].CGColor; self.label_net_err.layer.borderWidth = 2.0; self.label_net_err.layer.cornerRadius=15; self.label_net_err.layer.masksToBounds=true; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(refresh_btn_click:)]; [self.label_net_err addGestureRecognizer:tap]; UIRefreshControl *ref = [[UIRefreshControl alloc]init]; ref.tag = 201 ; ref.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"]; ref.tintColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7]; // ref.hidden = true; [ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged]; [self.tableView addSubview:ref]; // NSMutableArray * arr = [[NSMutableArray alloc] init]; // for(int i=0;i<100;i++) // { // [arr addObject:[NSNumber numberWithInt:i]]; // } // NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; // dict[@"arr"] = arr; // DebugLog([RAUtils dict2string:dict]); [self loadpage]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)onAddClick:(id)sender { __weak typeof(self) weakself = self; { AddExtDocumentViewController * addVC; addVC = [ [UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"AddExtDocumentViewController"]; addVC.is_present = true; addVC.doc_number = nil; addVC.uploadSuccess = ^(NSMutableArray* arr_upload){ if(arr_upload.count>0) [weakself loadpage]; }; //addVC.arr_documents = [NSMutableArray arrayWithObjects:appDelegate.shareFile, nil]; //appDelegate.shareFile=nil; // notesVC.docNotes = notes; UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:addVC] ; navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种 [self presentViewController:navi animated:YES completion:^{ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320); DebugLog(@"filter present........."); // self.btop = false; // <#code#> }]; } } - (IBAction)onFilterClick:(id)sender { GEContractFilterViewController * filterVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"GEContractFilterViewController"]; filterVC.filterparams = self.filterparams; filterVC.OnSearch = ^(NSMutableDictionary* params) { // [self reload_container_getdata:true]; self.reset_result=true; // self.norefresh=true; [self loadpage]; }; UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:filterVC] ; navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种 [self presentViewController:navi animated:YES completion:^{ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320); DebugLog(@"filter present........."); // self.btop = false; // <#code#> }]; } -(void) previewPDF:(NSString*)url title:(NSString*)title subject:(NSString*)subject islocal:(bool) islocalfile { NSString* name=@"";//[self.content_data[indexPath.row] valueForKey:@"tear_name"]; // NSString* url= file;//[self.content_data[indexPath.row] valueForKey:@"pdf_path"]; bool isLocalFile= islocalfile;//[self.content_data[indexPath.row] valueForKey:@"isLocalFile"]; RAPDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"]; ViewController.url = url; ViewController.canSave = false; ViewController.isLocalfile=isLocalFile; ViewController.defaultStyle = true; ViewController.save_name = title; // NSString* subject; // if (company.length==0) { // NSString* cur_time =[RAUtils current_date]; // subject =name;//[NSString stringWithFormat:@"NPD Product List %@",cur_time]; // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // NSString* customer_email= [appDelegate.customerInfo valueForKey:@"customer_email"]; NSMutableArray* send_to = [[NSMutableArray alloc]init]; // if(customer_email.length>0) // { // send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy]; // // customer_email compo // // [send_to addObject:customer_email]; // } ViewController.mail_to = send_to; // } // else // { // subject = [NSString stringWithFormat:@"Tear sheet for %@",company ]; // } // ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Product_List %@.pdf",cur_time]; ViewController.mail_subject = subject; ViewController.hidenavi = false; [self.navigationController pushViewController:ViewController animated:YES]; } #pragma mark - OperationQueue request page data -(void) loadpage { __weak typeof(self) weakself = self; NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ if (weakself) { __strong typeof(weakself) strongself = weakself; [strongself operation_loadPage]; } }]; [self.dataOperationQueue addOperation:operation]; } - (void)loadmore { // self.btnrefresh.enabled = NO; // self.btnrefresh.titleLabel.text =NSLocalizedString(@"loading",nil); // [self.btnrefresh setTitle:@"Loading..." forState:UIControlStateNormal]; [self loadpage]; } -(void)manually_refresh { UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:201]; // if(self.isrefreshing) // { // [reF endRefreshing]; // return; // } reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Refreshing"]; if ([self respondsToSelector:@selector(ReloadData)]) [self performSelector:@selector(ReloadData) withObject:nil afterDelay:1]; } -(void)ReloadData { // [self.content_data removeAllObjects]; // [self.table_order reloadData]; // self.table_order.hidden = true; UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:201]; [reF endRefreshing]; reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"]; // self.keywords=self.searchbar.text; // // self.offset = 0; self.reset_result=true; // [self.content_data removeAllObjects]; // [self.table_order reloadData]; [self loadpage]; // [self loadpage]; } -(void)refresh_btn_click:(UILongPressGestureRecognizer*)gestureRecognizer { // [self reload_container_getdata:true]; self.reset_result=true; // self.norefresh=true; [self loadpage]; } - (void)operation_loadPage { if (self.dataOperationQueue.operationCount > 1) { // 队列后面还有操作 return; } dispatch_sync(dispatch_get_main_queue(), ^{ //在主线程处理界面逻辑 if(self.reset_result) { self.offset = 0; //[self.filterparams removeAllObjects]; [self.table_data removeAllObjects]; [self.tableView reloadData]; } // // // NSMutableArray* arr_status = [[NSMutableArray alloc] init]; // // NSMutableArray* arr_statusname = [[NSMutableArray alloc] init]; // int count = [[self.status_cadedate valueForKey:@"count"] intValue]; // for(int i=0;i 1) { // 队列后面还有操作 return ; } int result=[[content valueForKey:@"result"] intValue]; if(result==2||result==0) { NSArray * arrlist = content[@"list"]; long count = arrlist.count ; self.offset += count; [self.table_data addObjectsFromArray:arrlist]; // for(int i=0;i0) { cell.Icon_notes.hidden = false; cell.label_notes.hidden = false; } else { cell.Icon_notes.hidden = true; cell.label_notes.hidden = true; } NSMutableArray* arr_doc = [item_json[@"documents"] mutableCopy]; int imgcount=0; int filecount=0; for(int d=0;d0) { cell.Icon_img.hidden = false; cell.label_img.hidden = false; cell.label_img.text=[NSString stringWithFormat:@"%d",imgcount]; } else { cell.Icon_img.hidden = true; cell.label_img.hidden = true; cell.label_img.text=@""; } if(filecount>0) { cell.Icon_file.hidden = false; cell.label_file.hidden = false; cell.label_file.text=[NSString stringWithFormat:@"%d",filecount]; } else { cell.Icon_file.hidden = true; cell.label_file.hidden = true; cell.label_file.text=@""; } if(tel.length>0) tel= [@"TEL: " stringByAppendingString:tel]; NSMutableArray* arr_ext= [[NSMutableArray alloc] init]; [arr_ext addObject:job_addr]; [arr_ext addObject:@"\r\n"]; [arr_ext addObject:job_city]; [arr_ext addObject:job_state]; [arr_ext addObject:job_zip]; [arr_ext addObject:@"\r\n"]; [arr_ext addObject:tel]; NSString *nsext=[RAUtils arr2string:arr_ext separator:@", " trim:true]; nsext=[nsext stringByReplacingOccurrencesOfString:@", \r\n," withString:@"\r\n"]; // if(sss.length==0) // sss=@""; cell.labelDocID.text = item_json[@"doc_number"];// cell.labelExtInfo.text =nsext; cell.labelJobDate.text =item_json[@"job_date"]; cell.labelCustomer.text =item_json[@"customer_name"]; cell.labelSignDate.text =item_json[@"signed_date"]; return cell; } // if(tableView==self.itemListTable) // { // NSString *CellIdentifier = @"CartItemCell"; // ModelItemCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; // NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]]; // NSDictionary * combine_json =[item_json objectForKey:@"combine"]; // // cell.bundle_item=combine_json; // NSString* img_url = [item_json valueForKey:@"img_url"]; // NSString* description = [item_json valueForKey:@"description"]; // // NSString* identifier = [item_json valueForKey:@"identifier"]; // // NSString* attribute = [item_json valueForKey:@"attribute"]; // NSString* currency = [item_json valueForKey:@"currency"]; // int count =[[item_json valueForKey:@"count"] intValue]; // // int stockUom =[[item_json valueForKey:@"stockUom"] intValue]; // // double totalprice =[[item_json valueForKey:@"subtotal_price"] doubleValue]; // // double unitprice=[[item_json valueForKey:@"unit_price"] doubleValue]; // cell.unit_price = unitprice; // // cell.labelAttribute.text = attribute; // // cell.labelCurrency.text = currency; // cell.labelDescription.text = description; // // cell.labelIdentifier.text = identifier; // cell.labelPrice.text = [NSString stringWithFormat:@"%.2f",totalprice]; // // cell.labelUnitPrice.text = [NSString stringWithFormat:@"%.2f",unitprice]; // // // // NSString* cart_item_id= [item_json valueForKey:@"cart_item_id"]; // cell.cart_id = cart_item_id; // [cell init_Stepper:stockUom max:9999 min:stockUom value:count]; // // // // [cell set_Count:count]; // // NSString* file_name=[img_url lastPathComponent]; // NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url]; // if(img_data!=nil) // { // // UIImage * img =[UIImage imageWithData:img_data]; // [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal]; // } // else // { // // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // // NSData* downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]]; // // dispatch_async(dispatch_get_main_queue(), ^{ // // // // if(downloadimg_data!=nil) // { // [iSalesDB cache_img:downloadimg_data :file_name ]; // // UIImage * img =[UIImage imageWithData:downloadimg_data]; // [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal]; // } // // }); // }); // // // } // return cell; // } // else // { // NSString *CellIdentifier = @"OrderInfoListItem"; // UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; // return cell; // } } #pragma mark tableview delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //如果是最后的状态cell 则返回; if(indexPath.row==self.table_data.count) return; NSDictionary * item_json = self.table_data[indexPath.row]; NSString* pdf_url = item_json[@"pdf_path1"]; NSString* subject = [NSString stringWithFormat:@"%@ %@, %@ %@",item_json[@"doc_number"],item_json[@"customer_name"],item_json[@"signed_date"],item_json[@"signed_time"]]; [self previewPDF:pdf_url title:item_json[@"doc_number"] subject:subject islocal:false]; // if(self.blk_Select) // { // // // SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath]; // // NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]]; // // // UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]]; // // // self.blk_Select(item_json[@"file"]); // // } // // [self dismissViewControllerAnimated:false completion:nil]; // if (tableView.isEditing) { // 编辑模式下不响应 // return; // } // // // if(indexPath.row==self.content_data.count) // return; // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // // if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer // if ([Singleton sharedInstance].global_lock) { // Order list 被锁 // [RAUtils message_alert:@"App is locked,You can't view the order Detail" title:@"Warning" controller:self]; // return; // } // } // // NSString* orderid= [self.content_data[indexPath.row] valueForKey:@"order_id"]; // OrderDetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailViewController" ]; // // // int i =[[self.content_data[indexPath.row] valueForKey:@"order_code"]; // dvc.selectOrder=^(NSMutableDictionary* order_detail){ // // [self.navigationController popViewControllerAnimated:false]; // if(self.selectOrder) // self.selectOrder(order_detail); // // // // }; // NSString* order_code =[self.content_data[indexPath.row] valueForKey:@"order_code"]; // // dvc.is_shoporder=(self.orderType == 0); // dvc.order_code = order_code; // dvc.order_status =[[self.content_data[indexPath.row] valueForKey:@"orderStatus"] intValue]; // // bool temp_order = false ; // // NSString* order_status=[self.content_data[indexPath.row] valueForKey:@"order_status"]; // // if([order_status isEqualToString:@"Saved"]||[order_status isEqualToString:@"Quoted"]) // // temp_order=true; // // // // dvc.isTempOrder = temp_order; // // // dvc // // dvc.orderid=orderid; // // dvc.category_id=nil; // // dvc.ispush=true; // // [dvc reload]; // [self.navigationController pushViewController:dvc animated:true]; } - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { __weak typeof (self) weekself=self; __weak NSIndexPath* weekindex = indexPath; NSDictionary * item_json = self.table_data[indexPath.row]; NSString* notes = item_json[@"notes"]; NSString* doc_number = item_json[@"doc_number"]; NSString* pdfurl =item_json[@"pdf_path1"]; NSString* jsonurl =item_json[@"json_path1"]; NSString* md51 =item_json[@"pdf_md5_str"]; NSMutableArray* arr_doc = [item_json[@"documents"] mutableCopy]; UITableViewRowAction *docAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Documents"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { DebugLog(@"Documents click"); [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle]; ExtDocumentsViewController * docVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"ExtDocumentsViewController"]; docVC.docNumber = doc_number; docVC.arr_documents =arr_doc; docVC.closeExtDoc=^(bool refresh){ if(refresh) { self.reset_result=true; // self.norefresh=true; [self loadpage]; } // [weekself.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:weekindex, nil] withRowAnimation:UITableViewRowAnimationAutomatic]; }; // notesVC.docNotes = notes; UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:docVC] ; navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种 [self presentViewController:navi animated:YES completion:^{ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320); DebugLog(@"filter present........."); // self.btop = false; // <#code#> }]; }]; docAction.backgroundColor = UIColorFromRGB(0xff9933); UITableViewRowAction *modifyAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@" Modify " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle]; __weak typeof(self) weakSelf = self; DebugLog(@"modify click"); UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Downloading contract"]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ NSData* jsondata= [NSData dataWithContentsOfURL:[NSURL URLWithString:jsonurl]]; NSData* pdfdata= [NSData dataWithContentsOfURL:[NSURL URLWithString:pdfurl]]; dispatch_async(dispatch_get_main_queue(), ^{ [waitalert dismissWithClickedButtonIndex:0 animated:FALSE]; if(jsondata==nil||pdfdata==nil) { [RAUtils message_alert:@"Please try again." title:@"Can not download contract" controller:self]; return; } NSString* tempDir = NSTemporaryDirectory(); NSString* jsonpath=[tempDir stringByAppendingPathComponent:@"json.json"]; NSString* pdfpath=[tempDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.pdf",item_json[@"doc_number"]]]; [jsondata writeToFile:jsonpath atomically:true]; [pdfdata writeToFile:pdfpath atomically:true]; NSString* md52 = [RAUtils md5WithFile:pdfpath]; if(md51.length>0&&![md51 isEqualToString:md52]) { [RAUtils message_alert:@"Please try again." title:@"Can not download contract" controller:self]; return; } DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ]; // dvc.templateName = @"debug.json"; dvc.templatePath = jsonpath; dvc.pdfPath = pdfpath; dvc.action = PDFEditActionModify; dvc.docment_id = item_json[@"doc_number"]; dvc.OnSave=^(NSString* file, NSString* subject) { [weakSelf previewPDF:file title:item_json[@"doc_number"] subject:subject islocal:true]; }; [self.navigationController pushViewController:dvc animated:true]; }); }); // [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle]; // DocnotesViewController * notesVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"DocnotesViewController"]; // // notesVC.docNumber = doc_number; // notesVC.docNotes = notes; // // UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:notesVC] ; // // // // // // // navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种 // [self presentViewController:navi animated:YES completion:^{ // // // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320); // // DebugLog(@"filter present........."); // // // self.btop = false; // // <#code#> // }]; }]; modifyAction.backgroundColor = UIColorFromRGB(0x9BBF5A); UITableViewRowAction *noteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@" Note " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { DebugLog(@"note click"); [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle]; DocnotesViewController * notesVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"DocnotesViewController"]; notesVC.docNumber = doc_number; notesVC.docNotes = notes; UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:notesVC] ; navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种 [self presentViewController:navi animated:YES completion:^{ // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320); DebugLog(@"filter present........."); // self.btop = false; // <#code#> }]; }]; noteAction.backgroundColor = UIColorFromRGB(0x336699); // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; if(jsonurl.length>0) return @[modifyAction,docAction,noteAction]; else return @[docAction,noteAction]; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // if(indexPath.row==self.content_data.count) // return NO; // // if(self.init_style==OL_OPEN) // return NO; // // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // // NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"]; // NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue]; // // if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // // saved && ((type==0 && merge_permission) || type == 1 || can_cancel) // // BOOL isSavedOrder = /*[order_status isEqualToString:@"Saved Order"]*/statusCode == 1; // switch (self.orderType) { // case 0:{ // Shop Order // // if (!isSavedOrder) { // return NO; // } else { // if ([Singleton sharedInstance].permissions_merge_order || appDelegate.can_cancel_order) { // return YES; // } else { // return NO; // } // } // // } // break; // case 1:{ // Sales Order // if (isSavedOrder && appDelegate.can_cancel_order) { // return YES; // } // return NO; // } // break; // // default: // break; // } // // } else { // return YES; // } return YES; } - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { } - (UITableViewCellEditingStyle)tableView:(UITableView *)tv editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleDelete; // if(indexPath.row==self.content_data.count) // return UITableViewCellEditingStyleNone; // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // bool offline_edit =[[self.content_data[indexPath.row] valueForKey:@"offline_edit"] boolValue]; // // // NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"]; // NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue]; // if(/*![order_status isEqualToString:@"Saved Order"]&&! [order_status isEqualToString:@"Quote Saved"]*/statusCode != 1 && statusCode != 0) // return UITableViewCellEditingStyleNone; // else // { // if(appDelegate.offline_mode==false||offline_edit) // return UITableViewCellEditingStyleDelete; // else // return UITableViewCellEditingStyleNone; // } } @end