Просмотр исходного кода

160824

Add save signature picture under offline mode.
Ray Zhang 9 лет назад
Родитель
Сommit
7646bfb57a

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 20 - 4
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -484,11 +484,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/order/OrderDetailViewController.m"
-            timestampString = "493722621.393959"
+            timestampString = "493724135.27371"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "673"
-            endingLineNumber = "673"
+            startingLineNumber = "711"
+            endingLineNumber = "711"
             landmarkName = "-onOpenOrderClick:"
             landmarkType = "5">
          </BreakpointContent>
@@ -1022,7 +1022,7 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
@@ -1067,5 +1067,21 @@
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "493723937.720841"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1419"
+            endingLineNumber = "1419"
+            landmarkName = "+offline_signorder:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 43 - 5
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -457,11 +457,49 @@
             NSString* img_url_down = json[@"img_url_aname"];
             NSString* img_url_up = json[@"img_url"];
             
-            [self.content_data setValue:img_url_down forKey:@"sign_url"];
-            //self.btnSign.enabled = false;
-            [self.detailTable reloadData];
-            
-            [RAUtils message_alert:@"Successful." title:@"Signature" controller:self];
+            {
+                UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Signature"];
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                    
+                    NSDictionary* order_json = [iSalesNetwork sign_Order:self.order_code path:img_url_up];
+                    
+                    dispatch_async(dispatch_get_main_queue(), ^{
+                        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                        if([[order_json valueForKey:@"result"] intValue]==2)
+                        {
+                            //                                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                            //                                appDelegate.order_code = self.order_code;
+                            //                                [appDelegate SetSo:[self.content_data valueForKey:@"so#"]];
+                            //
+                            //
+                            //                                appDelegate.customerInfo=[[self.content_data objectForKey:@"customerInfo"] mutableCopy];
+                            //
+                            //                                appDelegate.contact_id=[appDelegate.customerInfo valueForKey:@"customer_cid"];
+                            //                                [self.navigationController popViewControllerAnimated:false];
+                            //
+                            //                                [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+                            //                                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+                            //                                if(self.selectOrder)
+                            //                                    self.selectOrder(self.content_data);
+                            
+                            [self.content_data setValue:img_url_down forKey:@"sign_url"];
+                            //self.btnSign.enabled = false;
+                            [self.detailTable reloadData];
+                            
+                            [RAUtils message_alert:@"Successful." title:@"Signature" controller:self];
+                            
+                            
+                        }
+                        else
+                        {
+                            [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Signature" controller:self] ;
+                        }
+                        
+                        
+                        
+                    });
+                });
+            }
         }
         else
         {