Ray Zhang 10 년 전
부모
커밋
3a569a8ab4

+ 17 - 0
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -1470,6 +1470,16 @@
     [self.sideMenuItems addObject:map.copy];
 
     
+    if(appDelegate.user!=nil)
+    {
+        [map setValue:@"Offline data" forKey:@"title"];
+        [map setValue:@"rect_market_news" forKey:@"img"];
+        [self.sideMenuItems addObject:map.copy];
+        
+
+        
+    }
+    
     [map setValue:@"About" forKey:@"title"];
     [map setValue:@"rect_change_password" forKey:@"img"];
     [self.sideMenuItems addObject:map.copy];
@@ -1710,6 +1720,13 @@
             //  <#code#>
         }];
     }
+    else if([title isEqualToString:@"Offline data"])
+    {
+        
+        [iSalesDB testdata];
+        
+    }
+    
     else if([title isEqualToString:@"About"])
     {
         

+ 6 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -155,6 +155,7 @@
 		71DF74981C57614C00F2789C /* PhotoStackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71DF74941C57614C00F2789C /* PhotoStackViewController.m */; };
 		71FFBBE91C60894900D91DC2 /* iSalesDB.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FFBBE61C60894900D91DC2 /* iSalesDB.m */; };
 		71FFBBEA1C60894900D91DC2 /* iSalesNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FFBBE81C60894900D91DC2 /* iSalesNetwork.m */; };
+		71FFBBF31C6096F300D91DC2 /* OLDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FFBBF21C6096F300D91DC2 /* OLDataProvider.m */; };
 		A31E80CF7BEA220BD1CC4B97 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C694180C757B34E24180D628 /* libPods.a */; };
 /* End PBXBuildFile section */
 
@@ -442,6 +443,8 @@
 		71FFBBE61C60894900D91DC2 /* iSalesDB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iSalesDB.m; path = common/data_provider/iSalesDB.m; sourceTree = SOURCE_ROOT; };
 		71FFBBE71C60894900D91DC2 /* iSalesNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iSalesNetwork.h; path = common/data_provider/iSalesNetwork.h; sourceTree = SOURCE_ROOT; };
 		71FFBBE81C60894900D91DC2 /* iSalesNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iSalesNetwork.m; path = common/data_provider/iSalesNetwork.m; sourceTree = SOURCE_ROOT; };
+		71FFBBF11C6096F300D91DC2 /* OLDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OLDataProvider.h; sourceTree = "<group>"; };
+		71FFBBF21C6096F300D91DC2 /* OLDataProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OLDataProvider.m; sourceTree = "<group>"; };
 		C694180C757B34E24180D628 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
@@ -697,6 +700,8 @@
 				71FFBBE61C60894900D91DC2 /* iSalesDB.m */,
 				71FFBBE71C60894900D91DC2 /* iSalesNetwork.h */,
 				71FFBBE81C60894900D91DC2 /* iSalesNetwork.m */,
+				71FFBBF11C6096F300D91DC2 /* OLDataProvider.h */,
+				71FFBBF21C6096F300D91DC2 /* OLDataProvider.m */,
 			);
 			name = utils;
 			sourceTree = "<group>";
@@ -1166,6 +1171,7 @@
 				7162A5851C5872EF00AB630E /* HomeViewController.m in Sources */,
 				7162A5E31C5877CE00AB630E /* WatchListViewController.m in Sources */,
 				7162A5421C58719D00AB630E /* RATreeNodeCollectionController.m in Sources */,
+				71FFBBF31C6096F300D91DC2 /* OLDataProvider.m in Sources */,
 				71DF74631C575E7900F2789C /* CommonEditorCellSwitch.m in Sources */,
 				7162A5DE1C5876E300AB630E /* RetrievePassViewController.m in Sources */,
 				7141DD541C57459B00F7DF59 /* rscode.c in Sources */,

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

@@ -51,6 +51,7 @@
 @property long cart_count;
 @property long port_count;
 
+@property bool offline_mode;
 
 @property bool can_show_price;
 @property bool can_see_price;

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

@@ -364,6 +364,8 @@
 //}
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
+    
+    self.offline_mode = OFFLINE_MODE;
     // Override point for customization after application launch.
     
     if (! [iSalesDB initializeDb])

+ 11 - 11
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -759,10 +759,10 @@
                                 <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailHeaderCell" rowHeight="550" id="PCZ-Ci-oQf" customClass="DetailHeaderCell">
-                                        <rect key="frame" x="0.0" y="50" width="768" height="550"/>
+                                        <rect key="frame" x="0.0" y="49.5" width="768" height="550"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="PCZ-Ci-oQf" id="DiR-eY-PiR">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="550"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="549.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="USD 123.45" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fD8-Km-IT3">
@@ -991,18 +991,18 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="DetailImageCell" id="gSx-f2-mrB" customClass="DetailImageCell">
-                                        <rect key="frame" x="0.0" y="600" width="768" height="600"/>
+                                        <rect key="frame" x="0.0" y="599.5" width="768" height="600"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gSx-f2-mrB" id="k28-H7-ddZ">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="600"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </tableViewCellContentView>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="DetailTopicCell" selectionStyle="default" indentationWidth="10" reuseIdentifier="DetailTopicCell" id="zzF-db-bsq" customClass="DetailTopicCell">
-                                        <rect key="frame" x="0.0" y="1200" width="768" height="600"/>
+                                        <rect key="frame" x="0.0" y="1199.5" width="768" height="600"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zzF-db-bsq" id="rZ0-x8-h3B">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="600"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" id="z6w-ak-dlg">
@@ -1057,10 +1057,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailInfoCell" rowHeight="44" id="hYM-aE-rjR" customClass="DetailKVCell">
-                                        <rect key="frame" x="0.0" y="1800" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="1799.5" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hYM-aE-rjR" id="o59-aa-UU2">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="EOR-Ov-zPZ">
@@ -5568,7 +5568,7 @@ redantsupport@united-us.net</string>
                                         </connections>
                                     </collectionViewCell>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CategoryCellNPD" id="maC-dP-Mdd" customClass="CategoryCellNPD">
-                                        <rect key="frame" x="369" y="215" width="180" height="251"/>
+                                        <rect key="frame" x="369" y="214.5" width="180" height="251"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="180" height="251"/>
@@ -5801,7 +5801,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="22" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Vyi-Ez-P2a" id="LVn-pY-YDc">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="N1s-I8-bJv" customClass="RTLabel">
@@ -6438,7 +6438,7 @@ redantsupport@united-us.net</string>
                                 </collectionViewFlowLayout>
                                 <cells>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CategoryCellNPD" id="G2n-xx-eX7" customClass="CategoryCellNPD">
-                                        <rect key="frame" x="0.0" y="95" width="180" height="251"/>
+                                        <rect key="frame" x="0.0" y="94.5" width="180" height="251"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="180" height="251"/>