Forráskód Böngészése

ERP MOBILE
改用新的跨对象通信方式,通过定义 RA_NOTIFICATION 宏控制。原方式保留。

Ray Zhang 7 éve
szülő
commit
7c2bb2be85
57 módosított fájl, 1817 hozzáadás és 871 törlés
  1. BIN
      Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  2. 12 12
      Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 5 1
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj
  4. 1 3
      Ants Contract/AntsContract/AntsContract.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/AntsContract.xcscheme
  5. 6 0
      Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj
  6. 1 2
      Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/Granite Expo eSign.xcscheme
  7. 1 1
      Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m
  8. 1 0
      Ants Contract/Granite Expo eSign/Granite Expo eSign/const.h
  9. 2 2
      Ants Contract/common/ACNetwork.m
  10. 1 1
      Ants Contract/common/AppDelegate.m
  11. 1 1
      Ants Contract/common/DocumentListViewController.m
  12. 214 294
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  13. 3 0
      RedAnt ERP Mobile/common/ActiveViewController.h
  14. 116 15
      RedAnt ERP Mobile/common/ActiveViewController.m
  15. 10 1
      RedAnt ERP Mobile/common/Functions/MainViewController.h
  16. 52 31
      RedAnt ERP Mobile/common/Functions/MainViewController.m
  17. 295 101
      RedAnt ERP Mobile/common/Functions/PDF+Web/RAPDFViewController.m
  18. 23 4
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  19. 68 16
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  20. 41 6
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m
  21. 18 2
      RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m
  22. 6 1
      RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m
  23. 8 0
      RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m
  24. 9 1
      RedAnt ERP Mobile/common/Functions/home/HomeViewController.m
  25. 53 14
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  26. 28 0
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  27. 57 7
      RedAnt ERP Mobile/common/Functions/modelDetail/HomerModelDetailHeaderCell.m
  28. 6 6
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m
  29. 36 10
      RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m
  30. 27 0
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  31. 35 11
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m
  32. 60 2
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  33. 11 1
      RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m
  34. 29 0
      RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m
  35. 17 5
      RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m
  36. 108 71
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  37. 18 2
      RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m
  38. 36 6
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m
  39. 34 8
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m
  40. 2 1
      RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.h
  41. 193 205
      RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m
  42. 30 17
      RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m
  43. 2 0
      RedAnt ERP Mobile/common/NotificationNameCenter.h
  44. 1 0
      RedAnt ERP Mobile/common/NotificationNameCenter.m
  45. 1 1
      RedAnt ERP Mobile/common/RAUtils.h
  46. 6 6
      RedAnt ERP Mobile/common/RAUtils.m
  47. 38 0
      RedAnt ERP Mobile/common/categoryMenu_RATree/RAViewController.m
  48. 8 0
      RedAnt ERP Mobile/iSales-GATIT/AppDelegate.m
  49. 10 1
      RedAnt ERP Mobile/iSales-HOMER/AppDelegate.m
  50. 9 0
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.m
  51. 9 0
      RedAnt ERP Mobile/iSales-TRADESHOW/AppDelegate.m
  52. 8 0
      RedAnt ERP Mobile/iSales-USAI/AppDelegate.m
  53. 2 0
      RedAnt ERP Mobile/iSales-UWAVER/AppDelegate.h
  54. 29 2
      RedAnt ERP Mobile/iSales-UWAVER/AppDelegate.m
  55. 2 0
      RedAnt ERP Mobile/iSales-UWAVER/config.h
  56. 5 0
      common/RAConvertor.h
  57. 13 0
      common/RAConvertor.m

BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 12 - 12
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -202,7 +202,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
-            timestampString = "530863084.531539"
+            timestampString = "554955819.2964211"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1225"
@@ -266,7 +266,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
-            timestampString = "530863084.53177"
+            timestampString = "554955819.296723"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "504"
@@ -298,7 +298,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
-            timestampString = "530863084.531891"
+            timestampString = "554955819.29684"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1134"
@@ -314,7 +314,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
-            timestampString = "530863084.532015"
+            timestampString = "554955819.296918"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1212"
@@ -330,7 +330,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/ACNetwork.m"
-            timestampString = "530863084.532123"
+            timestampString = "554955819.2969739"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "363"
@@ -362,7 +362,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m"
-            timestampString = "530863084.53227"
+            timestampString = "554955819.297063"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "207"
@@ -442,7 +442,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "531110333.714406"
+            timestampString = "554955819.297251"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1078"
@@ -458,7 +458,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/ACNetwork.m"
-            timestampString = "530863084.532985"
+            timestampString = "554955819.297314"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "664"
@@ -522,7 +522,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "531110333.716953"
+            timestampString = "554955819.297456"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1065"
@@ -554,7 +554,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "531110333.717359"
+            timestampString = "554955819.2975399"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1066"
@@ -602,7 +602,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "531110333.717709"
+            timestampString = "554955819.297591"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1077"
@@ -618,7 +618,7 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/DocumentListViewController.m"
-            timestampString = "531110333.718054"
+            timestampString = "554955819.297641"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1083"

+ 5 - 1
Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj

@@ -366,7 +366,7 @@
 		713E83AA1E037C2000C4F12A /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0900;
+				LastUpgradeCheck = 0940;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713E83B11E037C2000C4F12A = {
@@ -491,6 +491,7 @@
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
@@ -498,6 +499,7 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -546,6 +548,7 @@
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
@@ -553,6 +556,7 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

+ 1 - 3
Ants Contract/AntsContract/AntsContract.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/AntsContract.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0900"
+   LastUpgradeVersion = "0940"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      language = ""
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       </Testables>
@@ -46,7 +45,6 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      language = ""
       launchStyle = "0"
       useCustomWorkingDirectory = "NO"
       ignoresPersistentStateOnLaunch = "NO"

+ 6 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -82,6 +82,7 @@
 		714B37081E70FCFE00E99B90 /* cam_scan.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 714B37071E70FCFE00E99B90 /* cam_scan.storyboard */; };
 		714B870B1E24CAE300A40D18 /* debug.json in Resources */ = {isa = PBXBuildFile; fileRef = 714B870A1E24CAE200A40D18 /* debug.json */; };
 		717243441E1CCCEC00800678 /* CustomIOSAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 717243431E1CCCEC00800678 /* CustomIOSAlertView.m */; };
+		718697592113F40D00CE31EC /* RAConvertor.m in Sources */ = {isa = PBXBuildFile; fileRef = 718697582113F40D00CE31EC /* RAConvertor.m */; };
 		7188C2891E8E435500938FFC /* GEIC - Home Improvement Contract 2017 Update.json in Resources */ = {isa = PBXBuildFile; fileRef = 7188C2881E8E435500938FFC /* GEIC - Home Improvement Contract 2017 Update.json */; };
 		71B152EF1E66C87F00D2E5EC /* AddExtDocumentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B152EE1E66C87F00D2E5EC /* AddExtDocumentViewController.m */; };
 		71BBFC371E6419D4008668A7 /* ExtDocumentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BBFC361E6419D4008668A7 /* ExtDocumentsViewController.m */; };
@@ -233,6 +234,8 @@
 		714B870A1E24CAE200A40D18 /* debug.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = debug.json; sourceTree = "<group>"; };
 		717243421E1CCCEC00800678 /* CustomIOSAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomIOSAlertView.h; path = "../../../RedAnt ERP Mobile/common/customUI/CustomIOSAlertView.h"; sourceTree = "<group>"; };
 		717243431E1CCCEC00800678 /* CustomIOSAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomIOSAlertView.m; path = "../../../RedAnt ERP Mobile/common/customUI/CustomIOSAlertView.m"; sourceTree = "<group>"; };
+		718697572113F40D00CE31EC /* RAConvertor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAConvertor.h; path = ../../../common/RAConvertor.h; sourceTree = "<group>"; };
+		718697582113F40D00CE31EC /* RAConvertor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAConvertor.m; path = ../../../common/RAConvertor.m; sourceTree = "<group>"; };
 		7188C2881E8E435500938FFC /* GEIC - Home Improvement Contract 2017 Update.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "GEIC - Home Improvement Contract 2017 Update.json"; path = "Granite Expo eSign/GEIC - Home Improvement Contract 2017 Update.json"; sourceTree = "<group>"; };
 		71B152ED1E66C87F00D2E5EC /* AddExtDocumentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddExtDocumentViewController.h; path = ../../common/AddExtDocumentViewController.h; sourceTree = "<group>"; };
 		71B152EE1E66C87F00D2E5EC /* AddExtDocumentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AddExtDocumentViewController.m; path = ../../common/AddExtDocumentViewController.m; sourceTree = "<group>"; };
@@ -492,6 +495,8 @@
 				7128C2BF1E1250FC00FF635B /* TextUtils.m */,
 				7128C2C01E1250FC00FF635B /* Reachability.h */,
 				7128C2C11E1250FC00FF635B /* Reachability.m */,
+				718697572113F40D00CE31EC /* RAConvertor.h */,
+				718697582113F40D00CE31EC /* RAConvertor.m */,
 				7128C2C41E1250FC00FF635B /* RAUtils.h */,
 				7128C2C51E1250FC00FF635B /* RAUtils.m */,
 			);
@@ -690,6 +695,7 @@
 				714A9AEC1E9CA92000371995 /* PendingDocumentsViewController.m in Sources */,
 				7128C28E1E12501B00FF635B /* TouchImageView.m in Sources */,
 				42D49E5C1F8DF16B00AE39D5 /* AttributeSwitchCell.m in Sources */,
+				718697592113F40D00CE31EC /* RAConvertor.m in Sources */,
 				7128C2B41E1250CA00FF635B /* GridDrawable.m in Sources */,
 				71CDA0931F75EEBF0079F8E6 /* TemplateViewController.m in Sources */,
 				42D49E561F8DF13A00AE39D5 /* AttributeTextFieldCell.m in Sources */,

+ 1 - 2
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/Granite Expo eSign.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0900"
+   LastUpgradeVersion = "0940"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      language = ""
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       </Testables>

+ 1 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m

@@ -533,7 +533,7 @@
     
     
     
-    NSString* str= [RAUtils dict2string:self.controlTemplate];
+    NSString* str= [RAConvertor dict2string:self.controlTemplate];
     
     
     

+ 1 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/const.h

@@ -53,6 +53,7 @@
 
 
 #define RESULT_FALSE 0
+#define RESULT_NO_RESPONSE 1
 #define RESULT_TRUE         2
 #define RESULT_NO_EMAIL_ADDRESS      3
 #define RESULT_NET_SERVER_ERR         -1

+ 2 - 2
Ants Contract/common/ACNetwork.m

@@ -100,7 +100,7 @@
         
         NSString* base64str = jsobj[@"str"];
         NSString* decryptstr=[AESCrypt AES128Decrypt:base64str key:@"usai2010"];
-        jsobj=[[RAUtils string2dict:decryptstr] mutableCopy];
+        jsobj=[[RAConvertor string2dict:decryptstr] mutableCopy];
         return jsobj;
     }];
     
@@ -648,7 +648,7 @@
 //    ret[@"portfolio"] = [self preparePortfolio:serial];
 //    ret[@"view_portfolio"] = [self preparePDF:serial];
     
-    NSString* str= [RAUtils dict2string:json];
+    NSString* str= [RAConvertor dict2string:json];
     
     
     

+ 1 - 1
Ants Contract/common/AppDelegate.m

@@ -95,7 +95,7 @@
 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options
 {
 
-    NSLog(@"URL:%@, OPTIONS:%@",[url absoluteString],[RAUtils dict2string:options]);
+    NSLog(@"URL:%@, OPTIONS:%@",[url absoluteString],[RAConvertor dict2string:options]);
     
     if (self.accessMode == AppAccessModeOffline) {
         [RAUtils message_alert:@"Cann't upload file on offline mode" title:@"Warning" controller:self.window.rootViewController];

+ 1 - 1
Ants Contract/common/DocumentListViewController.m

@@ -801,7 +801,7 @@
         [arr_ext addObject:@"\r\n"];
         [arr_ext addObject:tel];
         
-        NSString *nsext=[RAUtils arr2string:arr_ext separator:@", " trim:true];
+        NSString *nsext=[RAConvertor arr2string:arr_ext separator:@", " trim:true];
         
         
         nsext=[nsext stringByReplacingOccurrencesOfString:@", \r\n," withString:@"\r\n"];

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

@@ -3,35 +3,19 @@
    type = "0"
    version = "2.0">
    <Breakpoints>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/HomerModelDetailHeaderCell.m"
-            timestampString = "538984709.337212"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "383"
-            endingLineNumber = "383"
-            landmarkName = "-addtocart"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/HomerModelDetailHeaderCell.m"
-            timestampString = "538984709.340925"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805778.632166"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "114"
-            endingLineNumber = "114"
-            landmarkName = "-generate_information"
+            startingLineNumber = "126"
+            endingLineNumber = "126"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -41,13 +25,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/RAOrderPreviewController.m"
-            timestampString = "536721848.4472"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805778.6332819"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1318"
-            endingLineNumber = "1318"
-            landmarkName = "-onCommitOrderClick:"
+            startingLineNumber = "97"
+            endingLineNumber = "97"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -57,29 +41,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/RAOrderPreviewController.m"
-            timestampString = "536721848.447269"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805778.634837"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2037"
-            endingLineNumber = "2037"
-            landmarkName = "-alertView:clickedButtonAtIndex:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/HomerModelDetailHeaderCell.m"
-            timestampString = "538984709.341668"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "96"
-            endingLineNumber = "96"
-            landmarkName = "-generate_information"
+            startingLineNumber = "37"
+            endingLineNumber = "37"
+            landmarkName = "-viewWillAppear:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -89,45 +57,45 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/HomerModelDetailHeaderCell.m"
-            timestampString = "538984709.342626"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805778.635595"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "152"
-            endingLineNumber = "152"
-            landmarkName = "-generate_information"
+            startingLineNumber = "186"
+            endingLineNumber = "186"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "No"
+            shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/DetailViewController.m"
-            timestampString = "538020091.961291"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805778.636358"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "719"
-            endingLineNumber = "719"
-            landmarkName = "-numberOfSectionsInTableView:"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "No"
+            shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/modelDetail/DetailViewController.m"
-            timestampString = "538020091.961424"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554805821.695904"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "759"
-            endingLineNumber = "759"
-            landmarkName = "-tableView:numberOfRowsInSection:"
+            startingLineNumber = "237"
+            endingLineNumber = "237"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -137,13 +105,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/category/CategorySearchFilterViewController.m"
-            timestampString = "537777448.287726"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "554806785.342867"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "56"
-            endingLineNumber = "56"
-            landmarkName = "-initUI"
+            startingLineNumber = "183"
+            endingLineNumber = "183"
+            landmarkName = "-startAirPrintWithData1:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -153,13 +121,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/MainViewController.m"
-            timestampString = "554278569.506868"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.407251"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "102"
-            endingLineNumber = "102"
-            landmarkName = "-reloadCart:immediately:"
+            startingLineNumber = "133"
+            endingLineNumber = "133"
+            landmarkName = "-refresh_on_login"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -169,62 +137,14 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/category/CategoryViewController.m"
-            timestampString = "538020091.961735"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2225"
-            endingLineNumber = "2225"
-            landmarkName = "-collectionView:didSelectItemAtIndexPath:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/search+itemsearch/ItemSearchViewController.m"
-            timestampString = "537775682.16919"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.40762"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1998"
-            endingLineNumber = "1998"
-            landmarkName = "-collectionView:didSelectItemAtIndexPath:"
+            startingLineNumber = "186"
+            endingLineNumber = "186"
+            landmarkName = "-OnUpdatePrice:"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "-[ItemSearchViewController collectionView:didSelectItemAtIndexPath:]"
-                  moduleName = "NPD Mobile"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/ray/Documents/CODE_ERPSuiteIOS/RedAnt%20ERP%20Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m"
-                  timestampString = "554780022.663783"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "1999"
-                  endingLineNumber = "1999"
-                  offsetFromSymbolStart = "1544">
-               </Location>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "-[ItemSearchViewController collectionView:didSelectItemAtIndexPath:]"
-                  moduleName = "NPD Mobile"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/ray/Documents/CODE_ERPSuiteIOS/RedAnt%20ERP%20Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m"
-                  timestampString = "554780022.670694"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "1999"
-                  endingLineNumber = "1999"
-                  offsetFromSymbolStart = "1552">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -233,13 +153,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/search+itemsearch/ItemSearchViewController.m"
-            timestampString = "537775682.169247"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.407714"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1951"
-            endingLineNumber = "1951"
-            landmarkName = "-collectionView:didSelectItemAtIndexPath:"
+            startingLineNumber = "207"
+            endingLineNumber = "207"
+            landmarkName = "-OnUpdatePrice:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -249,13 +169,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.421681"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.407779"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1060"
-            endingLineNumber = "1060"
-            landmarkName = "-setLineWidth:"
+            startingLineNumber = "229"
+            endingLineNumber = "229"
+            landmarkName = "-OnRefreshUI:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -265,13 +185,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.422219"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.40784"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1069"
-            endingLineNumber = "1069"
-            landmarkName = "-touchesBegan:withEvent:"
+            startingLineNumber = "212"
+            endingLineNumber = "212"
+            landmarkName = "-OnUpdatePrice:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -281,13 +201,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.422496"
+            filePath = "common/Functions/portfolio/PortfolioViewController.m"
+            timestampString = "555404648.408002"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1068"
-            endingLineNumber = "1068"
-            landmarkName = "-touchesBegan:withEvent:"
+            startingLineNumber = "474"
+            endingLineNumber = "474"
+            landmarkName = "-viewDidLoad"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -297,13 +217,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.422742"
+            filePath = "common/Functions/portfolio/PortfolioViewController.m"
+            timestampString = "555404648.408191"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1067"
-            endingLineNumber = "1067"
-            landmarkName = "-touchesBegan:withEvent:"
+            startingLineNumber = "879"
+            endingLineNumber = "879"
+            landmarkName = "-viewWillAppear:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -313,13 +233,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/MainViewController.m"
-            timestampString = "554278569.507392"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.408271"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "131"
-            endingLineNumber = "131"
-            landmarkName = "-reloadPortfolio:immediately:"
+            startingLineNumber = "53"
+            endingLineNumber = "53"
+            landmarkName = "-viewWillAppear:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -330,28 +250,28 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/ActiveViewController.m"
-            timestampString = "554285267.8000849"
+            timestampString = "555404648.408352"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "168"
-            endingLineNumber = "168"
-            landmarkName = "-OnRefreshUI:"
+            startingLineNumber = "24"
+            endingLineNumber = "24"
+            landmarkName = "-viewDidLoad"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/ActiveViewController.m"
-            timestampString = "554285267.800195"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.408496"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "147"
-            endingLineNumber = "147"
-            landmarkName = "-onLogUpdate"
+            startingLineNumber = "1240"
+            endingLineNumber = "1240"
+            landmarkName = "-willRotateToInterfaceOrientation:duration:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -361,13 +281,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureViewController.m"
-            timestampString = "554191896.03938"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.408677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "192"
-            endingLineNumber = "192"
-            landmarkName = "-onDone:"
+            startingLineNumber = "1227"
+            endingLineNumber = "1227"
+            landmarkName = "-didRotateFromInterfaceOrientation:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -377,29 +297,29 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.423076"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.4087501"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "686"
-            endingLineNumber = "686"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "1226"
+            endingLineNumber = "1226"
+            landmarkName = "-didRotateFromInterfaceOrientation:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.423352"
+            filePath = "common/Functions/home/HomeViewController.m"
+            timestampString = "555232522.670557"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "687"
-            endingLineNumber = "687"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "255"
+            endingLineNumber = "255"
+            landmarkName = "-didRotateFromInterfaceOrientation:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -409,45 +329,45 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.423622"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.4088759"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "694"
-            endingLineNumber = "694"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "1483"
+            endingLineNumber = "1483"
+            landmarkName = "-viewWillAppear:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.423862"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.408972"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "692"
-            endingLineNumber = "692"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "1206"
+            endingLineNumber = "1206"
+            landmarkName = "-reload"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.424113"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.565688"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "709"
-            endingLineNumber = "709"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
+            landmarkName = "-operation_loadpage"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -457,13 +377,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureViewController.m"
-            timestampString = "554191896.039523"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.565889"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "196"
-            endingLineNumber = "196"
-            landmarkName = "-onDone:"
+            startingLineNumber = "260"
+            endingLineNumber = "260"
+            landmarkName = "-operation_loadpage"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -473,13 +393,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.424377"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.565942"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "605"
-            endingLineNumber = "605"
-            landmarkName = "-initWithFrame:context:"
+            startingLineNumber = "292"
+            endingLineNumber = "292"
+            landmarkName = "-operation_loadpage"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -489,13 +409,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.4246221"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.565991"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "670"
-            endingLineNumber = "670"
-            landmarkName = "-updateRectWithPoint:"
+            startingLineNumber = "296"
+            endingLineNumber = "296"
+            landmarkName = "-operation_loadpage"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -505,13 +425,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.424861"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.5660371"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "747"
-            endingLineNumber = "747"
-            landmarkName = "-tap:"
+            startingLineNumber = "334"
+            endingLineNumber = "334"
+            landmarkName = "-operation_loadpage"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -521,45 +441,45 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.425101"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.566084"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "669"
-            endingLineNumber = "669"
-            landmarkName = "-updateRectWithPoint:"
+            startingLineNumber = "711"
+            endingLineNumber = "711"
+            landmarkName = "-numberOfSectionsInTableView:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.425359"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "554980887.56613"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "712"
-            endingLineNumber = "712"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "717"
+            endingLineNumber = "717"
+            landmarkName = "-tableView:numberOfRowsInSection:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.425635"
+            filePath = "common/ImageUtils.m"
+            timestampString = "555232471.226006"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "697"
-            endingLineNumber = "697"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "44"
+            endingLineNumber = "44"
+            landmarkName = "+load_cached_img:loadFrom:size:allow_enlarge:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -569,29 +489,29 @@
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554026961.425874"
+            filePath = "common/Functions/home/HomeViewController.m"
+            timestampString = "555232522.671909"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "699"
-            endingLineNumber = "699"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "681"
+            endingLineNumber = "681"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/signature/SignatureView.m"
-            timestampString = "554027079.41415"
+            filePath = "common/ImageUtils.m"
+            timestampString = "555232563.2149251"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "703"
-            endingLineNumber = "703"
-            landmarkName = "-Signature2Image"
+            startingLineNumber = "60"
+            endingLineNumber = "60"
+            landmarkName = "+load_cached_img:loadFrom:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -601,13 +521,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/OrderDetailViewController.m"
-            timestampString = "554203827.046164"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.409366"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3497"
-            endingLineNumber = "3497"
-            landmarkName = "-webView:shouldStartLoadWithRequest:navigationType:"
+            startingLineNumber = "1929"
+            endingLineNumber = "1929"
+            landmarkName = "-collectionCell:setImageForIndexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -617,13 +537,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/ActiveViewController.m"
-            timestampString = "554285267.8006949"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.409444"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "98"
-            endingLineNumber = "98"
-            landmarkName = "-refresh_on_login"
+            startingLineNumber = "1958"
+            endingLineNumber = "1958"
+            landmarkName = "-collectionCell:setImageForIndexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -633,13 +553,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/ActiveViewController.m"
-            timestampString = "554285267.800792"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "555232764.8044471"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "110"
-            endingLineNumber = "110"
-            landmarkName = "-reload_container_getdata:"
+            startingLineNumber = "568"
+            endingLineNumber = "568"
+            landmarkName = "+load_cached_img:loadFrom:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -649,13 +569,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/ActiveViewController.m"
-            timestampString = "554285267.80088"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "555233035.0430681"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "57"
-            endingLineNumber = "57"
-            landmarkName = "-viewWillAppear:"
+            startingLineNumber = "501"
+            endingLineNumber = "501"
+            landmarkName = "+cache_img:filename:saveTo:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -665,13 +585,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/DefaultAppearance.m"
-            timestampString = "554264432.654189"
+            filePath = "common/Functions/category/CategoryViewController.m"
+            timestampString = "555404648.409621"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "77"
-            endingLineNumber = "77"
-            landmarkName = "+load_appearance"
+            startingLineNumber = "1907"
+            endingLineNumber = "1907"
+            landmarkName = "-collectionCell:setImageForIndexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -681,13 +601,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/DefaultAppearance.m"
-            timestampString = "554264432.6542619"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "555404648.409727"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "30"
-            endingLineNumber = "30"
-            landmarkName = "+init_appearance"
+            startingLineNumber = "438"
+            endingLineNumber = "438"
+            landmarkName = "-viewDidLoad"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -697,13 +617,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/DefaultAppearance.m"
-            timestampString = "554264432.654318"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404648.409822"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "90"
-            endingLineNumber = "90"
-            landmarkName = "+load_appearance"
+            startingLineNumber = "266"
+            endingLineNumber = "266"
+            landmarkName = "-OnReloadData:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -713,29 +633,29 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/DefaultAppearance.m"
-            timestampString = "554264432.654366"
+            filePath = "common/ActiveViewController.m"
+            timestampString = "555404728.423004"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "250"
-            endingLineNumber = "250"
-            landmarkName = "+set_appearance_item:"
+            startingLineNumber = "213"
+            endingLineNumber = "213"
+            landmarkName = "-OnUpdatePrice:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "No"
+            shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/DefaultAppearance.m"
-            timestampString = "554264432.654418"
+            filePath = "common/categoryMenu_RATree/RAViewController.m"
+            timestampString = "555408441.808314"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "104"
-            endingLineNumber = "104"
-            landmarkName = "+get_appearance:container:"
+            startingLineNumber = "343"
+            endingLineNumber = "343"
+            landmarkName = "-reload_data"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 3 - 0
RedAnt ERP Mobile/common/ActiveViewController.h

@@ -47,4 +47,7 @@
 -(void) refresh_ui;
 -(void) reload_data;
 -(void) clear_data;
+-(void) refresh_price;
+
++(void) Notify:(NSString*) arr_receiver Message:(NSString*)notification_msg ;
 @end

+ 116 - 15
RedAnt ERP Mobile/common/ActiveViewController.m

@@ -9,6 +9,7 @@
 #import "ActiveViewController.h"
 #import "config.h"
 #import "AppDelegate.h"
+#import "RAConvertor.h"
 //#import "NotificationNameCenter.h"
 
 @interface ActiveViewController ()
@@ -20,17 +21,29 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    self.refresh_type = REFRESH_DATA;
+
     
 #ifdef RA_NOTIFICATION
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OnRefreshUI:) name:RA_NOTIFICATION_REFRESH_UI object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OnReloadData:) name:RA_NOTIFICATION_RELOAD_DATA object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OnClearData:) name:RA_NOTIFICATION_CLEAR_DATA object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OnUpdatePrice:) name:RA_NOTIFICATION_UPDATE_PRICE object:nil];
+    
+    self.notification_refreshLevel = NotificationRefreshLevelData;
+#else
+    self.refresh_type = REFRESH_DATA;
 #endif
     
+    
     // Do any additional setup after loading the view.
 }
 
+- (void)dealloc
+{
+    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+}
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
@@ -38,7 +51,24 @@
 
 - (void)viewWillAppear:(BOOL)animated
 {
-        [super viewWillAppear:animated];
+    [super viewWillAppear:animated];
+    
+#ifdef RA_NOTIFICATION
+    switch (self.notification_refreshLevel)
+    {
+        case NotificationRefreshLevelView:
+            if([self respondsToSelector:@selector(refresh_ui)])
+                [self refresh_ui];
+            break;
+        case NotificationRefreshLevelData:
+            if([self respondsToSelector:@selector(reload_data)])
+                [self reload_data];
+            break;
+        default:
+            break;
+    }
+
+#else
     
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
@@ -46,7 +76,7 @@
     appDelegate.active_controller = self;
     
     
-
+    
     switch (self.refresh_type)
     {
         case REFRESH_VIEW:
@@ -60,6 +90,10 @@
             
             break;
     }
+#endif
+    
+    
+
 //    [[self navigationController] setNavigationBarHidden:YES animated:NO];
     
     
@@ -148,54 +182,100 @@
 }
 
 #pragma mark - Notification
+- (void)OnUpdatePrice: (NSNotification *)notification
+{
+    
+    if(self.disable_refresh)
+        return;
+    
+    NSDictionary* dict = [notification userInfo];
+    NSArray* arr= dict[@"receiver"];
+    
+    //如果当前对象不在不是指定接收者,也不是广播通信,就返回。
+    if([arr indexOfObject:[self class_name]]==NSNotFound&& arr.count>0)
+        return;
+    
+    //如果当前对象本身不支持此动作,则返回
+    if(![self respondsToSelector:@selector(refresh_price)])
+        return;
+    
+    //如果当前已有的处理层级更高(reload),则不处理,交给reload 处理。
+    if(self.notification_refreshLevel<NotificationRefreshLevelView)
+    {
+        if([self isVisible])
+        {
+                [self refresh_price];
+        }
+        else
+        {
+                self.notification_refreshLevel = NotificationRefreshLevelView;
+        }
+    }
+    
+
+}
+
 - (void)OnRefreshUI: (NSNotification *)notification
 {
+    
+    if(self.disable_refresh)
+        return;
+    
     NSDictionary* dict = [notification userInfo];
     NSArray* arr= dict[@"receiver"];
-    if([arr indexOfObject:[self class_name]]==NSNotFound)
+    if([arr indexOfObject:[self class_name]]==NSNotFound&& arr.count>0)
+        return;
+
+    if(![self respondsToSelector:@selector(refresh_ui)])
         return;
-//    if([self class_name] isEqualToString:@"")
     
     if(self.notification_refreshLevel<NotificationRefreshLevelView)
     {
         if([self isVisible])
         {
-            if([self respondsToSelector:@selector(refresh_ui)])
+
                 [self refresh_ui];
         }
         else
         {
-            self.notification_refreshLevel = NotificationRefreshLevelView;
+
+                self.notification_refreshLevel = NotificationRefreshLevelView;
         }
     }
 }
 - (void)OnReloadData: (NSNotification *)notification
 {
+    if(self.disable_refresh)
+        return;
+    
     NSDictionary* dict = [notification userInfo];
     NSArray* arr= dict[@"receiver"];
-    if([arr indexOfObject:[self class_name]]==NSNotFound)
+    if([arr indexOfObject:[self class_name]]==NSNotFound&& arr.count>0)
+        return;
+    if(![self respondsToSelector:@selector(reload_data)])
         return;
-    
     if(self.notification_refreshLevel<NotificationRefreshLevelData)
     {
         if([self isVisible])
         {
-            if([self respondsToSelector:@selector(reload_data)])
+
                 [self reload_data];
         }
         else
         {
-            self.notification_refreshLevel = NotificationRefreshLevelData;
+
+                self.notification_refreshLevel = NotificationRefreshLevelData;
         }
     }
     
 }
 - (void)OnClearData: (NSNotification *)notification
 {
-    
+    if(![self respondsToSelector:@selector(clear_data)])
+        return;
     if([self isVisible])
     {
-        if([self respondsToSelector:@selector(clear_data)])
+
         {
             [self clear_data];
             if([self respondsToSelector:@selector(refresh_ui)])
@@ -207,8 +287,7 @@
         if([self respondsToSelector:@selector(clear_data)])
         {
             [self clear_data];
-            if(self.notification_refreshLevel<NotificationRefreshLevelView)
-                self.notification_refreshLevel = NotificationRefreshLevelView;
+            self.notification_refreshLevel = NotificationRefreshLevelView;
         }
     }
 
@@ -226,4 +305,26 @@
 
     return [NSString stringWithUTF8String:class_name_ch];
 }
++(void) Notify:(NSString*) receiver Message:(NSString*)notification_msg
+{
+//NSArray* arr1 =[RAConvertor string2arr:@"abcde" separator:nil];
+//    NSArray* arr2 =[RAConvertor string2arr:nil separator:nil];
+    NSArray* arr_receiver = [RAConvertor string2arr:receiver separator:@","];
+    NSMutableDictionary* dict = [NSMutableDictionary new];
+    dict[@"receiver"]=arr_receiver;
+    NSString* notificationname = nil;
+    notificationname = notification_msg;
+
+
+    NSNotification *notification =[NSNotification notificationWithName:notificationname object:nil userInfo:dict];
+    
+    //通过通知中心发送通知
+    
+    [[NSNotificationCenter defaultCenter] postNotification:notification];
+    return;
+    
+
+}
+
+
 @end

+ 10 - 1
RedAnt ERP Mobile/common/Functions/MainViewController.h

@@ -89,13 +89,22 @@
 -(void)categoryMenuSelected:(NSString*)_id;
 - (void)switchToCagegory:(NSString* )category;
 - (void)switchToItemSearch:(NSString* )coverttype;
+
+
+
+#ifndef RA_NOTIFICATION
 -(void) reloadDocuments:(BOOL) update_data immediately:(bool)immediately;
 -(void) reloadCart:(BOOL) update_data immediately:(bool)immediately;
 -(void) reloadWish:(BOOL) update_data immediately:(bool)immediately;
+
 -(void) reloadPortfolio:(BOOL) update_data immediately:(bool)immediately;
+-(void) reloadCategory:(BOOL) update_data immediately:(bool)immediately;
 -(void) reloadOrder:(BOOL) update_data immediately:(bool)immediately;
 -(void) reloadContact:(BOOL) update_data immediately:(bool)immediately;
--(void) reloadCategory:(BOOL) update_data immediately:(bool)immediately;
+#endif
+
+
+
 
 
 

+ 52 - 31
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -68,7 +68,7 @@
      [self.categoryViewController logout];
 }
 
-
+#ifndef RA_NOTIFICATION
 -(void) reloadCategory:(BOOL) update_data immediately:(bool)immediately
 {
     if(immediately)
@@ -125,24 +125,25 @@
     
    // [self.watchListViewController reload_container_getdata:update_data];
 }
+
 -(void) reloadPortfolio:(BOOL) update_data immediately:(bool)immediately
 {
-#ifdef RA_NOTIFICATION
-    NSMutableDictionary* dict = [NSMutableDictionary new];
-    dict[@"receiver"]=@[@"PortfolioViewController"];
-    NSString* notificationname = nil;
-    if(update_data)
-        notificationname = RA_NOTIFICATION_RELOAD_DATA;
-    else
-        notificationname = RA_NOTIFICATION_REFRESH_UI;
-    NSNotification *notification =[NSNotification notificationWithName:notificationname object:nil userInfo:dict];
-    
-    //通过通知中心发送通知
-    
-    [[NSNotificationCenter defaultCenter] postNotification:notification];
-    return;
+
+//    NSMutableDictionary* dict = [NSMutableDictionary new];
+//    dict[@"receiver"]=@[@"PortfolioViewController"];
+//    NSString* notificationname = nil;
+//    if(update_data)
+//        notificationname = RA_NOTIFICATION_RELOAD_DATA;
+//    else
+//        notificationname = RA_NOTIFICATION_REFRESH_UI;
+//    NSNotification *notification =[NSNotification notificationWithName:notificationname object:nil userInfo:dict];
+//
+//    //通过通知中心发送通知
+//
+//    [[NSNotificationCenter defaultCenter] postNotification:notification];
+//    return;
     
-#endif
+
     
     if(immediately)
         [ self.portfolioViewController reload_container_getdata:update_data];
@@ -155,6 +156,7 @@
     }
  //   [self.portfolioViewController reload_container_getdata:update_data];
 }
+
 -(void) reloadOrder:(BOOL) update_data immediately:(bool)immediately
 {
     
@@ -185,6 +187,8 @@
             self.contactListViewController.refresh_type = REFRESH_VIEW;
     }
 }
+
+#endif
 -(void)viewWillLayoutSubviews
 {
     self.headerView.layer.shadowPath =[UIBezierPath bezierPathWithRect:self.headerView.bounds].CGPath;
@@ -309,13 +313,23 @@
     //    else
     //        [self.buttonUser setTitle:@"Sign in" forState:UIControlStateNormal];
     
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"PDFListViewController,CartViewController,PortfolioViewController,WatchListViewController,OrderListViewController,ContactListViewController,CategoryViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [self reloadDocuments:true immediately:false];
     [self reloadCart:true immediately:false];
-    [self reloadWish:true immediately:false];
+
+
     [self reloadPortfolio:true immediately:false];
+    [self reloadWish:true immediately:false];
+    
     [self reloadOrder:true immediately:false];
     [self reloadContact:true immediately:false];
     [self reloadCategory:true immediately:false];
+#endif
+    
+
     
     ActiveViewController* lrvc = (ActiveViewController*)appDelegate.active_controller;
     if(reloadCurrentVC)
@@ -420,6 +434,8 @@
 }
 - (void)viewDidLoad
 {
+    
+
     [super viewDidLoad];
 //    NSLog(@"decrypt:%@",[AESCrypt fastdecrypt:@"vafHUwfRPIUbPNVnKhLc5aAVK7sOFRztlfJVRHW7QVa/qGgm11E5UwfYWZEBTQpH"]);
     
@@ -1795,21 +1811,22 @@
     
 # endif
     
+#ifdef DEBUG
 //    if([[appDelegate.user lowercaseString] isEqualToString:@"larryl"]||[[appDelegate.user lowercaseString] isEqualToString:@"arpithat"])
-//    {
-//        //        [map setValue:@"Contact" forKey:@"title"];
-//        //        [map setValue:@"rect_contact_list" forKey:@"img"];
-//        //        [self.sideMenuItems addObject:map.copy];
-//        
-//        
-//        [map setValue:@"Function Test" forKey:@"title"];
-//        [map setValue:@"rect_market_news" forKey:@"img"];
-//        [self.sideMenuItems addObject:map.copy];
-//        
-//
-//    }
-//    
+    {
+        //        [map setValue:@"Contact" forKey:@"title"];
+        //        [map setValue:@"rect_contact_list" forKey:@"img"];
+        //        [self.sideMenuItems addObject:map.copy];
+        
+        
+        [map setValue:@"Function Test" forKey:@"title"];
+        [map setValue:@"rect_market_news" forKey:@"img"];
+        [self.sideMenuItems addObject:map.copy];
+        
+
+    }
     
+#endif
     [map setValue:@"About us" forKey:@"title"];
     [map setValue:@"rect_change_password" forKey:@"img"];
     [self.sideMenuItems addObject:map.copy];
@@ -2740,8 +2757,12 @@
                     self.previous_VC = self.current_VC;
                     [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
 
+
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     [self reloadCart:true immediately:false];
-                    
+#endif
                     
                     
                 }

+ 295 - 101
RedAnt ERP Mobile/common/Functions/PDF+Web/RAPDFViewController.m

@@ -382,7 +382,9 @@
     printInfo.outputType = UIPrintInfoOutputGeneral;
     
     printInfo.orientation = UIPrintInfoOrientationPortrait;
-    printInfo.jobName = @"CoolVisitAirPrint";
+    printInfo.jobName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
+    if(self.filename.length>0)
+        printInfo.jobName = self.filename;
     airPrinterController.printInfo = printInfo;
     airPrinterController.printingItem = self.content;
     airPrinterController.delegate = self;
@@ -755,129 +757,321 @@
      Pass the selected object to the new view controller.
 }
 */
+//- (void)startAirPrintWithData:(id )data
+//{
+//
+//
+//    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"preparing print..."];
+//
+//    UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
+//    UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+//    printInfo.outputType = UIPrintInfoOutputGeneral;
+//    printInfo.orientation = UIPrintInfoOrientationPortrait;
+//    printInfo.jobName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
+//    if(self.filename.length>0)
+//        printInfo.jobName = self.filename;
+//    airPrinterController.printInfo = printInfo;
+//    airPrinterController.printingItem = data;
+//    airPrinterController.delegate = self;
+//
+//
+//    airPrinterController.showsNumberOfCopies=true;
+//    airPrinterController.showsPageRange = true;
+//    airPrinterController.showsPaperSelectionForLoadedPapers=true;
+//
+//    void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
+//        if(completed && error)
+//            DebugLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+//    };
+//
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//
+//    UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
+//
+//
+//
+//
+//    [[UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL]] contactPrinter:^(BOOL available)
+//     {
+//         [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//
+//         if (available&& appDelegate.printerURL.length>0)
+//         {
+//
+//
+//             [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+//             DebugLog(@"AIRPRINTER AVAILABLE");
+//         }
+//         else
+//         {
+//
+//             //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+//             //
+//             //
+//             //
+//             //              //        [printPicker presentAnimated:YES completionHandler:
+//             //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+//             //              {
+//             //                  if (userDidSelect)
+//             //                  {
+//             //                      NSString* sid= printerController.printInfo.printerID;
+//             //                      UIPrintPaper*paper=  printerController.printPaper;
+//             //
+//             //                  }
+//             //              }];
+//
+//
+//             DebugLog(@"AIRPRINTER NOT AVAILABLE");
+//
+//
+//
+//             if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+//             {
+//                 UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+//              //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+//
+//
+//
+//                [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
+//
+//
+//                // [printPicker presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+//
+//
+//
+//                  //        [printPicker presentAnimated:YES completionHandler:
+//                  ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+//                  {
+//                      if (userDidSelect)
+//                      {
+//                          //User selected the item in the UIPrinterPickerController and got the printer details.
+//
+//                          [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+//
+//                          //Here you will get the printer and printer details.ie,
+//                          // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+//
+//
+//
+//
+//                          appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+//
+//                          [self startAirPrintWithData:data];
+//
+//                      }
+//                      else
+//                      {
+//
+//
+////                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+////                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+////                          {
+////
+////                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+////                          }
+////                          [self prepareReturn:nil];
+//
+//                          //[self.navigationController popViewControllerAnimated:true];
+//                      }
+//                  }];
+//             }
+//         }
+//     }];
+//
+//
+//
+//}
 - (void)startAirPrintWithData:(id )data
 {
-
-
+    
+    
     UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"preparing print..."];
-
+    
     UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
     UIPrintInfo *printInfo = [UIPrintInfo printInfo];
     printInfo.outputType = UIPrintInfoOutputGeneral;
     printInfo.orientation = UIPrintInfoOrientationPortrait;
-    printInfo.jobName = @"CoolVisitAirPrint";
+    printInfo.jobName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
+    if(self.filename.length>0)
+        printInfo.jobName = self.filename;
     airPrinterController.printInfo = printInfo;
     airPrinterController.printingItem = data;
     airPrinterController.delegate = self;
-
-
+    
+    
     airPrinterController.showsNumberOfCopies=true;
     airPrinterController.showsPageRange = true;
     airPrinterController.showsPaperSelectionForLoadedPapers=true;
-
+    
     void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
         if(completed && error)
-            DebugLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+        {
+            //                        DebugLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+        }
+        
     };
-
+    
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-
-    UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
-
-
-
-
-    [[UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL]] contactPrinter:^(BOOL available)
-     {
-         [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-         
-         if (available&& appDelegate.printerURL.length>0)
-         {
+    
+    
+    if(appDelegate.printerURL==nil)
+    {
+        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+        if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+        {
+            UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+            //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+            
+            
+            
+            //                 [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
+            
+            
+            
+            [printPicker presentFromRect:CGRectMake(100, 100, 300, 500) inView:self.view animated:YES completionHandler:
              
-
-             [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
-             DebugLog(@"AIRPRINTER AVAILABLE");
-         }
-         else
+             
+             
+             //        [printPicker presentAnimated:YES completionHandler:
+             ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+             {
+                 if (userDidSelect)
+                 {
+                     //User selected the item in the UIPrinterPickerController and got the printer details.
+                     
+                     [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                     
+                     //Here you will get the printer and printer details.ie,
+                     // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                     
+                     
+                     
+                     
+                     appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+                     
+                     [self startAirPrintWithData:data];
+                     
+                 }
+                 else
+                 {
+                     
+                     
+                     //                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                     //                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                     //                          {
+                     //
+                     //                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                     //                          }
+                     //                          [self prepareReturn:nil];
+                     
+                     //[self.navigationController popViewControllerAnimated:true];
+                 }
+             }];
+        }
+    }
+    else
+    {
+        UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
+        [airPrinter contactPrinter:^(BOOL available)
          {
-
-             //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
-             //
-             //
-             //
-             //              //        [printPicker presentAnimated:YES completionHandler:
-             //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
-             //              {
-             //                  if (userDidSelect)
-             //                  {
-             //                      NSString* sid= printerController.printInfo.printerID;
-             //                      UIPrintPaper*paper=  printerController.printPaper;
-             //
-             //                  }
-             //              }];
-
-
-             DebugLog(@"AIRPRINTER NOT AVAILABLE");
-
-
-
-             if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+             [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+             
+             if (available&& appDelegate.printerURL.length>0)
              {
-                 UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
-              //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
-
-
-
-                [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
-
-
-                // [printPicker presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
-
-
-
-                  //        [printPicker presentAnimated:YES completionHandler:
-                  ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
-                  {
-                      if (userDidSelect)
-                      {
-                          //User selected the item in the UIPrinterPickerController and got the printer details.
-
-                          [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
-
-                          //Here you will get the printer and printer details.ie,
-                          // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
-
-
-
-
-                          appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
-
-                          [self startAirPrintWithData:data];
-
-                      }
-                      else
+                 
+                 
+                 [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+                 DebugLog(@"AIRPRINTER AVAILABLE");
+             }
+             else
+             {
+                 appDelegate.printerURL = nil;
+                 
+                 //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+                 //
+                 //
+                 //
+                 //              //        [printPicker presentAnimated:YES completionHandler:
+                 //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+                 //              {
+                 //                  if (userDidSelect)
+                 //                  {
+                 //                      NSString* sid= printerController.printInfo.printerID;
+                 //                      UIPrintPaper*paper=  printerController.printPaper;
+                 //
+                 //                  }
+                 //              }];
+                 
+                 
+                 DebugLog(@"AIRPRINTER NOT AVAILABLE");
+                 
+                 
+                 
+                 if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+                 {
+                     UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+                     //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+                     
+                     
+                     
+                     //                 [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
+                     
+                     
+                     
+                     [printPicker presentFromRect:CGRectMake(100, 100, 300, 500) inView:self.view animated:YES completionHandler:
+                      
+                      
+                      
+                      //        [printPicker presentAnimated:YES completionHandler:
+                      ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
                       {
-
-
-//                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
-//                          {
-//
-//                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
-//                          }
-//                          [self prepareReturn:nil];
-
-                          //[self.navigationController popViewControllerAnimated:true];
-                      }
-                  }];
+                          if (userDidSelect)
+                          {
+                              //User selected the item in the UIPrinterPickerController and got the printer details.
+                              
+                              [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                              
+                              //Here you will get the printer and printer details.ie,
+                              // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                              
+                              
+                              
+                              
+                              appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+                              
+                              [self startAirPrintWithData:data];
+                              
+                          }
+                          else
+                          {
+                              appDelegate.printerURL = nil;
+                              
+                              //                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                              //                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                              //                          {
+                              //
+                              //                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                              //                          }
+                              //                          [self prepareReturn:nil];
+                              
+                              //[self.navigationController popViewControllerAnimated:true];
+                          }
+                      }];
+                 }
              }
-         }
-     }];
-
-
-
+         }];
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
 }
-
 #pragma mark - UIPrintInteractionControllerDelegate
 - (UIPrintPaper *)printInteractionController:(UIPrintInteractionController *)printInteractionController choosePaper:(NSArray<UIPrintPaper *> *)paperList
 {

+ 23 - 4
RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m

@@ -476,7 +476,16 @@
             {
                 if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CategoryViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                    
                     [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+#endif
+                    
+                    
+                    
                     [main_vc checklogin:false];
                     UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to pending a order or a new order", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
                     
@@ -628,12 +637,17 @@
                 {
                     
                     
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 
-                    [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                     
                     
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     
+                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                    
+                    [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                     
                     
                 }
@@ -805,9 +819,14 @@
             }
             else
             {
-                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                
 
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                
+                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                 [self addtocart];
                 [main_vc checklogin:true];
                 

+ 68 - 16
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -138,9 +138,16 @@
                     {
                         
                         [self end_edit];
+
+                        
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController,CategoryViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
                         [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:true];
+#endif
                     }
                     else
                     {
@@ -183,10 +190,18 @@
                 
                 if([[cart_json valueForKey:@"result"] intValue]==2)
                 {
+                    
+                    
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"WatchListViewController,CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                    
                     [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
+#endif
+                    
+                    
                     [self end_edit];
                 }
                 else
@@ -249,9 +264,15 @@
             {
                 
                 [self end_edit];
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController,CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
+#endif
+
             }
             else
             {
@@ -311,9 +332,15 @@
                 {
                     
                     [self end_edit];
+
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CartViewController,CategoryViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
                     [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:true];
+#endif
                 }
                 else
                 {
@@ -770,20 +797,7 @@
     //    [[self navigationController] setNavigationBarHidden:YES animated:NO];
 }
 
-- (void) reload_data {
-    __weak typeof(self) weakself = self;
-    self.currentOrderIsMerged = NO;
-    NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
-        
-        if (weakself) {
-            __strong typeof(weakself) strongself = weakself;
-            [strongself operation_reload_data];
-        }
-        
-    }];
-    
-    [self.dataOperationQueue addOperation:operation];
-}
+
 
 -(void)manually_refresh
 {
@@ -2220,8 +2234,17 @@
                     
                     
                     
+
+                    
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                    
+                    
                     for(int i=0;i<self.content_arr.count;i++)
                     {
                         NSDictionary* obj_json = self.content_arr[i];
@@ -3106,10 +3129,14 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                 
                 //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
-                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                 
                 
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                 
                 
             }
@@ -3490,4 +3517,29 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     [self.itemListTable reloadData];
 }
 
+
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.itemListTable reloadData];
+    [self refresh_total];
+}
+-(void) refresh_price
+{
+    [self refresh_ui];
+}
+- (void) reload_data {
+    __weak typeof(self) weakself = self;
+    self.currentOrderIsMerged = NO;
+    NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
+        
+        if (weakself) {
+            __strong typeof(weakself) strongself = weakself;
+            [strongself operation_reload_data];
+        }
+        
+    }];
+    
+    [self.dataOperationQueue addOperation:operation];
+}
 @end

+ 41 - 6
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -737,9 +737,16 @@
                     
                     
                     //      NSString* order_code = [return_json valueForKey:@"order_code"];
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
                     //                    appDelegate.order_code = order_code;
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                    
                     [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                     NSString * msg = nil;
                     if (self.addAll) {
                         
@@ -769,9 +776,16 @@
             }
             else  if([[return_json valueForKey:@"result"] intValue]==8)
             {
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 //                    appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
+                
                 [self end_select:2];
                 [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
             }
@@ -859,7 +873,12 @@
                 
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
-                [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+                #ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"PortfolioViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                #else
+                    [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+                #endif
+                
                 NSString * msg = nil;
                 
                 if (self.addAll) {
@@ -955,11 +974,15 @@
                 //successed.
                 
                 //                    NSString* order_code = [return_json valueForKey:@"order_code"];
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                
-                
+#endif
                 
                 NSString * msg = nil;
                 
@@ -1881,7 +1904,7 @@
     
     NSDictionary * item_json =[[self.category_data objectForKey:@"items" ] objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
     NSString* img_url =[item_json valueForKey:@"img"]; // 默认小图
-    
+
     
     NSString *loading = @"loading_l";
     NSString *notFound = @"notfound_l";
@@ -1892,6 +1915,7 @@
         notFound = @"notfound_l";
         img_url =[item_json valueForKey:@"img_big"]; // large 大图
         
+        
     } else if (self.categoryViewType == CATEGORY_VIEWTYPE_SMALL) {
         
         loading = @"loading_s";
@@ -2055,7 +2079,7 @@
     
     if(update_data)
     {
-        [self reload];
+        [self reload_data];
     }
     else
     {
@@ -2600,4 +2624,15 @@
     [self.collectionview reloadData];
 }
 
+
+
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.collectionview reloadData];
+}
+-(void) reload_data
+{
+    [self reload];
+}
 @end

+ 18 - 2
RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m

@@ -236,7 +236,7 @@
         self.offset = 0;
         [self.content_data removeAllObjects];
         NSLog(@"%s removeAllObjects",__func__);
-        [self loadpage];
+        [self reload_data];
     }
     else
     {
@@ -714,7 +714,7 @@ self.label_net_err.hidden=true;
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
 {
     // NSDictionary * item_json = [self.content_data objectForKey:@"items"];
-    if( self.content_data.count==0 || self.refresh_type == REFRESH_DATA || self.isrefreshing) //
+    if( self.content_data.count==0 || /*self.refresh_type == REFRESH_DATA ||*/ self.isrefreshing) //
         return 0;
     return self.content_data.count+1;
     
@@ -891,4 +891,20 @@ self.label_net_err.hidden=true;
     else
         self.reset = false;
 }
+
+
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.table reloadData];
+}
+-(void) reload_data
+{
+    self.offset = 0;
+    [self.content_data removeAllObjects];
+    [self.table reloadData];
+    
+    
+    [self loadpage];
+}
 @end

+ 6 - 1
RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m

@@ -291,9 +291,14 @@
                     [weakself.navigationController popToRootViewControllerAnimated:false];
                 
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
                 
                 
+#ifdef RA_NOTIFICATION
+
+                [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
+#endif
                 
             }
             else

+ 8 - 0
RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m

@@ -171,9 +171,17 @@
                         //                    appDelegate.order_code = nil;
                         [appDelegate closeOrder];
                         
+
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                        [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+#else
                         [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadContact:false immediately:false];
+#endif
+                        
                         [self.navigationController popToRootViewControllerAnimated:false];
                         
                         

+ 9 - 1
RedAnt ERP Mobile/common/Functions/home/HomeViewController.m

@@ -937,5 +937,13 @@
 - (void)reRefreshView {
     [self.homeTable reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.homeTable reloadData];
+}
+-(void) reload_data
+{
+    [self LoadData];
+}
 @end

+ 53 - 14
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -132,7 +132,14 @@
                         {
                             
                             // DebugLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+                            
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                            
                             if(self.WatchlistBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -196,7 +203,12 @@
                 
                 if([[return_json valueForKey:@"result"] intValue]==2)
                 {
+
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
                     if(self.WatchlistBlock!=nil)
                     {
                         UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -263,7 +275,14 @@
                         {
                             
                            // DebugLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                            
                             if(self.WatchlistBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -327,7 +346,14 @@
                 
                 if([[return_json valueForKey:@"result"] intValue]==2)
                 {
+
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                    
                     if(self.WatchlistBlock!=nil)
                     {
                         UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -671,10 +697,16 @@
                             {
                                 
                                 //    NSString* order_code = [return_json valueForKey:@"order_code"];
-                                AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                                 
                                 
+
+                                
+#ifdef RA_NOTIFICATION
+                                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                                AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+                                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                                 if(self.shopCartBlock!=nil)
                                 {
                                     UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -747,10 +779,14 @@
                                     {
                 
                                         //    NSString* order_code = [return_json valueForKey:@"order_code"];
-                                            AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                                        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                
+
                 
+#ifdef RA_NOTIFICATION
+                                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+                                        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                                             if(self.shopCartBlock!=nil)
                                             {
                                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -892,6 +928,11 @@
                         if([[return_json valueForKey:@"result"] intValue]==2)
                         {
                             
+
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             //    NSString* order_code = [return_json valueForKey:@"order_code"];
                             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                             //                            appDelegate.order_code = order_code;
@@ -899,8 +940,7 @@
                             //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                             //                        appDelegate.order_code = order_code;
                             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                            
-                            
+#endif
                             if(self.shopCartBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -972,15 +1012,14 @@
                     if([[return_json valueForKey:@"result"] intValue]==2)
                     {
                         
-                        //    NSString* order_code = [return_json valueForKey:@"order_code"];
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                        //                            appDelegate.order_code = order_code;
-                        //
-                        //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                        //                        appDelegate.order_code = order_code;
+
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                        
-                        
+#endif
                         if(self.shopCartBlock!=nil)
                         {
                             UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];

+ 28 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -1453,10 +1453,19 @@ self.isrefreshing=false;
         cell.set_update_data=^(bool bupdate)
         {
             //self.update_data = bupdate;
+            
+#ifdef RA_NOTIFICATION
+            if(bupdate)
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+            else
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+#else
             if(bupdate)
                 [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
             else
                 [((MainViewController*)appDelegate.main_vc) reloadCategory:false immediately:false];
+#endif
+
         };
         if(cqty>0)
         {
@@ -1807,7 +1816,12 @@ self.isrefreshing=false;
             
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
             
+            
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"PortfolioViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
             [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+#endif
         };
         
         NSString *introduce = [section_json objectForKey:@"assembly_pdf_path"];
@@ -2440,4 +2454,18 @@ self.isrefreshing=false;
     [self.detailTable reloadData];
 }
 
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.detailTable reloadData];
+}
+-(void) reload_data
+{
+    [self reload];
+}
+-(void) refresh_price
+{
+    [self refresh_ui];
+}
+    
 @end

+ 57 - 7
RedAnt ERP Mobile/common/Functions/modelDetail/HomerModelDetailHeaderCell.m

@@ -192,7 +192,17 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                         if([[return_json valueForKey:@"result"] intValue]==2)
                         {
                             
+                            
+                            
+#ifdef RA_NOTIFICATION
+
+                            [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                            
+#else
                             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                            
+
                             if(self.WatchlistBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -239,7 +249,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                 
                 if([[return_json valueForKey:@"result"] intValue]==2)
                 {
+                    
+#ifdef RA_NOTIFICATION
+                    
+                    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                    
+#else
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
                     if(self.WatchlistBlock!=nil)
                     {
                         UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -295,7 +312,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                         if([[return_json valueForKey:@"result"] intValue]==2)
                         {
                             
+                           
+#ifdef RA_NOTIFICATION
+                            
+                            [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                            
+#else
                             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
                             if(self.WatchlistBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -346,7 +370,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                 
                 if([[return_json valueForKey:@"result"] intValue]==2)
                 {
+                    
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                    
                     if(self.WatchlistBlock!=nil)
                     {
                         UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -508,9 +539,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                             {
                                 
                                 //    NSString* order_code = [return_json valueForKey:@"order_code"];
+
+                                
+#ifdef RA_NOTIFICATION
+                                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                                 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                                
+#endif
                                 
                                 if(self.shopCartBlock!=nil)
                                 {
@@ -584,10 +620,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                         {
                             
                             //    NSString* order_code = [return_json valueForKey:@"order_code"];
+
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                            
-                            
+#endif
                             if(self.shopCartBlock!=nil)
                             {
                                 UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
@@ -677,10 +717,16 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                         {
                             
                             //    NSString* order_code = [return_json valueForKey:@"order_code"];
+
+                            
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                           
-                            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                             
+                            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                             
                             if(self.shopCartBlock!=nil)
                             {
@@ -754,10 +800,14 @@ self.informationLabel.frame = CGRectMake(self.informationLabel.frame.origin.x, s
                     {
                         
                         //    NSString* order_code = [return_json valueForKey:@"order_code"];
-                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 
-                        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
                         
+                        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                         
                         if(self.shopCartBlock!=nil)
                         {

+ 6 - 6
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2854,7 +2854,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                 val="";
             NSString* price = [[NSString alloc]initWithUTF8String:val];
             
-            ret=[RAUtils string2arr:price separator:OFFLINE_ARRAY_SEPARATOR];
+            ret=[RAConvertor string2arr:price separator:OFFLINE_ARRAY_SEPARATOR];
             
         }
         
@@ -2945,7 +2945,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                 price_type="";
             NSString *nsprice_type = [[NSString alloc]initWithUTF8String:price_type];
             if(nsprice_type.length>0)
-                ret=[RAUtils string2arr:nsprice_type separator:OFFLINE_ARRAY_SEPARATOR];
+                ret=[RAConvertor string2arr:nsprice_type separator:OFFLINE_ARRAY_SEPARATOR];
             else
                 ret=nil;
             
@@ -3908,8 +3908,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     NSString* orderCode=params[@"orderCode"];
     NSString *qty = params[@"qty"];
     
-    NSArray* arr_id=[RAUtils string2arr:product_id separator:@","];
-    NSArray *qty_arr = [RAUtils string2arr:qty separator:@","];
+    NSArray* arr_id=[RAConvertor string2arr:product_id separator:@","];
+    NSArray *qty_arr = [RAConvertor string2arr:qty separator:@","];
     
     __block int number_of_outOfStock = 0;
     
@@ -5502,9 +5502,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     NSString *item_count_str = params[@"item_count"];
     
     
-    NSArray* arr=[RAUtils string2arr:product_id separator:@","];
+    NSArray* arr=[RAConvertor string2arr:product_id separator:@","];
 
-    NSArray *item_count_arr = item_count_str ? [RAUtils string2arr:item_count_str separator:@","] : nil;
+    NSArray *item_count_arr = item_count_str ? [RAConvertor string2arr:item_count_str separator:@","] : nil;
     
     
      NSString* sqlQuery = [NSString stringWithFormat:@"insert into wishlist(product_id,qty) values(?,?);"];

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

@@ -460,16 +460,28 @@
 #ifdef OFFLINE_MODE
                         appDelegate.offline_mode =self.switch_offline.isOn;
 #endif
+
+#ifdef RA_NOTIFICATION
+                        
+                        [ActiveViewController Notify:@"PortfolioViewController,WatchListViewController,CategoryViewController,PDFListViewController,CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                        [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+                        [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+                        
                         [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                        [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                        [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
-                        [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+                        
+//                        [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+                        
                         [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
-                        [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+//                        [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+                        
                         
+#endif
+                        
+
                         
                         [((MainViewController*)appDelegate.main_vc) switchToHome];
                     }
@@ -494,15 +506,22 @@
 #ifdef OFFLINE_MODE
             appDelegate.offline_mode =self.switch_offline.isOn;
 #endif
+
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"PortfolioViewController,WatchListViewController,CategoryViewController,PDFListViewController,CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+            [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
-            [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+//            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
             [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
-            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+//            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+#endif
+            
+
             
             
             [((MainViewController*)appDelegate.main_vc) switchToHome];
@@ -538,15 +557,22 @@
 #ifdef OFFLINE_MODE
                             appDelegate.offline_mode =self.switch_offline.isOn;
 #endif
+
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"PortfolioViewController,WatchListViewController,CategoryViewController,PDFListViewController,CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                            [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
-                            [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+//                            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                             [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
-                            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+//                            [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
+#endif
+                            
+
                             
                             
                             [((MainViewController*)appDelegate.main_vc) switchToHome];

+ 27 - 0
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -2805,9 +2805,16 @@
             [self.navigationController popViewControllerAnimated:false];
             
             
+
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
             
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+
+            
             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
             [((MainViewController*)appDelegate.main_vc) switchToOrder];
             // back to cart;
             //            [self.navigationController dismissViewControllerAnimated:true completion:^{
@@ -2837,7 +2844,14 @@
                         //                        appDelegate.order_code = nil;
                         
                         [appDelegate closeOrder];
+
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
+                        
                         [((MainViewController*)appDelegate.main_vc) switchToHome];
                         
                         if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
@@ -3759,7 +3773,13 @@
                 // appDelegate.customerInfo = customerInfo;
                 
                 [appDelegate closeOrder];
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
                 
                 NSString* title=nil;
                 NSString* msg=nil;
@@ -3814,7 +3834,14 @@
                 NSString* send_to =appDelegate.customerInfo[@"customer_email"];
                 
                 [appDelegate closeOrder];
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
                 
                 NSString* title=nil;
                 NSString* msg=nil;

+ 35 - 11
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -108,17 +108,7 @@
     //    DebugLog(@"refresh!!!!!!!!");
     
 }
--(void) reload_data
-{
-    
-    UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
-    
-    [reF endRefreshing];
-    
-    reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
-    
-    [self loaddata];
-}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     
@@ -1065,9 +1055,16 @@
                         appDelegate.contact_id=[appDelegate.customerInfo valueForKey:@"customer_cid"];
                         [self.navigationController popViewControllerAnimated:false];
                         
+
+                        
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
+#endif
                         if(self.selectOrder)
                             self.selectOrder(self.content_data);
                         
@@ -3375,8 +3372,15 @@
                 
                 [alert show];
                 
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
+                
                 [self.navigationController popViewControllerAnimated:false];
                 
             }
@@ -3505,4 +3509,24 @@
     [self.detailTable reloadData];
 }
 
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.detailTable reloadData];
+}
+-(void) reload_data
+{
+    
+    UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+    
+    [reF endRefreshing];
+    
+    reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
+    
+    [self loaddata];
+}
+-(void) refresh_price
+{
+    [self refresh_ui];
+}
 @end

+ 60 - 2
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -77,7 +77,7 @@
         //    [self.content_data removeAllObjects];
         self.reset_result=true;
         self.norefresh=true;
-        [self loadpage];
+        [self reload_data];
     }
     else
     {
@@ -708,8 +708,15 @@
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
                     appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
+
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
                     [main_vc reloadCart:true immediately:false];
+#endif
+                    
                     [self ReloadData];
                     
                     
@@ -2103,9 +2110,16 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                 
                 __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                
+                
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
+#endif
+                
                 [((MainViewController*)appDelegate.main_vc) switchToCart];
                 
                 mainVC.cartViewController.onFinishLoad=^{
@@ -2172,5 +2186,49 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 - (void)reRefreshView {
     [self.table_order reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.table_order reloadData];
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.can_create_order)
+    {
+        
+        
+        [self.btn_newOrder setImage:[UIImage imageNamed:@"neworder"]];
+        self.btn_newOrder.enabled = true;
+    }
+    else
+    {
+        [self.btn_newOrder setImage:nil];
+        self.btn_newOrder.enabled = false;
+    }
+}
+-(void) reload_data
+{
+    self.reset_result=true;
+    self.norefresh=true;
+    [self loadpage];
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.can_create_order)
+    {
+        
+        
+        [self.btn_newOrder setImage:[UIImage imageNamed:@"neworder"]];
+        self.btn_newOrder.enabled = true;
+    }
+    else
+    {
+        [self.btn_newOrder setImage:nil];
+        self.btn_newOrder.enabled = false;
+    }
+}
+-(void) refresh_price
+{
+    [self refresh_ui];
+}
 @end

+ 11 - 1
RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m

@@ -191,9 +191,13 @@ static const int totalPage = 3;
             [self.navigationController popViewControllerAnimated:false];
             
             
+
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-            
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
             [((MainViewController*)appDelegate.main_vc) switchToOrder];
 
         }
@@ -214,7 +218,13 @@ static const int totalPage = 3;
                         AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                         
                         [appDelegate closeOrder];
+
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                         [((MainViewController*)appDelegate.main_vc) switchToHome];
                         
                         if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)

+ 29 - 0
RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m

@@ -17,6 +17,7 @@
 #import "JKTimerManager.h"
 #import "CommonEditorCellModel.h"
 #import "RABackOrderSubmitAlertController.h"
+#import "ActiveViewController.h"
 
 #define SUBMIT_CONFIRM 123
 #define KEEP_TAIL 456
@@ -2700,7 +2701,15 @@
             
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
             
+            
+            
+            
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+
+#else
             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
             [((MainViewController*)appDelegate.main_vc) switchToOrder];
 
         }
@@ -2723,7 +2732,13 @@
                         //                        appDelegate.order_code = nil;
                         
                         [appDelegate closeOrder];
+                        
+                        
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                         [((MainViewController*)appDelegate.main_vc) switchToHome];
                         
                         if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
@@ -3399,7 +3414,15 @@
                     // appDelegate.customerInfo = customerInfo;
 
                     [appDelegate closeOrder];
+                    
+#ifdef RA_NOTIFICATION
+                    [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                    
+#else
                     [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
+
+                    
                     
                     NSString* title=nil;
                     NSString* msg=nil;
@@ -3455,7 +3478,13 @@
                 NSString* send_to =appDelegate.customerInfo[@"customer_email"];
 
                 [appDelegate closeOrder];
+
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                
+#else
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+#endif
                 
                 NSString* title=nil;
                 NSString* msg=nil;

+ 17 - 5
RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m

@@ -79,10 +79,10 @@
     [super reload_container_getdata:update_data];
     if(update_data)
     {
-    self.offset = 0;
-    [self.content_data removeAllObjects];
-    self.norefresh=true;
-    [self loadpage];
+        self.offset = 0;
+        [self.content_data removeAllObjects];
+        self.norefresh=true;
+        [self loadpage];
     }
     else
         [self.table reloadData];
@@ -689,5 +689,17 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 - (void)reRefreshView {
     [self.table reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.table reloadData];
+}
+-(void) reload_data
+{
+    self.offset = 0;
+    [self.content_data removeAllObjects];
+    [self.table reloadData];
+    self.norefresh=true;
+    [self loadpage];
+}
 @end

+ 108 - 71
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -248,19 +248,16 @@
             
             if([[return_json valueForKey:@"result"] intValue]==2)
             {
-//                int result=[[return_json valueForKey:@"result"] intValue];
-//                if(result==2)
-//                {
-//                    //successed.
+
                 
-          //          NSString* order_code = [return_json valueForKey:@"order_code"];
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                    appDelegate.order_code = order_code;
-//                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                appDelegate.order_code = order_code;
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+             
+                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false ];
-                
-                
+#endif
                 NSString * msg = nil;
                 if(checked.count==1)
                 {
@@ -884,66 +881,7 @@
     [[self navigationController] setNavigationBarHidden:YES animated:NO];
 }
 
--(void) reload_data
-{
-    
 
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if(self.isrefreshing)
-            return;
-    self.isrefreshing=true;
-    self.label_net_err.hidden=true;
-        self.itemListTable.hidden=true;
-    [self.content_data removeAllObjects];
-    [self.itemListTable reloadData];
-        self.mum.center = self.view.center;
-        
-        self.mum.hidden = false;
-        [self.mum startAnimating];
-    UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
-    
-    [reF endRefreshing];
-    
-    reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
-    
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        NSDictionary* cart_json = [RANetwork request_Portfolio:self.sortIndex];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [self.mum stopAnimating];
-            
-            int result=[[cart_json valueForKey:@"result"] intValue];
-            
-            if(result==2||result==1||result==0)
-            {
-                self.itemListTable.hidden=false;
-                self.content_data = [cart_json mutableCopy];
-                [self.itemListTable reloadData];
-                
-                [self initCheckedCount];
-                [self.btnselect setTitle: @"Deselect all"];
-                UIApplication * app = [UIApplication sharedApplication];
-                AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-                appDelegate.port_count =[[self.content_data valueForKey:@"count"] intValue];
-            }
-            else
-                if(result==RESULT_NET_ERROR)
-                {
-                    self.label_net_err.hidden=false;
-                    self.itemListTable.hidden=true;
-                }
-            else
-            {
-                [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Loading Portfolio" controller:self] ;
-            }
-            
-           self.isrefreshing=false;
-            
-        });
-    });
-        });
-}
 
 
 
@@ -1792,5 +1730,104 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 - (void)reRefreshView {
     [self.itemListTable reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.itemListTable reloadData];
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.can_create_portfolio)
+    {
+        
+        
+        [self.btnCreatePort setTitle:@"Create Portfolio"];
+        self.btnCreatePort.enabled = true;
+    }
+    else
+    {
+        [self.btnCreatePort setTitle:@""];
+        self.btnCreatePort.enabled = false;
+    }
+}
+-(void) reload_data
+{
+    
+    
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if(self.isrefreshing)
+            return;
+        self.isrefreshing=true;
+        self.label_net_err.hidden=true;
+        self.itemListTable.hidden=true;
+        [self.content_data removeAllObjects];
+        [self.itemListTable reloadData];
+        self.mum.center = self.view.center;
+        
+        self.mum.hidden = false;
+        [self.mum startAnimating];
+        UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+        
+        [reF endRefreshing];
+        
+        reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
+        
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            
+            NSDictionary* cart_json = [RANetwork request_Portfolio:self.sortIndex];
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self.mum stopAnimating];
+                
+                int result=[[cart_json valueForKey:@"result"] intValue];
+                
+                if(result==2||result==1||result==0)
+                {
+                    self.itemListTable.hidden=false;
+                    self.content_data = [cart_json mutableCopy];
+                    [self.itemListTable reloadData];
+                    
+                    [self initCheckedCount];
+                    [self.btnselect setTitle: @"Deselect all"];
+                    UIApplication * app = [UIApplication sharedApplication];
+                    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+                    appDelegate.port_count =[[self.content_data valueForKey:@"count"] intValue];
+                }
+                else
+                    if(result==RESULT_NET_ERROR)
+                    {
+                        self.label_net_err.hidden=false;
+                        self.itemListTable.hidden=true;
+                    }
+                    else
+                    {
+                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Loading Portfolio" controller:self] ;
+                    }
+                
+                self.isrefreshing=false;
+                
+            });
+        });
+    });
+    
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.can_create_portfolio)
+    {
+        
+        
+        [self.btnCreatePort setTitle:@"Create Portfolio"];
+        self.btnCreatePort.enabled = true;
+    }
+    else
+    {
+        [self.btnCreatePort setTitle:@""];
+        self.btnCreatePort.enabled = false;
+    }
+}
+-(void) refresh_price
+{
+    [self refresh_ui];
+}
 @end

+ 18 - 2
RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m

@@ -394,8 +394,15 @@
                                 [RAUtils alert_view:nil title:@"Portfolio saved. You can find it from View Portfolios" ] ;
                                 
                                 [self.navigationController dismissViewControllerAnimated:true completion:^{
-                                    [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
+                                   
+                                    
+                                    
+#ifdef RA_NOTIFICATION
+                                    [ActiveViewController Notify:@"PortfolioViewController,PDFListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                                     [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:true];
+                                     [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
+#endif
                                     //                                            if(self.onDismiss)
                                     //                                                self.onDismiss(catelog_name);
                                 }];
@@ -691,8 +698,17 @@
                         NSString* url = [editor_json valueForKey:@"pdf_path"];
                         bool isLocalFile = [editor_json valueForKey:@"isLocalFile"];
                         [self.navigationController dismissViewControllerAnimated:true completion:^{
-                            [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
+                            
+                            
+
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"PortfolioViewController,PDFListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:true];
+                            [((MainViewController*)appDelegate.main_vc) reloadDocuments:true immediately:false];
+
+#endif
+                            
                             if(self.onSaved)
                                 self.onSaved(url,saveName,isLocalFile);
                         }];

+ 36 - 6
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m

@@ -1157,11 +1157,19 @@
 //                    //successed.
                 
        //             NSString* order_code = [return_json valueForKey:@"order_code"];
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                
 //                    appDelegate.order_code = order_code;
 //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 //                appDelegate.order_code = order_code;
+                
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
+                
                 
                 NSString * msg = nil;
                 
@@ -1194,9 +1202,15 @@
             }
             else  if([[return_json valueForKey:@"result"] intValue]==8)
             {
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                //                    appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
+                
                 [self end_select:2];
                 [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
             }
@@ -1278,9 +1292,13 @@
             {
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
-                [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
                 
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"PortfolioViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+#endif
                 
                 NSString * msg = nil;
                 
@@ -1372,11 +1390,15 @@
 
                     
  
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                
-                
+#endif
                 NSString * msg = nil;
                 
                 if (self.addAll) {
@@ -2219,5 +2241,13 @@
 - (void)reRefreshView {
     [self.collectionview reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.collectionview reloadData];
+}
+-(void) reload_data
+{
+    [self reload];
+}
 @end

+ 34 - 8
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m

@@ -949,10 +949,14 @@
             if([[return_json valueForKey:@"result"] intValue]==2)
             {
 
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                
+
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                 NSString * msg = nil;
                 
                 if (self.addAll) {
@@ -982,9 +986,15 @@
             }
             else  if([[return_json valueForKey:@"result"] intValue]==8)
             {
+
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 //                    appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
                 [self end_select:2];
                 [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
             }
@@ -1073,9 +1083,13 @@
                     
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 
-                [((MainViewController*)appDelegate.main_vc) reloadPortfolio :true immediately:false];
                 
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"PortfolioViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                [((MainViewController*)appDelegate.main_vc) reloadPortfolio :true immediately:false];
+#endif
                 
                 NSString * msg = nil;
                 
@@ -1174,11 +1188,15 @@
             {
 
                     
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
- 
-                [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+
                 
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
+                [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+#endif
                 
                 NSString * msg = nil;
                 
@@ -2271,5 +2289,13 @@
 - (void)reRefreshView {
     [self.collectionview reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.collectionview reloadData];
+}
+-(void) reload_data
+{
+    [self reload];
+}
 @end

+ 2 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.h

@@ -13,8 +13,9 @@
 
 @property (nonatomic,strong) UIPrintInteractionController* airPrinterController;
 
-
 @property (nonatomic,strong) NSString* printerurl;
+
+@property (nonatomic,strong) NSString* filename;
 @property (nonatomic,strong) NSString* printerdisplayName;
 @property (strong, nonatomic) IBOutlet UILabel *labelPrintername;
 

+ 193 - 205
RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m

@@ -8,6 +8,7 @@
 
 #import "FunctionTestViewController.h"
 #import "RAUtils.h"
+#import "AppDelegate.h"
 
 @interface FunctionTestViewController ()
 
@@ -29,6 +30,11 @@ self.airPrinterController = [UIPrintInteractionController sharedPrintController]
     [super viewWillAppear:animated];
     [[self navigationController] setNavigationBarHidden:NO animated:NO];
     
+    self.filename = @"print_test";
+    
+    NSData* data =[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"I25418359" ofType:@"pdf" ]];
+    
+    [self startAirPrintWithData1:data];
 }
 
 - (void)startAirPrintWithData:(id )data
@@ -84,220 +90,202 @@ self.airPrinterController = [UIPrintInteractionController sharedPrintController]
 //    }];
  //   [self.airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
 }
-
-
--(void) downloadpdfUI
+- (void)startAirPrintWithData1:(id )data
 {
-    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading..."];
-    NSString* url = @"http://192.168.0.119:8080/site/u/NPD/file/20160315/96ad77c5-e8cd-4bf1-ac97-21c76b56af79.pdf";
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        
-        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
-        
-        //设置请求方式为get
-        
-        [request setHTTPMethod:@"GET"];
-        
-        //添加用户会话id
-        
-        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
-        
-        //连接发送请求
-        
-        
-        NSHTTPURLResponse* urlResponse = nil;
-        
-        NSError *error = nil;
-        
-        NSData* content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
-        
-        //      self.filename = [urlResponse suggestedFilename];
-        
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-            //  self.navigationItem.title = self.save_name;
-            //   UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
-            //  self.content=nil;
-            if(content!=nil&&content.length>0)
-            {
-                
-                
-                UIPrintInfo *printInfo = [UIPrintInfo printInfo];
-                printInfo.outputType = UIPrintInfoOutputGeneral;
-                printInfo.orientation = UIPrintInfoOrientationPortrait;
-                printInfo.jobName = @"CoolVisitAirPrint";
-                self.airPrinterController.printInfo = printInfo;
-                self.airPrinterController.printingItem = content;
-                self.airPrinterController.delegate = self;
-                
-                self.airPrinterController.showsNumberOfCopies=true;
-                self.airPrinterController.showsPageRange = true;
-                self.airPrinterController.showsPaperSelectionForLoadedPapers=true;
-                
-                
-                
-                
-                [self.airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
-                 
-                 
-                 
-                 //        [printPicker presentAnimated:YES completionHandler:
-                 ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
-                 {
-                     if (userDidSelect)
-                     {
-                         
-                         UIPrintPaper*paper=  printerController.printPaper;
-                         //             printerController.printPaper = paper;
-                         //             printer
-                         
-                         //             //User selected the item in the UIPrinterPickerController and got the printer details.
-                         //
-                         //             [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
-                         //
-                         //             //Here you will get the printer and printer details.ie,
-                         //             // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
-                         //             
-                         //             
-                         //             self.labelPrintername.text =printerPicker.selectedPrinter.displayName;
-                         //             //       [btnSettingsPrint setTitle:printerPicker.selectedPrinter.displayName forState:UIControlStateNormal];
-                         //             
-                         //             
-                         //             
-                         //             self.printerurl =printerPicker.selectedPrinter.URL.absoluteString;
-                         //             NSURL *printerURL = printerPicker.selectedPrinter.URL;
-                         //             
-                     }
-                 }];
+    
+    
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"preparing print..."];
+    
+    UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
+    UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+    printInfo.outputType = UIPrintInfoOutputGeneral;
+    printInfo.orientation = UIPrintInfoOrientationPortrait;
+    printInfo.jobName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
+    if(self.filename.length>0)
+        printInfo.jobName = self.filename;
+    airPrinterController.printInfo = printInfo;
+    airPrinterController.printingItem = data;
+    airPrinterController.delegate = self;
+    
+    
+    airPrinterController.showsNumberOfCopies=true;
+    airPrinterController.showsPageRange = true;
+    airPrinterController.showsPaperSelectionForLoadedPapers=true;
+    
+    void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
+        if(completed && error)
+        {
+//                        DebugLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+        }
 
-                //[self startAirPrintWithData:content];
-                
-                //                [reF removeFromSuperview];
-                //
-                //
-                //                // NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-                //                NSString *path = NSTemporaryDirectory();
-                //                NSString *filePath = [path stringByAppendingPathComponent:self.filename];
-                //                //    NSError *error = nil;
-                //                //    BOOL bo = [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
-                //                //    NSAssert(bo,@"创建目录失败");
-                //                [self.content writeToFile:filePath atomically:YES];
-                //
-                //
-                //                self.btnshare.enabled =true;
-                //
-                //
-                //                self.btnemail.enabled =true;
-                //                self.btnsave.enabled =true;
-                //
-                //                if(self.onLoadSuccess)
-                //                    self.onLoadSuccess(self.url);
-                //               int a=0;
-            }
-            else
-            {
-                [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
-                //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
-            }
-            
-            ;
-            //            NSLog(@"%@",[[NSString alloc] initWithData:self.content encoding:NSASCIIStringEncoding]);
-            //
+    };
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    
+    if(appDelegate.printerURL==nil)
+    {
+        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+        if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+        {
+            UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+            //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
             
             
-            // [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
             
+            //                 [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
             
             
             
-        });
-    });
+            [printPicker presentFromRect:CGRectMake(100, 100, 300, 500) inView:self.view animated:YES completionHandler:
+             
+             
+             
+             //        [printPicker presentAnimated:YES completionHandler:
+             ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+             {
+                 if (userDidSelect)
+                 {
+                     //User selected the item in the UIPrinterPickerController and got the printer details.
+                     
+                     [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                     
+                     //Here you will get the printer and printer details.ie,
+                     // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                     
+                     
+                     
+                     
+                     appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+                     
+                     [self startAirPrintWithData1:data];
+                     
+                 }
+                 else
+                 {
+                     
+                     
+                     //                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                     //                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                     //                          {
+                     //
+                     //                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                     //                          }
+                     //                          [self prepareReturn:nil];
+                     
+                     //[self.navigationController popViewControllerAnimated:true];
+                 }
+             }];
+        }
+    }
+    else
+    {
+        UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
+        [airPrinter contactPrinter:^(BOOL available)
+         {
+             [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+             
+             if (available&& appDelegate.printerURL.length>0)
+             {
+                 
+                 
+                 [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+                 DebugLog(@"AIRPRINTER AVAILABLE");
+             }
+             else
+             {
+                 appDelegate.printerURL = nil;
+                 
+                 //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+                 //
+                 //
+                 //
+                 //              //        [printPicker presentAnimated:YES completionHandler:
+                 //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+                 //              {
+                 //                  if (userDidSelect)
+                 //                  {
+                 //                      NSString* sid= printerController.printInfo.printerID;
+                 //                      UIPrintPaper*paper=  printerController.printPaper;
+                 //
+                 //                  }
+                 //              }];
+                 
+                 
+                 DebugLog(@"AIRPRINTER NOT AVAILABLE");
+                 
+                 
+                 
+                 if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+                 {
+                     UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+                     //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+                     
+                     
+                     
+                     //                 [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
+                     
+                     
+                     
+                     [printPicker presentFromRect:CGRectMake(100, 100, 300, 500) inView:self.view animated:YES completionHandler:
+                      
+                      
+                      
+                      //        [printPicker presentAnimated:YES completionHandler:
+                      ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+                      {
+                          if (userDidSelect)
+                          {
+                              //User selected the item in the UIPrinterPickerController and got the printer details.
+                              
+                              [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                              
+                              //Here you will get the printer and printer details.ie,
+                              // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                              
+                              
+                              
+                              
+                              appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+                              
+                              [self startAirPrintWithData:data];
+                              
+                          }
+                          else
+                          {
+                              appDelegate.printerURL = nil;
+                              
+                              //                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                              //                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                              //                          {
+                              //
+                              //                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                              //                          }
+                              //                          [self prepareReturn:nil];
+                              
+                              //[self.navigationController popViewControllerAnimated:true];
+                          }
+                      }];
+                 }
+             }
+         }];
+    }
+    
+    
+    
+    
+    
+    
+
+    
+    
+    
 }
 
 
--(void) downloadpdf
-{
-     UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading..."];
-    NSString* url = @"http://192.168.0.119:8080/site/u/NPD/file/20160315/96ad77c5-e8cd-4bf1-ac97-21c76b56af79.pdf";
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        
-        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
-        
-        //设置请求方式为get
-        
-        [request setHTTPMethod:@"GET"];
-        
-        //添加用户会话id
-        
-        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
-        
-        //连接发送请求
-        
-        
-        NSHTTPURLResponse* urlResponse = nil;
-        
-        NSError *error = nil;
-        
-        NSData* content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
-        
-  //      self.filename = [urlResponse suggestedFilename];
-        
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-          //  self.navigationItem.title = self.save_name;
-         //   UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
-            //  self.content=nil;
-            if(content!=nil&&content.length>0)
-            {
-                
-                
-                [self startAirPrintWithData:content];
-                
-//                [reF removeFromSuperview];
-//                
-//                
-//                // NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-//                NSString *path = NSTemporaryDirectory();
-//                NSString *filePath = [path stringByAppendingPathComponent:self.filename];
-//                //    NSError *error = nil;
-//                //    BOOL bo = [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
-//                //    NSAssert(bo,@"创建目录失败");
-//                [self.content writeToFile:filePath atomically:YES];
-//                
-//                
-//                self.btnshare.enabled =true;
-//                
-//                
-//                self.btnemail.enabled =true;
-//                self.btnsave.enabled =true;
-//                
-//                if(self.onLoadSuccess)
-//                    self.onLoadSuccess(self.url);
-                //               int a=0;
-            }
-            else
-            {
-                [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
-                //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
-            }
-            
-            ;
-            //            NSLog(@"%@",[[NSString alloc] initWithData:self.content encoding:NSASCIIStringEncoding]);
-            //
-            
-            
-           // [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
-            
-            
-            
-            
-        });
-    });
-}
+
+
+
 //-(void)settingPrinter
 //{
 //    UIPrinterPickerController *pickerController =[UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
@@ -319,7 +307,7 @@ self.airPrinterController = [UIPrintInteractionController sharedPrintController]
 //}
 
 - (IBAction)OnPrintParamsClick:(id)sender {
-    [self downloadpdfUI];
+    
     
     
 }
@@ -369,7 +357,7 @@ self.airPrinterController = [UIPrintInteractionController sharedPrintController]
 }
 - (IBAction)onBackgroundprintClick:(id)sender {
     
-    [self downloadpdf];
+
     //[self startAirPrintWithImage:[UIImage imageNamed:@"notfound_s"]];
 }
 - (IBAction)onPrintersettingClick:(id)sender {

+ 30 - 17
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -71,7 +71,7 @@
 {
     [super reload_container_getdata:update_data];
     if(update_data)
-    [self reload_data];
+        [self reload_data];
     else
         [self.itemListTable reloadData];
 }
@@ -255,12 +255,20 @@
                     //successed.
                     
             //        NSString* order_code = [return_json valueForKey:@"order_code"];
-                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                
 //                    appDelegate.order_code = order_code;
 //                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 //                    appDelegate.order_code = order_code;
-                    [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+
+                
+                
+#ifdef RA_NOTIFICATION
+                [ActiveViewController Notify:@"WatchListViewController,CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:true];
+#endif
                     [RAUtils message_alert:nil title:@" Multiple items moved to Cart" controller:self] ;
                     
 //                    [self end_select];
@@ -643,19 +651,7 @@
         });
 }
 
--(void) reload_data {
-    __weak typeof(self) weakself = self;
-    NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
-        
-        if (weakself) {
-            __strong typeof(weakself) strongself = weakself;
-            [strongself operation_reload_data];
-        }
-        
-    }];
-    
-    [self.dataOperationQueue addOperation:operation];
-}
+
 
 
 - (void)didReceiveMemoryWarning
@@ -1426,5 +1422,22 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 - (void)reRefreshView {
     [self.itemListTable reloadData];
 }
-
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+    [self.itemListTable reloadData];
+}
+-(void) reload_data {
+    __weak typeof(self) weakself = self;
+    NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
+        
+        if (weakself) {
+            __strong typeof(weakself) strongself = weakself;
+            [strongself operation_reload_data];
+        }
+        
+    }];
+    
+    [self.dataOperationQueue addOperation:operation];
+}
 @end

+ 2 - 0
RedAnt ERP Mobile/common/NotificationNameCenter.h

@@ -32,6 +32,8 @@ UIKIT_EXTERN  NSString  *RA_NOTIFICATION_RELOAD_DATA;///<重新请求,加载
 UIKIT_EXTERN  NSString  *RA_NOTIFICATION_CLEAR_DATA;///<清空数据
 UIKIT_EXTERN  NSString  *RA_NOTIFICATION_SHOW_PRICE;///<隐藏价格
 UIKIT_EXTERN  NSString  *RA_NOTIFICATION_HIDE_PRICE;///<显示价格
+UIKIT_EXTERN  NSString  *RA_NOTIFICATION_UPDATE_PRICE;///<刷新价格显示
+
 UIKIT_EXTERN  NSString  *RA_NOTIFICATION_SCANNER_DECODE;///<扫码返回结果
 
 

+ 1 - 0
RedAnt ERP Mobile/common/NotificationNameCenter.m

@@ -27,6 +27,7 @@ const NSString  *RA_NOTIFICATION_REFRESH_UI = @"RA_NOTIFICATION_REFRESH_UI";
 const NSString  *RA_NOTIFICATION_RELOAD_DATA = @"RA_NOTIFICATION_RELOAD_DATA";
 const NSString  *RA_NOTIFICATION_SHOW_PRICE = @"RA_NOTIFICATION_SHOW_PRICE";
 const NSString  *RA_NOTIFICATION_HIDE_PRICE = @"RA_NOTIFICATION_HIDE_PRICE";
+const NSString  *RA_NOTIFICATION_UPDATE_PRICE = @"RA_NOTIFICATION_UPDATE_PRICE";
 const NSString  *RA_NOTIFICATION_SCANNER_DECODE = @"RA_NOTIFICATION_SCANNER_DECODE";
 const NSString  *RA_NOTIFICATION_CLEAR_DATA = @"RA_NOTIFICATION_CLEAR_DATA";
 

+ 1 - 1
RedAnt ERP Mobile/common/RAUtils.h

@@ -58,7 +58,7 @@
 //+(void) add_recent_model:(NSDictionary*) model;
 + (long long) freeDiskSpaceInMegaBytes;
 
-+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
+//+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
 
 
 

+ 6 - 6
RedAnt ERP Mobile/common/RAUtils.m

@@ -601,12 +601,12 @@
     
 }
 
-+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator
-{
-    NSArray  *stringArray = [string componentsSeparatedByString:separator];
-    
-    return stringArray;
-}
+//+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator
+//{
+//    NSArray  *stringArray = [string componentsSeparatedByString:separator];
+//    
+//    return stringArray;
+//}
 
 +(NSDictionary*) string2dict:(NSString*) str
 {

+ 38 - 0
RedAnt ERP Mobile/common/categoryMenu_RATree/RAViewController.m

@@ -331,4 +331,42 @@
     [self.treeView reloadData];
 }
 
+
+#pragma mark - RA_NOTIFICAITON
+-(void) refresh_ui
+{
+//    [self.table reloadData];
+}
+-(void) reload_data
+{
+    
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        
+        NSDictionary* category=[RANetwork request_Cagegory];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            
+            if([[category valueForKey:@"result"] intValue]==2)
+            {
+                appDelegate.categoryMenu = category;
+                [self SetMenu:appDelegate.categoryMenu ];
+            }
+            else
+                if([[category valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
+                {
+                    [self SetMenu:nil ];
+                }
+                else
+                {
+                    [RAUtils message_alert:[category valueForKey:@"err_msg"]  title:@"Load Category Menu" controller:self] ;
+                }
+            
+            
+            
+        });
+    });
+}
 @end

+ 8 - 0
RedAnt ERP Mobile/iSales-GATIT/AppDelegate.m

@@ -141,8 +141,16 @@
     if (self.user_type == USER_ROLE_CUSTOMER && _customerInfo) {
         return;
     }
+
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
+    
     _customerInfo=customerInfo;
     
 //    DebugLog(@"%@",_customerInfo.class);

+ 10 - 1
RedAnt ERP Mobile/iSales-HOMER/AppDelegate.m

@@ -140,10 +140,19 @@
         return;
     }
     
-    [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
+
     _customerInfo=customerInfo;
     
+
+    
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+    [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
 //    DebugLog(@"%@",_customerInfo.class);
 //    DebugLog(@"%@",customerInfo.class);
     int count=customerInfo[@"count"];

+ 9 - 0
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -134,8 +134,17 @@
     if (self.user_type == USER_ROLE_CUSTOMER && _customerInfo) {
         return;
     }
+
+    
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
+    
     _customerInfo=customerInfo;
     
 //    DebugLog(@"%@",_customerInfo.class);

+ 9 - 0
RedAnt ERP Mobile/iSales-TRADESHOW/AppDelegate.m

@@ -134,8 +134,17 @@
     if (self.user_type == USER_ROLE_CUSTOMER && _customerInfo) {
         return;
     }
+
+    
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
+    
     _customerInfo=customerInfo;
     
 //    DebugLog(@"%@",_customerInfo.class);

+ 8 - 0
RedAnt ERP Mobile/iSales-USAI/AppDelegate.m

@@ -134,8 +134,16 @@
     if (self.user_type == USER_ROLE_CUSTOMER && _customerInfo) {
         return;
     }
+
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
+    
     _customerInfo=customerInfo;
     
 //    DebugLog(@"%@",_customerInfo.class);

+ 2 - 0
RedAnt ERP Mobile/iSales-UWAVER/AppDelegate.h

@@ -37,7 +37,9 @@ typedef enum {
 //@property (strong , nonatomic) NSString* contact_name;
 @property (strong,nonatomic)NSDictionary* categoryMenu;
 
+#ifndef RA_NOTIFICATION
 @property (strong,nonatomic)UIViewController* active_controller;
+#endif
 
 @property (strong,nonatomic)NSMutableDictionary* customerInfo;
 @property (strong,nonatomic)NSMutableDictionary* recent_model;

+ 29 - 2
RedAnt ERP Mobile/iSales-UWAVER/AppDelegate.m

@@ -101,10 +101,13 @@
     _price_hidden = price_hidden;
     [self setGlobalParameter:@(_price_hidden) forKey:@"price_hidden"];
     
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"" Message:RA_NOTIFICATION_UPDATE_PRICE];
+#else
     ActiveViewController* avc=(ActiveViewController*)self.active_controller;
     
     [avc showHidePrice];
-    
+#endif
 }
 
 - (void)setOffline_mode:(bool)offline_mode {
@@ -134,8 +137,18 @@
     if (self.user_type == USER_ROLE_CUSTOMER && _customerInfo) {
         return;
     }
+
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"ContactListViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+    [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+    
+#else
     [((MainViewController*)self.main_vc) reloadContact:false immediately:false];
     [(MainViewController*)self.main_vc reloadWish:YES immediately:NO];
+#endif
+    
+    
     _customerInfo=customerInfo;
     
 //    DebugLog(@"%@",_customerInfo.class);
@@ -336,8 +349,16 @@
     
     
     
+
+    
+    
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
     [((MainViewController*)self.main_vc) reloadCart:true immediately:false];
     [((MainViewController*)self.main_vc) reloadOrder:true immediately:false];
+#endif
+    
 }
 -(void) switchToPreviousVC
 {
@@ -732,9 +753,15 @@ void UncaughtExceptionHandler(NSException *exception) {
                             }
                            
                             
+
+                            
+                            
+#ifdef RA_NOTIFICATION
+                            [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
                             [mainVC reloadOrder:true immediately:false];
                             [mainVC reloadCart:true immediately:false];
-                            
+#endif
                             
                         }
                         else

+ 2 - 0
RedAnt ERP Mobile/iSales-UWAVER/config.h

@@ -11,6 +11,8 @@
 #define BUILD_UWAVER
 #define BACKORDER_PROCESS // 允许backorder process
 
+#define RA_NOTIFICATION
+
 # ifdef DEBUG
 //#define test_server
 # endif

+ 5 - 0
common/RAConvertor.h

@@ -15,9 +15,14 @@
 
 +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
 +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim brackets:(NSString*)brackets;
++(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
+
 
 +(NSData*) dict2data:(NSDictionary*) dict;
 
 +(NSDictionary*) string2dict:(NSString*) str;
 +(NSString*) dict2string:(id) dict;
+
+
+
 @end

+ 13 - 0
common/RAConvertor.m

@@ -135,4 +135,17 @@ begin:
     
     return jsonStr;
 }
+
++(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator
+{
+    if(string.length==0)
+        return [NSArray new];
+    if(separator.length==0)
+        return @[string];
+//    if(separator.length==0)
+    NSArray  *stringArray = [string componentsSeparatedByString:separator];
+    
+    return stringArray;
+}
+
 @end