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

修改Create Order,区别Customer和Employee。

Pen Li 9 лет назад
Родитель
Сommit
a0e8818e70

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


+ 18 - 0
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -2,4 +2,22 @@
 <Bucket
    type = "0"
    version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/OrderListViewController.m"
+            timestampString = "498536117.041828"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "652"
+            endingLineNumber = "652"
+            landmarkName = "-alertView:clickedButtonAtIndex:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
 </Bucket>

+ 41 - 38
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -556,51 +556,54 @@
     {
         AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
         
-        if(appDelegate.order_code.length>0)
+        if(appDelegate.order_code && appDelegate.order_code.length>0)
         {
             appDelegate.order_code= nil;
             [appDelegate SetSo:nil];
             
-            //     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
-            ContactListViewController* cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-            cvc.showNavibar = true;
-            cvc.contact_type = @"Sales_Order_Customer";
-            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+            if (appDelegate.user_type == USER_ROLE_EMPLOYEE) {
+                //     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+                ContactListViewController* cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                cvc.showNavibar = true;
+                cvc.contact_type = @"Sales_Order_Customer";
+                cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+                    
+                    appDelegate.contact_id=[value valueForKey:@"customer_cid"];
+                    appDelegate.customerInfo = value;
+                    
+                    self.norefresh = true;
+                    [self neworder];
+                    
+                    
+                    
+                    //    [main_vc checklogin:true];
+                    //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+                    
+                    //
+                    //                if(self.returnValue)
+                    //                    self.returnValue(value);
+                };
                 
-                appDelegate.contact_id=[value valueForKey:@"customer_cid"];
-                appDelegate.customerInfo = value;
+                cvc.onCancel = ^(){
+                    self.norefresh = true;
+                    if(appDelegate.customerInfo==nil)
+                    {
+                        [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"" controller:self];
+                    }
+                    else
+                    {
+                        [self neworder];
+                    }
+                    //  [main_vc checklogin:true];
+                };
+                cvc.onReset = ^(){
+                    //   [main_vc checklogin:true];
+                };
                 
-                self.norefresh = true;
+                [self.navigationController pushViewController:cvc animated:true];
+            } else if (appDelegate.user_type == USER_ROLE_CUSTOMER){
                 [self neworder];
-                
-                
-                
-                //    [main_vc checklogin:true];
-                //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
-                
-                //
-                //                if(self.returnValue)
-                //                    self.returnValue(value);
-            };
-            
-            cvc.onCancel = ^(){
-                self.norefresh = true;
-                if(appDelegate.customerInfo==nil)
-                {
-                    [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"" controller:self];
-                }
-                else
-                {
-                    [self neworder];
-                }
-                //  [main_vc checklogin:true];
-            };
-            cvc.onReset = ^(){
-                //   [main_vc checklogin:true];
-            };
-            
-            [self.navigationController pushViewController:cvc animated:true];
-            
+            }
             
         }
         else