Pārlūkot izejas kodu

160903
Add select upload order

Ray Zhang 9 gadi atpakaļ
vecāks
revīzija
a889ba9926

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


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

@@ -271,7 +271,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "991"
             endingLineNumber = "991"
-            landmarkName = "-check_offline:useInternalAddress:"
+            landmarkName = "-check_offline:useInternalAddress:parentvc:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>

+ 4 - 4
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m

@@ -77,7 +77,7 @@
                     
                     if(sender==nil)
                     {
-                        [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn];
+                        [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
                         SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
                         syncVC.action_string=@"Download";
                         UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
@@ -106,7 +106,7 @@
                         
                         
                         UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-                            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn];
+                            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
                             
                             
                             SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
@@ -190,7 +190,7 @@
         
         if(sender==nil)
         {
-            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn];
+            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
             SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
             syncVC.action_string=@"Download";
             UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
@@ -219,7 +219,7 @@
             
             
             UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-                [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn];
+                [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
                 
                 
                 SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/offline/SelectUploadOrderViewController.h

@@ -9,5 +9,5 @@
 #import <UIKit/UIKit.h>
 
 @interface SelectUploadOrderViewController : UIViewController
-
+@property (nonatomic , copy) void (^returnValue)(NSArray* SelectedOrder);
 @end

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.h

@@ -86,7 +86,7 @@
 
 -(void) update_count_mark;
 // downloader
--(void) check_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress;
+-(void) check_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress parentvc:(UIViewController*) parent;
 @property (nonatomic, strong) SyncControlPanelViewController *settingUI;
 @property (nonatomic, strong) NSFileHandle *fileHandle;
 //@property (nonatomic, assign) long long currentLength; //>>写入文件的长度

+ 36 - 7
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -14,6 +14,7 @@
 #import "DefaultAppearance.h"
 #import "OLDataProvider.h"
 #import "AFHTTPSessionManager.h"
+#import "SelectUploadOrderViewController.h"
 
 
 #define UNZIP_OPEN_FAILED 0
@@ -769,11 +770,11 @@
         }
     });
 }
--(void) upload_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress
+-(void) upload_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress orderid:(NSArray*)arr_order
 {
     [self add_downloadlog:@"Begin sync, please wait."];
     [self add_downloadlog:@"Prepare upload data."];
-    NSArray* arr_order=[OLDataProvider enumOfflineOrder];
+ //   NSArray* arr_order=[OLDataProvider enumOfflineOrder];
     NSDictionary* upjson=[OLDataProvider prepareUpload:arr_order];
     
     NSString* upfile=upjson[@"file"];
@@ -983,11 +984,39 @@
         
     });
 }
--(void) check_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress
+-(void) check_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress parentvc:(UIViewController*) parent
 {
-    
-
-    [self upload_offline:ver useInternalAddress:buseinternaladdress];
+ 
+    NSArray* arr_order=[OLDataProvider enumOfflineOrder];
+    if(arr_order.count>0)
+    {
+        
+        {
+            SelectUploadOrderViewController * vc =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SelectUploadOrderViewController"];
+            vc.returnValue = ^(NSArray* SelectedOrder){
+                
+                [self upload_offline:ver useInternalAddress:buseinternaladdress orderid:SelectedOrder];
+                
+            };
+            
+            UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
+            
+            
+            
+            
+            
+            
+            navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+            [parent presentViewController:navi animated:YES completion:^{
+                
+                
+            }];
+        }
+        
+        
+    }
+    else
+        [self upload_offline:ver useInternalAddress:buseinternaladdress orderid:nil];
     
 
     
@@ -996,7 +1025,7 @@
     
     
 }
--(void) download_offline:(bool) start checkdiskspace:(bool) checkdiskspace 
+-(void) download_offline:(bool) start checkdiskspace:(bool) checkdiskspace
 {
     if(start)
     {