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

1.修改离线数据Category实现多选;
2.修改Category Filter实现多选界面;
3.修改Model Detail,在离线模式下没缓存图片就不通过网络请求;
4.修改MainViewController切换到Item Search时清空Item Search,取消清空Category。

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

+ 2 - 0
RedAnt ERP Mobile/HMLG Mobile/Info.plist

@@ -4,6 +4,8 @@
 <dict>
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<string>en</string>
+	<key>CFBundleDisplayName</key>
+	<string>${PRODUCT_NAME}</string>
 	<key>CFBundleExecutable</key>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
 	<key>CFBundleIdentifier</key>

+ 80 - 80
RedAnt ERP Mobile/HMLG Mobile/config.h

@@ -38,131 +38,131 @@
 #ifdef test_server
 #ifdef test_server
 
 
 //------------------- chen server-----------------------
 //------------------- chen server-----------------------
-#define  URL_UPDATE_AUTH  @"http://192.168.0.119:80/pj/isales/login.htm"
-#define  URL_LOGOUT  @"http://192.168.0.119:80/pj/isales/loginOut.htm"
-#define  URL_RETRIEVE_PASS  @"http://192.168.0.119:80/pj/isales/forgotPassword.htm"
+#define  URL_UPDATE_AUTH  @"http://192.168.0.133:80/pj/isales/login.htm"
+#define  URL_LOGOUT  @"http://192.168.0.133:80/pj/isales/loginOut.htm"
+#define  URL_RETRIEVE_PASS  @"http://192.168.0.133:80/pj/isales/forgotPassword.htm"
 
 
-#define  URL_REQUEST_CATMENU  @"http://192.168.0.119:80/pj/isales/menu.htm"
-#define  URL_LOAD_HOME  @"http://192.168.0.119:80/pj/isales/homePage.htm"
-#define  URL_CATEGORY @"http://192.168.0.119:80/pj/isales/distinctCategory.htm"
-#define  URL_SEARCH  @"http://192.168.0.119:80/pj/isales/search.htm"
-#define  URL_ITEM_SEARCH  @"http://192.168.0.119:80/pj/isales/itemSearch.htm"
-#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.119:80/pj/isales/categoryMore.htm"
-#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.119:80/pj/isales/getContactAdvance.htm"
+#define  URL_REQUEST_CATMENU  @"http://192.168.0.133:80/pj/isales/menu.htm"
+#define  URL_LOAD_HOME  @"http://192.168.0.133:80/pj/isales/homePage.htm"
+#define  URL_CATEGORY @"http://192.168.0.133:80/pj/isales/distinctCategory.htm"
+#define  URL_SEARCH  @"http://192.168.0.133:80/pj/isales/search.htm"
+#define  URL_ITEM_SEARCH  @"http://192.168.0.133:80/pj/isales/itemSearch.htm"
+#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.133:80/pj/isales/categoryMore.htm"
+#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.133:80/pj/isales/getContactAdvance.htm"
 
 
 
 
-#define  URL_ORDER_LIST  @"http://192.168.0.119:80/pj/isales/orderList.htm"
-#define  URL_ORDER_DETAIL  @"http://192.168.0.119:80/pj/isales/orderDetail.htm"
-#define URL_COMMIT_ORDER @"http://192.168.0.119:80/pj/isales/createOrder.htm"
-#define URL_COPY_ORDER @"http://192.168.0.119:80/pj/isales/copyOrder.htm"
-#define URL_SIGN_ORDER @"http://192.168.0.119:80/pj/isales/updateOrderSign.htm"
-#define URL_SAVE_ORDER @"http://192.168.0.119:80/pj/isales/saveOrder.htm"
-#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.119:80/pj/isales/updateOrderCustomerInfo.htm"
-#define  URL_NEW_ORDER  @"http://192.168.0.119:80/pj/isales/createNewOrder.htm"
-#define  URL_OPEN_ORDER  @"http://192.168.0.119:80/pj/isales/openOrder.htm"
-#define  URL_RELEASE_ORDER  @"http://192.168.0.119:80/pj/isales/closeOrder.htm"
-#define  URL_DELETE_ORDER  @"http://192.168.0.119:80/pj/isales/deleteOrder.htm"
-#define  URL_CANCEL_ORDER  @"http://192.168.0.119:80/pj/isales/cancelOrder.htm"
+#define  URL_ORDER_LIST  @"http://192.168.0.133:80/pj/isales/orderList.htm"
+#define  URL_ORDER_DETAIL  @"http://192.168.0.133:80/pj/isales/orderDetail.htm"
+#define URL_COMMIT_ORDER @"http://192.168.0.133:80/pj/isales/createOrder.htm"
+#define URL_COPY_ORDER @"http://192.168.0.133:80/pj/isales/copyOrder.htm"
+#define URL_SIGN_ORDER @"http://192.168.0.133:80/pj/isales/updateOrderSign.htm"
+#define URL_SAVE_ORDER @"http://192.168.0.133:80/pj/isales/saveOrder.htm"
+#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.133:80/pj/isales/updateOrderCustomerInfo.htm"
+#define  URL_NEW_ORDER  @"http://192.168.0.133:80/pj/isales/createNewOrder.htm"
+#define  URL_OPEN_ORDER  @"http://192.168.0.133:80/pj/isales/openOrder.htm"
+#define  URL_RELEASE_ORDER  @"http://192.168.0.133:80/pj/isales/closeOrder.htm"
+#define  URL_DELETE_ORDER  @"http://192.168.0.133:80/pj/isales/deleteOrder.htm"
+#define  URL_CANCEL_ORDER  @"http://192.168.0.133:80/pj/isales/cancelOrder.htm"
 
 
 
 
-#define  URL_CART_SET_PRICE  @"http://192.168.0.119:80/pj/isales/setPrice.htm"
-#define  URL_CART_ITEM_NOTES  @"http://192.168.0.119:80/pj/isales/setItemNotes.htm"
-#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.119:80/pj/isales/updateGeneralNote.htm"
+#define  URL_CART_SET_PRICE  @"http://192.168.0.133:80/pj/isales/setPrice.htm"
+#define  URL_CART_ITEM_NOTES  @"http://192.168.0.133:80/pj/isales/setItemNotes.htm"
+#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.133:80/pj/isales/updateGeneralNote.htm"
 
 
-#define  URL_CART_INCRESEMENT  @"http://192.168.0.119:80/pj/isales/increment.htm"
-#define  URL_CART  @"http://192.168.0.119:80/pj/isales/cartDtail.htm"
-#define  URL_CARTDELIVERY  @"http://192.168.0.119:80/pj/isales/cartDelivery.htm"
-#define  URL_ADD_TO_CART  @"http://192.168.0.119:80/pj/isales/addToCart.htm"
-#define  URL_CART_REMOVE  @"http://192.168.0.119:80/pj/isales/deleteToCart.htm"
-#define  URL_CART_CHECK  @"http://192.168.0.119:80/pj/isales/checkCartItem.htm"
-#define  URL_CART2WISH  @"http://192.168.0.119:80/pj/isales/cartRemoveToWishlist.htm"
-#define  URL_WISH2CART  @"http://192.168.0.119:80/pj/isales/wishlistRemoveToCart.htm"
+#define  URL_CART_INCRESEMENT  @"http://192.168.0.133:80/pj/isales/increment.htm"
+#define  URL_CART  @"http://192.168.0.133:80/pj/isales/cartDtail.htm"
+#define  URL_CARTDELIVERY  @"http://192.168.0.133:80/pj/isales/cartDelivery.htm"
+#define  URL_ADD_TO_CART  @"http://192.168.0.133:80/pj/isales/addToCart.htm"
+#define  URL_CART_REMOVE  @"http://192.168.0.133:80/pj/isales/deleteToCart.htm"
+#define  URL_CART_CHECK  @"http://192.168.0.133:80/pj/isales/checkCartItem.htm"
+#define  URL_CART2WISH  @"http://192.168.0.133:80/pj/isales/cartRemoveToWishlist.htm"
+#define  URL_WISH2CART  @"http://192.168.0.133:80/pj/isales/wishlistRemoveToCart.htm"
 
 
 
 
 
 
 
 
-#define  URL_CATEGORYADDALL  @"http://192.168.0.119:80/pj/isales/categoryAddAllTo.htm"
-#define  URL_SEARCHADDALL  @"http://192.168.0.119:80/pj/isales/searchAddAllTo.htm"
-#define  URL_ITEMSEARCHADDALL @"http://192.168.0.119:80/pj/isales/itemSearchAddAllTo.htm"
+#define  URL_CATEGORYADDALL  @"http://192.168.0.133:80/pj/isales/categoryAddAllTo.htm"
+#define  URL_SEARCHADDALL  @"http://192.168.0.133:80/pj/isales/searchAddAllTo.htm"
+#define  URL_ITEMSEARCHADDALL @"http://192.168.0.133:80/pj/isales/itemSearchAddAllTo.htm"
 
 
 
 
-#define  URL_ITEM_DETAIL  @"http://192.168.0.119:80/pj/isales/modelDetail.htm"
+#define  URL_ITEM_DETAIL  @"http://192.168.0.133:80/pj/isales/modelDetail.htm"
 
 
-#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.119:80/pj/isales/addToWishList.htm"
-#define  URL_WATCHLIST  @"http://192.168.0.119:80/pj/isales/wishList.htm"
-#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.119:80/pj/isales/deleteToWishList.htm"
+#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.133:80/pj/isales/addToWishList.htm"
+#define  URL_WATCHLIST  @"http://192.168.0.133:80/pj/isales/wishList.htm"
+#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.133:80/pj/isales/deleteToWishList.htm"
 
 
 
 
 
 
-#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.119:80/pj/isales/addToPortfolio.htm"
-#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.119:80/pj/isales/deleteToPortfolio.htm"
-#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.119:80/pj/isales/deleteTearSheetPdf.htm"
-#define  URL_PORTFOLIO  @"http://192.168.0.119:80/pj/isales/portfolios.htm"
-#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.119:80/pj/isales/setTearSheetPrice.htm"
-#define  URL_DM_PARAMS @"http://192.168.0.119:80/pj/isales/selectTearSheetParam.htm"
-#define  URL_REQUEST_DM @"http://192.168.0.119:80/pj/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM_DIRECT @"http://192.168.0.119:80/pj/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM @"http://192.168.0.119:80/pj/isales/saveTearSheetPdf.htm"
-#define  URL_DM_LIST @"http://192.168.0.119:80/pj/isales/tearSheetPdfList.htm"
-//#define  URL_DM_SET_QTY @"http://192.168.0.119:80/pj/isales/setTearSheetAvailableQty.htm"
-#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.119:80/pj/isales/getTearSheetAvailableQty.htm"
+#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.133:80/pj/isales/addToPortfolio.htm"
+#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.133:80/pj/isales/deleteToPortfolio.htm"
+#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.133:80/pj/isales/deleteTearSheetPdf.htm"
+#define  URL_PORTFOLIO  @"http://192.168.0.133:80/pj/isales/portfolios.htm"
+#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.133:80/pj/isales/setTearSheetPrice.htm"
+#define  URL_DM_PARAMS @"http://192.168.0.133:80/pj/isales/selectTearSheetParam.htm"
+#define  URL_REQUEST_DM @"http://192.168.0.133:80/pj/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM_DIRECT @"http://192.168.0.133:80/pj/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM @"http://192.168.0.133:80/pj/isales/saveTearSheetPdf.htm"
+#define  URL_DM_LIST @"http://192.168.0.133:80/pj/isales/tearSheetPdfList.htm"
+//#define  URL_DM_SET_QTY @"http://192.168.0.133:80/pj/isales/setTearSheetAvailableQty.htm"
+#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.133:80/pj/isales/getTearSheetAvailableQty.htm"
 
 
-#define  URL_CONTACT_LIST  @"http://192.168.0.119:80/pj/isales/getAllContact.htm"
-#define  URL_SHIPTO_LIST  @"http://192.168.0.119:80/pj/isales/getShipToContact.htm"
+#define  URL_CONTACT_LIST  @"http://192.168.0.133:80/pj/isales/getAllContact.htm"
+#define  URL_SHIPTO_LIST  @"http://192.168.0.133:80/pj/isales/getShipToContact.htm"
 
 
-#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.119:80/pj/isales/getAddAddress.htm"
-#define  URL_ADDRESS_SAVE  @"http://192.168.0.119:80/pj/isales/saveAddress.htm"
+#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.133:80/pj/isales/getAddAddress.htm"
+#define  URL_ADDRESS_SAVE  @"http://192.168.0.133:80/pj/isales/saveAddress.htm"
 
 
 
 
-#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.119:80/pj/isales/creditCard.htm"
-#define  URL_CREDITCARD_SAVE  @"http://192.168.0.119:80/pj/isales/saveAddress.htm"
+#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.133:80/pj/isales/creditCard.htm"
+#define  URL_CREDITCARD_SAVE  @"http://192.168.0.133:80/pj/isales/saveAddress.htm"
 
 
 
 
 
 
-#define  URL_CUSTOMER_INFO  @"http://192.168.0.119:80/pj/isales/getCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.119:80/pj/isales/hasPendingOrderByContact.htm"
-#define  URL_NEW_CUSTOMER  @"http://192.168.0.119:80/pj/isales/getAddCustomer.htm"
-#define  URL_EDIT_CUSTOMER  @"http://192.168.0.119:80/pj/isales/getUpdateCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_SAVE  @"http://192.168.0.119:80/pj/isales/saveCustomer.htm"
-#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.119:80/pj/isales/updateCustomer.htm"
-#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.119:80/pj/isales/updateCustomerBusiCard.htm"
+#define  URL_CUSTOMER_INFO  @"http://192.168.0.133:80/pj/isales/getCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.133:80/pj/isales/hasPendingOrderByContact.htm"
+#define  URL_NEW_CUSTOMER  @"http://192.168.0.133:80/pj/isales/getAddCustomer.htm"
+#define  URL_EDIT_CUSTOMER  @"http://192.168.0.133:80/pj/isales/getUpdateCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_SAVE  @"http://192.168.0.133:80/pj/isales/saveCustomer.htm"
+#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.133:80/pj/isales/updateCustomer.htm"
+#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.133:80/pj/isales/updateCustomerBusiCard.htm"
 
 
 
 
 
 
 
 
 
 
 
 
-#define  URL_ERR_LOG  @"http://192.168.0.119:80/pj/isales/er_log.htm"
+#define  URL_ERR_LOG  @"http://192.168.0.133:80/pj/isales/er_log.htm"
 
 
-#define  URL_UPLOAD_IMG  @"http://192.168.0.119:80/pj/isales/uploadImg.htm"
+#define  URL_UPLOAD_IMG  @"http://192.168.0.133:80/pj/isales/uploadImg.htm"
 
 
 
 
-#define  URL_NPD_POLICY  @"http://192.168.0.119:80/pj/isales/generalPolicy.htm"
+#define  URL_NPD_POLICY  @"http://192.168.0.133:80/pj/isales/generalPolicy.htm"
 
 
 
 
-#define  URL_CHECK_OFFLINE  @"http://192.168.0.119:80/pj/offline/initDatas.htm"
-#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.119:80/pj/offline/uploadOfflineData.htm"
+#define  URL_CHECK_OFFLINE  @"http://192.168.0.133:80/pj/offline/initDatas.htm"
+#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.133:80/pj/offline/uploadOfflineData.htm"
 
 
 
 
-#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.119:80/pj/offline/downloadDatas.htm"
-#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.119:80/pj/offline/confirmVersion.htm"
+#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.133:80/pj/offline/downloadDatas.htm"
+#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.133:80/pj/offline/confirmVersion.htm"
 
 
 
 
-#define  URL_GET_RESULT  @"http://192.168.0.119:80/pj/offline/getResultBySerial.htm"
+#define  URL_GET_RESULT  @"http://192.168.0.133:80/pj/offline/getResultBySerial.htm"
 
 
-#define URL_SET_PRICE_TYPE @"http://192.168.0.119:80/pj/isales/setSeePriceType.htm"
+#define URL_SET_PRICE_TYPE @"http://192.168.0.133:80/pj/isales/setSeePriceType.htm"
 
 
-#define URL_GET_CIVEN_PRICE @"http://192.168.0.119:80/pj/isales/getSeeGivenPrice.htm"
+#define URL_GET_CIVEN_PRICE @"http://192.168.0.133:80/pj/isales/getSeeGivenPrice.htm"
 
 
-#define URL_SET_GIVEN_PRICE @"http://192.168.0.119:80/pj/isales/setSeeGivenPrice.htm"
+#define URL_SET_GIVEN_PRICE @"http://192.168.0.133:80/pj/isales/setSeeGivenPrice.htm"
 
 
-#define URL_SET_MERGE_ORDER @"http://192.168.0.119:80/pj/isales/mergeOrder.htm"
+#define URL_SET_MERGE_ORDER @"http://192.168.0.133:80/pj/isales/mergeOrder.htm"
 
 
-#define URL_REQUEST_LOGIN @"http://192.168.0.119:80/pj/isales/requestLogin.htm"
+#define URL_REQUEST_LOGIN @"http://192.168.0.133:80/pj/isales/requestLogin.htm"
 
 
-#define URL_EMAIL_CART @"http://192.168.0.119:80/pj/isales/sendCartEmail.htm"
+#define URL_EMAIL_CART @"http://192.168.0.133:80/pj/isales/sendCartEmail.htm"
 
 
-#define URL_NOTIFY_ME @"http://192.168.0.119:80/pj/isales/notifyMeEmail.htm"
+#define URL_NOTIFY_ME @"http://192.168.0.133:80/pj/isales/notifyMeEmail.htm"
 
 
 #else
 #else
 
 

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


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

@@ -2,4 +2,54 @@
 <Bucket
 <Bucket
    type = "0"
    type = "0"
    version = "2.0">
    version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "511169614.76319"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "500"
+            endingLineNumber = "500"
+            landmarkName = "UncaughtExceptionHandler()"
+            landmarkType = "9">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "511866037.385458"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "7784"
+            endingLineNumber = "7784"
+            landmarkName = "+itemsearch:limited:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "511867726.335969"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1149"
+            endingLineNumber = "1149"
+            landmarkName = "-switchToCagegory:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
 </Bucket>
 </Bucket>

+ 13 - 5
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -1105,12 +1105,20 @@
     self.itemSearchViewController.covertype = coverttype;
     self.itemSearchViewController.covertype = coverttype;
     self.itemSearchViewController.saved_covertype = coverttype;
     self.itemSearchViewController.saved_covertype = coverttype;
     
     
-    self.categoryViewController.p_available = nil;
-    self.categoryViewController.p_price = nil;
-    self.categoryViewController.p_QTY = nil;
-    self.categoryViewController.p_bestseller = nil;
+//    self.categoryViewController.p_available = nil;
+//    self.categoryViewController.p_price = nil;
+//    self.categoryViewController.p_QTY = nil;
+//    self.categoryViewController.p_bestseller = nil;
+//    [self.itemSearchViewController reload_container_getdata:true];
+    
+    
+    self.itemSearchViewController.p_available = nil;
+    self.itemSearchViewController.p_price = nil;
+    self.itemSearchViewController.p_QTY = nil;
+    self.itemSearchViewController.p_bestseller = nil;
     [self.itemSearchViewController reload_container_getdata:true];
     [self.itemSearchViewController reload_container_getdata:true];
     
     
+    
     //    .categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     //    .categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     //    self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     //    self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     //    //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     //    //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
@@ -1140,7 +1148,7 @@
     
     
     UIApplication * app = [UIApplication sharedApplication];
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-    NSString* aaa =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];;
+//    NSString* aaa =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];;
     self.categoryViewController.categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     self.categoryViewController.categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];

+ 6 - 1
RedAnt ERP Mobile/common/Functions/category/CategorySearchFilterViewController.h

@@ -29,7 +29,7 @@
 
 
 
 
 @property (strong, nonatomic) IBOutlet UILabel *labelPrice;
 @property (strong, nonatomic) IBOutlet UILabel *labelPrice;
-@property (nonatomic , copy) void (^OkClick)(NSString* modelname,NSString* modeldescrip,NSString* available,NSString* QTY,NSString* alert,NSString* price , NSString* bestseller);
+@property (nonatomic , copy) void (^OkClick)(NSString *ids,NSString* modelname,NSString* modeldescrip,NSString* available,NSString* QTY,NSString* alert,NSString* price , NSString* bestseller);
 @property (nonatomic , copy) void (^ResetClick)(void);
 @property (nonatomic , copy) void (^ResetClick)(void);
 
 
 @property (strong, nonatomic) NSString* modelname;
 @property (strong, nonatomic) NSString* modelname;
@@ -42,4 +42,9 @@
 
 
 
 
 @property (strong,nonatomic)NSDictionary* categoryMenu;
 @property (strong,nonatomic)NSDictionary* categoryMenu;
+
+#pragma mark - mutiple selection
+
+@property (nonatomic,copy) NSString *ids;
+
 @end
 @end

+ 157 - 41
RedAnt ERP Mobile/common/Functions/category/CategorySearchFilterViewController.m

@@ -147,6 +147,7 @@
 - (void)viewDidLoad {
 - (void)viewDidLoad {
     [super viewDidLoad];
     [super viewDidLoad];
     
     
+    [self initCheckedCategory];
     
     
     RATreeView *treeView = [[RATreeView alloc] initWithFrame:self.treeContainer.frame];
     RATreeView *treeView = [[RATreeView alloc] initWithFrame:self.treeContainer.frame];
     
     
@@ -453,6 +454,8 @@
 }
 }
 - (IBAction)onSearchClick:(id)sender {
 - (IBAction)onSearchClick:(id)sender {
     
     
+    NSString *ids = [[self get_checkedIDs:self.categoryMenu] componentsJoinedByString:@","];
+    
     NSString* modelname = self.textModelName.text;
     NSString* modelname = self.textModelName.text;
     if(modelname.length==0)
     if(modelname.length==0)
         modelname = nil;
         modelname = nil;
@@ -483,7 +486,7 @@
 
 
     
     
     if(self.OkClick)
     if(self.OkClick)
-        self.OkClick( modelname, modeldescrip,available, qty, alert,price,bestseller);
+        self.OkClick(ids, modelname, modeldescrip,available, qty, alert,price,bestseller);
     [self dismissViewControllerAnimated:true completion:nil];
     [self dismissViewControllerAnimated:true completion:nil];
 }
 }
 #pragma mark TreeView Delegate methods
 #pragma mark TreeView Delegate methods
@@ -502,9 +505,15 @@
     return YES;
     return YES;
 }
 }
 
 
+- (BOOL)treeView:(RATreeView *)treeView shouldExpandRowForItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo {
+
+    return YES;
+}
+
 - (BOOL)treeView:(RATreeView *)treeView shouldItemBeExpandedAfterDataReload:(id)item treeDepthLevel:(NSInteger)treeDepthLevel
 - (BOOL)treeView:(RATreeView *)treeView shouldItemBeExpandedAfterDataReload:(id)item treeDepthLevel:(NSInteger)treeDepthLevel
 {
 {
-    if([item[@"id"] isEqualToString:self.categoryid] )
+    NSArray *idArr = [self.ids componentsSeparatedByString:@","];
+    if([idArr containsObject:item[@"id"]])
         return YES;
         return YES;
     return NO;
     return NO;
 }
 }
@@ -512,37 +521,37 @@
 - (void)treeView:(RATreeView *)treeView didSelectRowForItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo
 - (void)treeView:(RATreeView *)treeView didSelectRowForItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo
 {
 {
     
     
-//    NSDictionary *data = item;
-//    int count = [[data valueForKey:@"count"] intValue];
-//    if(count==0)
-//    {
-//        
-//        
-//        
-//        
-//        NSString* _id =  [data valueForKey:@"cid"];
-//        
-//        NSDictionary* ddd=[self check:_id source:[self.categoryMenu mutableCopy]];
-//        self.categoryMenu=ddd;
-//        UITableViewCell *cell = (UITableViewCell *)[self.treeView cellForItem:item];
-//        
-//        
-//        
-//        int check=[self is_check:_id source:self.categoryMenu];
-//        if(check==1)
-//            cell.accessoryType = UITableViewCellAccessoryCheckmark;
-//        else
-//            cell.accessoryType=UITableViewCellAccessoryNone;
-//        
-//        
-//        
-//    }
-//    
-//    
-//    
-//    
-//    
-//    DebugLog(@"menu select %@",data);
+#ifdef BUILD_NPD
+    NSDictionary *data = item;
+    int count = [[data valueForKey:@"count"] intValue];
+    if(count==0)
+    {
+
+        
+        NSString* _id =  [data valueForKey:@"id"];
+        
+        NSDictionary* ddd=[self check:_id source:[self.categoryMenu mutableCopy]];
+        self.categoryMenu=ddd;
+        UITableViewCell *cell = (UITableViewCell *)[self.treeView cellForItem:item];
+        
+        
+        
+        int check=[self is_check:_id source:self.categoryMenu];
+        if(check==1)
+            cell.accessoryType = UITableViewCellAccessoryCheckmark;
+        else
+            cell.accessoryType=UITableViewCellAccessoryNone;
+        
+        
+        
+    }
+    DebugLog(@"menu select %@",data);
+#endif
+    
+    
+    
+    
+    
 }
 }
 
 
 //- (void)treeView:(RATreeView *)treeView willDisplayCell:(UITableViewCell *)cell forItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo
 //- (void)treeView:(RATreeView *)treeView willDisplayCell:(UITableViewCell *)cell forItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo
@@ -579,16 +588,17 @@
     cell.textLabel.text = [((NSDictionary *)item) valueForKey:@"title"];
     cell.textLabel.text = [((NSDictionary *)item) valueForKey:@"title"];
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     cell.accessoryType =UITableViewCellAccessoryNone;
     cell.accessoryType =UITableViewCellAccessoryNone;
-    //  if (treeNodeInfo.treeDepthLevel == 0) {
-    //      cell.detailTextLabel.textColor = [UIColor blackColor];
-    NSString* _id =  [((NSDictionary *)item) valueForKey:@"cid"];
-    //    int check=[self is_check:_id source:self.categoryMenu];
-    if([[((NSDictionary *)item) valueForKey:@"id"] isEqualToString:self.categoryid]&& [item[@"count"] intValue]==0)
-    {
+
+    
+    NSString *categoryID = [((NSDictionary *)item) valueForKey:@"id"];
+    int check=[self is_check:categoryID source:self.categoryMenu];
+    BOOL hasSon = [item[@"count"] intValue] == 0;
+    
+    if(check == 1 && hasSon){
         cell.accessoryType = UITableViewCellAccessoryCheckmark;
         cell.accessoryType = UITableViewCellAccessoryCheckmark;
-    }
-    else
+    } else {
         cell.accessoryType =UITableViewCellAccessoryNone;
         cell.accessoryType =UITableViewCellAccessoryNone;
+    }
     
     
     
     
     
     
@@ -636,4 +646,110 @@
      */
      */
 }
 }
 
 
+#pragma mark - Private
+/**数据选择*/
+-(NSMutableDictionary*) check:(NSString*) cid source:(NSMutableDictionary*) json
+{
+    int count = [[json valueForKey:@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSMutableDictionary* category = [[json objectForKey:[NSString stringWithFormat:@"category_%d",i]] mutableCopy];
+        int c1 = [[category valueForKey:@"count"] intValue];
+        if(c1==0)
+        {
+            NSString* _id = [category valueForKey:@"id"];
+            if([_id isEqualToString:cid])
+            {
+                int check = [[category valueForKey:@"check"] intValue];
+                if(check==1)
+                    [  category setValue:@"0" forKey:@"check"] ;
+                else
+                    [  category setValue:@"1" forKey:@"check"] ;
+                [json setObject:category forKey:[NSString stringWithFormat:@"category_%d",i]];
+            }
+        }
+        else
+        {
+            NSMutableDictionary* ret=[self check:cid source:category];
+            
+            [json setObject:ret forKey:[NSString stringWithFormat:@"category_%d",i]];
+        }
+    }
+    return json;
+    
+    
+}
+/**判断Category是否被选中*/
+-(int) is_check:(NSString*) cid source:(NSDictionary*) json
+{
+    int count = [[json valueForKey:@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSDictionary* category = [json objectForKey:[NSString stringWithFormat:@"category_%d",i]];
+        int c1 = [[category valueForKey:@"count"] intValue];
+        if(c1==0)
+        {
+            NSString* _id = [category valueForKey:@"id"];
+            if([_id isEqualToString:cid])
+            {
+                int check = [[category valueForKey:@"check"] intValue];
+                return check;
+            }
+        }
+        else
+        {
+            int check=[self is_check:cid source:category];
+            
+            if(check!=-1)
+                return check;
+        }
+    }
+    return -1;
+    
+    
+}
+/**获取选中Category ID*/
+-(NSArray*) get_checkedIDs:(NSDictionary*) json
+{
+    
+    NSMutableArray * array = [[NSMutableArray alloc]init];
+    int count = [[json valueForKey:@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSDictionary* category = [json objectForKey:[NSString stringWithFormat:@"category_%d",i]];
+        int c1 = [[category valueForKey:@"count"] intValue];
+        if(c1==0)
+        {
+            NSString* _id = [category valueForKey:@"id"];
+            int check = [[category valueForKey:@"check"] intValue];
+            if(check==1)
+                [array addObject:_id];
+        }
+        else
+        {
+            NSArray * ret=[self get_checkedIDs:category];
+            
+            
+            for(int l=0;l<ret.count;l++)
+            {
+                [array addObject:ret[l]];
+            }
+            
+        }
+    }
+    return array ;
+
+}
+/**初始化时检查选择情况*/
+- (void)initCheckedCategory {
+    
+    NSMutableDictionary *mutableCategoryMenu = [self.categoryMenu mutableCopy];
+    NSArray *idsArr = [self.ids componentsSeparatedByString:@","];
+    for (NSString *categoryID in idsArr) {
+        [self check:categoryID source:mutableCategoryMenu];
+    }
+    self.categoryMenu = [mutableCategoryMenu copy];
+}
+
+
 @end
 @end

+ 76 - 4
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -177,6 +177,8 @@
     filterVC.categoryid = self.categoryid;
     filterVC.categoryid = self.categoryid;
     filterVC.default_filter = [[self.category_data objectForKey:@"filter"] mutableCopy];
     filterVC.default_filter = [[self.category_data objectForKey:@"filter"] mutableCopy];
 
 
+    filterVC.ids = self.categoryid;
+    
     //----------fake category filter----------------
     //----------fake category filter----------------
 //    NSData* json =nil;
 //    NSData* json =nil;
 //    json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"debug_category_filter" ofType:@"json" ]];
 //    json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"debug_category_filter" ofType:@"json" ]];
@@ -195,9 +197,34 @@
     filterVC.price_cadedate=[[self.category_data objectForKey:@"filter"] objectForKey:@"price"];
     filterVC.price_cadedate=[[self.category_data objectForKey:@"filter"] objectForKey:@"price"];
     filterVC.bestseller_cadedate=[[self.category_data objectForKey:@"filter"] objectForKey:@"best_seller"];
     filterVC.bestseller_cadedate=[[self.category_data objectForKey:@"filter"] objectForKey:@"best_seller"];
     
     
-    filterVC.OkClick =^(NSString* modelname,NSString* modeldescrip,NSString* available,NSString* QTY,NSString* alert,NSString* price,NSString* bestseller)
+    filterVC.OkClick =^(NSString *ids,NSString* modelname,NSString* modeldescrip,NSString* available,NSString* QTY,NSString* alert,NSString* price,NSString* bestseller)
     {
     {
+#ifdef BUILD_NPD
+        NSArray *idArr = [ids componentsSeparatedByString:@","];
+        if (idArr.count == 1) {
+            self.categoryString = [@"Category" stringByAppendingString:[self categoryString:ids node:menu level:0]];
+        } else {
+            self.categoryString = @"Category>Multiple Category>";
+        }
+        
+//        idArr = [idArr sortedArrayUsingComparator:^NSComparisonResult(id  _Nonnull obj1, id  _Nonnull obj2) {
+//            
+//            NSString *id0 = (NSString *)obj1;
+//            NSString *id1 = (NSString *)obj2;
+//            
+//            if (id1.length > id0.length && [id1 hasPrefix:id0]) {
+//                return NSOrderedAscending;
+//            }
+//            
+//            return NSOrderedDescending;
+//            return NSOrderedAscending;
+//        }];
+//        
+        
+        self.cagegoryLabel.text =self.categoryString;
         
         
+        self.categoryid = ids;
+#endif
         self.modelname = modelname;
         self.modelname = modelname;
         self.modeldescrip = modeldescrip;
         self.modeldescrip = modeldescrip;
         self.p_alert=alert;
         self.p_alert=alert;
@@ -775,7 +802,7 @@
         
         
         NSDictionary* return_json = nil;
         NSDictionary* return_json = nil;
         if (self.addAll) {
         if (self.addAll) {
-            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
             return_json = [iSalesNetwork Category_addall:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:self.offset limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price bestseller:self.p_bestseller modelname:self.modelname modeldescrip:self.modeldescrip orderCode:nil  addTo:@"portfolio"];
             return_json = [iSalesNetwork Category_addall:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:self.offset limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price bestseller:self.p_bestseller modelname:self.modelname modeldescrip:self.modeldescrip orderCode:nil  addTo:@"portfolio"];
         } else {
         } else {
             return_json = [iSalesNetwork add_toPortfolio:ids ];
             return_json = [iSalesNetwork add_toPortfolio:ids ];
@@ -1838,9 +1865,13 @@
         }
         }
         else
         else
         {
         {
+            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 
-                NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                NSData*  downloadimg_data = nil;
+                if (!appDelegate.offline_mode) {
+                    downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                }
                 
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                 dispatch_async(dispatch_get_main_queue(), ^{
                     
                     
@@ -2142,8 +2173,12 @@
     else
     else
     {
     {
         NSString* detail_id= [NSString stringWithFormat:@"%@",   [item valueForKey:@"product_id"] ] ;
         NSString* detail_id= [NSString stringWithFormat:@"%@",   [item valueForKey:@"product_id"] ] ;
+        NSString *item_category_id = [item valueForKey:@"item_category_id"];
+#ifndef BUILD_NPD
+        item_category_id = self.categoryid;
+#endif
         
         
-        [self showDetailat:detail_id category_id:self.categoryid index:indexPath.row];
+        [self showDetailat:detail_id category_id:item_category_id index:indexPath.row];
     }
     }
     
     
     //    UICollectionViewCell * cell = (UICollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
     //    UICollectionViewCell * cell = (UICollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
@@ -2462,4 +2497,41 @@
     [self addALlModel];
     [self addALlModel];
 }
 }
 
 
+#pragma mark - Private
+
+-(NSString*) categoryString:(NSString*) categoryid node:(NSDictionary*) json level:(int) level {
+    
+    if(categoryid.length==0)
+        return @">All Products>";
+    //NSString* idString = [NSString stringWithFormat:@"%d",categoryid];
+    NSString* categoryString =@">";
+    int count = [[json valueForKey:@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSDictionary * category_json = [json objectForKey:[NSString stringWithFormat:@"category_%d",i]];
+        NSString* cid = [category_json valueForKey:@"id"] ;
+        
+        //        NSString* ttt =[categoryid substringToIndex:2+level*2];
+        //        NSString * qqq =[cid substringToIndex:2+level*2];
+        
+        
+        //        NSString *ds1=[categoryid substringToIndex:3+level*3];
+        //        NSString*ds2 = [cid substringToIndex:3+level*3];
+        if(cid.length<3+level*3)
+            continue;
+        
+        if(categoryid.length<3+level*3)
+            continue;
+        if([[categoryid substringToIndex:3+level*3] isEqualToString: [cid substringToIndex:3+level*3]])
+        {
+            //categoryString = [categoryString stringByAppendingString:@">"];
+            categoryString =[categoryString stringByAppendingString: [category_json valueForKey:@"title" ] ];
+            categoryString = [categoryString stringByAppendingString:[ self categoryString:categoryid node:category_json level:level+1]];
+            break;
+        }
+        
+    }
+    return categoryString;
+}
+
 @end
 @end

+ 7 - 2
RedAnt ERP Mobile/common/Functions/modelDetail/DetailTopicCell.m

@@ -11,6 +11,7 @@
 #import "iSalesDB.h"
 #import "iSalesDB.h"
 #import "DetailViewController.h"
 #import "DetailViewController.h"
 #import "DefaultAppearance.h"
 #import "DefaultAppearance.h"
+#import "AppDelegate.h"
 
 
 
 
 @implementation DetailTopicCell
 @implementation DetailTopicCell
@@ -70,7 +71,7 @@
 -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
 {
     
     
-    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     NSString* value =[DefaultAppearance get_noneappearance_value:@"CategoryViewController" valuename:@"cell_border_color"];
     NSString* value =[DefaultAppearance get_noneappearance_value:@"CategoryViewController" valuename:@"cell_border_color"];
     
     
     
     
@@ -105,9 +106,13 @@
         else
         else
         {
         {
             
             
+            
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 
-                NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                NSData*  downloadimg_data = nil;
+                if (!appDelegate.offline_mode) {
+                    downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                }
                 
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                 dispatch_async(dispatch_get_main_queue(), ^{
                     
                     

+ 12 - 4
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -1269,7 +1269,10 @@ self.isrefreshing=false;
                     }
                     }
                     else
                     else
                     {
                     {
-                        NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                        NSData*  downloadimg_data = nil;
+                        if (!appDelegate.offline_mode) {
+                            downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                        }
                         dispatch_async(dispatch_get_main_queue(), ^{
                         dispatch_async(dispatch_get_main_queue(), ^{
                             
                             
                             
                             
@@ -1351,7 +1354,10 @@ self.isrefreshing=false;
                 }
                 }
                 else
                 else
                 {
                 {
-                    NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                    NSData*  downloadimg_data = nil;
+                    if (!appDelegate.offline_mode) {
+                        downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                    }
                     dispatch_async(dispatch_get_main_queue(), ^{
                     dispatch_async(dispatch_get_main_queue(), ^{
                         
                         
                         
                         
@@ -1582,8 +1588,10 @@ self.isrefreshing=false;
                     
                     
                     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                         
                         
-                        NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
-                        
+                        NSData*  downloadimg_data = nil;
+                        if (!appDelegate.offline_mode) {
+                            downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                        }
                         dispatch_async(dispatch_get_main_queue(), ^{
                         dispatch_async(dispatch_get_main_queue(), ^{
                             
                             
                             
                             

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

@@ -7258,7 +7258,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     NSString *where = [NSString stringWithFormat:@"category like'%%#%@#%%' and is_active = 1",category];
     NSString *where = [NSString stringWithFormat:@"category like'%%#%@#%%' and is_active = 1",category];
     
     
     
     
-    NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete from product m left join wishlist w on m.product_id=w.product_id left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id  where m.category like'%%#%@#%%' and m.is_active = 1 order by m.name %@ ;",appDelegate.order_code, category,limit_str];
+    NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete,m.category from product m left join wishlist w on m.product_id=w.product_id left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id  where m.category like'%%#%@#%%' and m.is_active = 1 order by m.name %@ ;",appDelegate.order_code, category,limit_str];
     
     
     
     
     double price_min = 0;
     double price_min = 0;
@@ -7340,13 +7340,42 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         }
         }
         
         
         // cate
         // cate
-        category = [self translateSingleQuote:category];
-        NSString *cateWhere = [NSString stringWithFormat:@"category like'%%#%@#%%'",category];
+//        category = [self translateSingleQuote:category];
+//        NSString *cateWhere = [NSString stringWithFormat:@"category like'%%#%@#%%'",category];
+        
+        // cate mutiple selection
+        NSString *category_id = params[@"category"];
+        NSMutableArray *cate_id_array = nil;
+        NSMutableString *cateWhere = [NSMutableString string];
+        
+        if ([category_id isEqualToString:@""] || !category_id) {
+            [cateWhere appendString:@"1 = 1"];
+        } else {
+            
+            if ([category_id containsString:@","]) {
+                cate_id_array = [[category_id componentsSeparatedByString:@","] mutableCopy];
+            } else {
+                cate_id_array = [@[category_id] mutableCopy];
+            }
+            
+            [cateWhere appendString:@"("];
+            for (int i = 0; i < cate_id_array.count; i++) {
+                
+                if (i == 0) {
+                    [cateWhere appendFormat:@"category like'%%#%@#%%'",cate_id_array[i]];
+                } else {
+                    [cateWhere appendFormat:@" or category like'%%#%@#%%'",cate_id_array[i]];
+                }
+                
+            }
+            [cateWhere appendString:@")"];
+            
+        }
         
         
         // where bestseller > 0 order by bestseller desc
         // where bestseller > 0 order by bestseller desc
         // sql query: alert     availability(int)   best_seller(int)    price    qty
         // sql query: alert     availability(int)   best_seller(int)    price    qty
         
         
-        sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete from (select name,description,product_id,closeout,best_seller from product where %@ %@ %@ %@ %@ %@ and is_active = 1) m left join wishlist w on m.product_id=w.product_id left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id order by %@ %@;",cateWhere,best_seller,alert,available_condition,qty,price,appDelegate.order_code,order_best_seller,limit_str];
+        sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete,m.category from (select name,description,product_id,closeout,best_seller,category from product where %@ %@ %@ %@ %@ %@ and is_active = 1) m left join wishlist w on m.product_id=w.product_id left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id order by %@ %@;",cateWhere,best_seller,alert,available_condition,qty,price,appDelegate.order_code,order_best_seller,limit_str];
         
         
         
         
         where =[NSString stringWithFormat:@"%@ %@ %@ %@ %@ %@ and is_active = 1",cateWhere,best_seller,alert,available_condition,qty,price];
         where =[NSString stringWithFormat:@"%@ %@ %@ %@ %@ %@ and is_active = 1",cateWhere,best_seller,alert,available_condition,qty,price];
@@ -7395,6 +7424,52 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             int closeout = sqlite3_column_int(statement, 4);
             int closeout = sqlite3_column_int(statement, 4);
             int cid = sqlite3_column_int(statement, 5);
             int cid = sqlite3_column_int(statement, 5);
             int wisdelete = sqlite3_column_int(statement, 6);
             int wisdelete = sqlite3_column_int(statement, 6);
+            NSString *categoryStr = [self textAtColumn:7 statement:statement];
+            
+            // Defaul Category ID
+            __block NSString *categoryID = nil;
+            NSString *defaultCateSQL = [NSString stringWithFormat:@"select default_category from product where product_id=%d;",product_id];
+            [iSalesDB jk_query:defaultCateSQL db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
+                
+                char *default_category = (char*)sqlite3_column_text(stmt, 0);
+                if(default_category==nil)
+                    default_category="";
+                NSString *nsdefault_category = [[NSString alloc]initWithUTF8String:default_category];
+                nsdefault_category=[nsdefault_category stringByReplacingOccurrencesOfString:@"%#" withString:@""];
+                nsdefault_category=[nsdefault_category stringByReplacingOccurrencesOfString:@"#%" withString:@""];
+                
+                categoryID = nsdefault_category;
+                
+            }];
+            
+            if (!categoryID.length) {
+                NSString *cateIDs = params[@"category"];
+                NSArray *requestCategoryArr = [cateIDs componentsSeparatedByString:@","];
+                NSArray *itemCategoryArr = [categoryStr componentsSeparatedByString:@","];
+                for (NSString *cateID in requestCategoryArr) {
+                    
+                    BOOL needBreak = NO;
+                    for (NSString *itemCateIDBox in itemCategoryArr) {
+                        
+                        if (itemCateIDBox.length > 4) {
+                            NSString *itemCategoryID = [itemCateIDBox substringFromIndex:2];
+                            itemCategoryID = [itemCategoryID substringToIndex:itemCategoryID.length - 2];
+                            
+                            if ([itemCategoryID isEqualToString:cateID]) {
+                                needBreak = YES;
+                                categoryID = itemCategoryID;
+                                break;
+                            }
+                        }
+                        
+                    }
+                    if (needBreak) {
+                        break;
+                    }
+                    
+                }
+            }
+            
             NSMutableDictionary* imgjson=[self category_img:product_id  db:db];
             NSMutableDictionary* imgjson=[self category_img:product_id  db:db];
             
             
             if(wid !=0 && wisdelete != 1)
             if(wid !=0 && wisdelete != 1)
@@ -7419,8 +7494,12 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             // [item setValue:nsurl forKey:@"img"];
             // [item setValue:nsurl forKey:@"img"];
             [item setValue:nsname forKey:@"name"];
             [item setValue:nsname forKey:@"name"];
             [item setValue:nsdescription forKey:@"description"];
             [item setValue:nsdescription forKey:@"description"];
+            if (categoryID) {
+                [item setValue:categoryID forKey:@"item_category_id"];
+            }
             [item setValue:[NSString stringWithFormat:@"%d",product_id] forKey:@"product_id"];
             [item setValue:[NSString stringWithFormat:@"%d",product_id] forKey:@"product_id"];
             [items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
             [items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
+            
             i++;
             i++;
             
             
         }
         }
@@ -7611,7 +7690,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             /*-----------*/
             /*-----------*/
             NSMutableDictionary *cateDic = [[filter objectForKey:@"category"] mutableCopy];// 老子
             NSMutableDictionary *cateDic = [[filter objectForKey:@"category"] mutableCopy];// 老子
             
             
-            
+            [cateWhere appendString:@"("];
             for (int i = 0; i < cate_id_array.count; i++) {
             for (int i = 0; i < cate_id_array.count; i++) {
                 
                 
                 for (NSString *key0 in cateDic.allKeys) {
                 for (NSString *key0 in cateDic.allKeys) {
@@ -7632,7 +7711,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                                     if (i == 0) {
                                     if (i == 0) {
                                         [cateWhere appendFormat:@"category like'%%#%@#%%'",cate_id_array[i]];
                                         [cateWhere appendFormat:@"category like'%%#%@#%%'",cate_id_array[i]];
                                     } else {
                                     } else {
-                                        [cateWhere appendFormat:@"or category like'%%#%@#%%'",cate_id_array[i]];
+                                        [cateWhere appendFormat:@" or category like'%%#%@#%%'",cate_id_array[i]];
                                     }
                                     }
                                     [category1 setValue:[NSNumber numberWithInteger:1] forKey:@"check"];
                                     [category1 setValue:[NSNumber numberWithInteger:1] forKey:@"check"];
                                     [category0 setValue:category1 forKey:key1];
                                     [category0 setValue:category1 forKey:key1];
@@ -7648,7 +7727,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                                     if (i == 0) {
                                     if (i == 0) {
                                         [cateWhere appendFormat:@"category like'%%#%@#%%'",cate_id_array[i]];
                                         [cateWhere appendFormat:@"category like'%%#%@#%%'",cate_id_array[i]];
                                     } else {
                                     } else {
-                                        [cateWhere appendFormat:@"or category like'%%#%@#%%'",cate_id_array[i]];
+                                        [cateWhere appendFormat:@" or category like'%%#%@#%%'",cate_id_array[i]];
                                     }
                                     }
                                     [category0 setValue:[NSNumber numberWithInteger:1] forKey:@"check"];
                                     [category0 setValue:[NSNumber numberWithInteger:1] forKey:@"check"];
                                     [cateDic setValue:category0 forKey:key0];
                                     [cateDic setValue:category0 forKey:key0];
@@ -7664,6 +7743,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                 }
                 }
                 
                 
             }
             }
+            [cateWhere appendString:@")"];
+            
             [filter setValue:cateDic forKey:@"category"];
             [filter setValue:cateDic forKey:@"category"];
         }
         }
         
         

+ 80 - 80
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -41,131 +41,131 @@
 #ifdef test_server
 #ifdef test_server
 
 
 //------------------- chen server-----------------------
 //------------------- chen server-----------------------
-#define  URL_UPDATE_AUTH  @"http://192.168.0.119:8080/site/isales/login.htm"
-#define  URL_LOGOUT  @"http://192.168.0.119:8080/site/isales/loginOut.htm"
-#define  URL_RETRIEVE_PASS  @"http://192.168.0.119:8080/site/isales/forgotPassword.htm"
+#define  URL_UPDATE_AUTH  @"http://192.168.0.133:8080/site/isales/login.htm"
+#define  URL_LOGOUT  @"http://192.168.0.133:8080/site/isales/loginOut.htm"
+#define  URL_RETRIEVE_PASS  @"http://192.168.0.133:8080/site/isales/forgotPassword.htm"
 
 
-#define  URL_REQUEST_CATMENU  @"http://192.168.0.119:8080/site/isales/menu.htm"
-#define  URL_LOAD_HOME  @"http://192.168.0.119:8080/site/isales/homePage.htm"
-#define  URL_CATEGORY @"http://192.168.0.119:8080/site/isales/distinctCategory.htm"
-#define  URL_SEARCH  @"http://192.168.0.119:8080/site/isales/search.htm"
-#define  URL_ITEM_SEARCH  @"http://192.168.0.119:8080/site/isales/itemSearch.htm"
-#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.119:8080/site/isales/categoryMore.htm"
-#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.119:8080/site/isales/getContactAdvance.htm"
+#define  URL_REQUEST_CATMENU  @"http://192.168.0.133:8080/site/isales/menu.htm"
+#define  URL_LOAD_HOME  @"http://192.168.0.133:8080/site/isales/homePage.htm"
+#define  URL_CATEGORY @"http://192.168.0.133:8080/site/isales/distinctCategory.htm"
+#define  URL_SEARCH  @"http://192.168.0.133:8080/site/isales/search.htm"
+#define  URL_ITEM_SEARCH  @"http://192.168.0.133:8080/site/isales/itemSearch.htm"
+#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.133:8080/site/isales/categoryMore.htm"
+#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.133:8080/site/isales/getContactAdvance.htm"
 
 
 
 
-#define  URL_ORDER_LIST  @"http://192.168.0.119:8080/site/isales/orderList.htm"
-#define  URL_ORDER_DETAIL  @"http://192.168.0.119:8080/site/isales/orderDetail.htm"
-#define URL_COMMIT_ORDER @"http://192.168.0.119:8080/site/isales/createOrder.htm"
-#define URL_COPY_ORDER @"http://192.168.0.119:8080/site/isales/copyOrder.htm"
-#define URL_SIGN_ORDER @"http://192.168.0.119:8080/site/isales/updateOrderSign.htm"
-#define URL_SAVE_ORDER @"http://192.168.0.119:8080/site/isales/saveOrder.htm"
-#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.119:8080/site/isales/updateOrderCustomerInfo.htm"
-#define  URL_NEW_ORDER  @"http://192.168.0.119:8080/site/isales/createNewOrder.htm"
-#define  URL_OPEN_ORDER  @"http://192.168.0.119:8080/site/isales/openOrder.htm"
-#define  URL_RELEASE_ORDER  @"http://192.168.0.119:8080/site/isales/closeOrder.htm"
-#define  URL_DELETE_ORDER  @"http://192.168.0.119:8080/site/isales/deleteOrder.htm"
-#define  URL_CANCEL_ORDER  @"http://192.168.0.119:8080/site/isales/cancelOrder.htm"
+#define  URL_ORDER_LIST  @"http://192.168.0.133:8080/site/isales/orderList.htm"
+#define  URL_ORDER_DETAIL  @"http://192.168.0.133:8080/site/isales/orderDetail.htm"
+#define URL_COMMIT_ORDER @"http://192.168.0.133:8080/site/isales/createOrder.htm"
+#define URL_COPY_ORDER @"http://192.168.0.133:8080/site/isales/copyOrder.htm"
+#define URL_SIGN_ORDER @"http://192.168.0.133:8080/site/isales/updateOrderSign.htm"
+#define URL_SAVE_ORDER @"http://192.168.0.133:8080/site/isales/saveOrder.htm"
+#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.133:8080/site/isales/updateOrderCustomerInfo.htm"
+#define  URL_NEW_ORDER  @"http://192.168.0.133:8080/site/isales/createNewOrder.htm"
+#define  URL_OPEN_ORDER  @"http://192.168.0.133:8080/site/isales/openOrder.htm"
+#define  URL_RELEASE_ORDER  @"http://192.168.0.133:8080/site/isales/closeOrder.htm"
+#define  URL_DELETE_ORDER  @"http://192.168.0.133:8080/site/isales/deleteOrder.htm"
+#define  URL_CANCEL_ORDER  @"http://192.168.0.133:8080/site/isales/cancelOrder.htm"
 
 
 
 
-#define  URL_CART_SET_PRICE  @"http://192.168.0.119:8080/site/isales/setPrice.htm"
-#define  URL_CART_ITEM_NOTES  @"http://192.168.0.119:8080/site/isales/setItemNotes.htm"
-#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.119:8080/site/isales/updateGeneralNote.htm"
+#define  URL_CART_SET_PRICE  @"http://192.168.0.133:8080/site/isales/setPrice.htm"
+#define  URL_CART_ITEM_NOTES  @"http://192.168.0.133:8080/site/isales/setItemNotes.htm"
+#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.133:8080/site/isales/updateGeneralNote.htm"
 
 
-#define  URL_CART_INCRESEMENT  @"http://192.168.0.119:8080/site/isales/increment.htm"
-#define  URL_CART  @"http://192.168.0.119:8080/site/isales/cartDtail.htm"
-#define  URL_CARTDELIVERY  @"http://192.168.0.119:8080/site/isales/cartDelivery.htm"
-#define  URL_ADD_TO_CART  @"http://192.168.0.119:8080/site/isales/addToCart.htm"
-#define  URL_CART_REMOVE  @"http://192.168.0.119:8080/site/isales/deleteToCart.htm"
-#define  URL_CART_CHECK  @"http://192.168.0.119:8080/site/isales/checkCartItem.htm"
-#define  URL_CART2WISH  @"http://192.168.0.119:8080/site/isales/cartRemoveToWishlist.htm"
-#define  URL_WISH2CART  @"http://192.168.0.119:8080/site/isales/wishlistRemoveToCart.htm"
+#define  URL_CART_INCRESEMENT  @"http://192.168.0.133:8080/site/isales/increment.htm"
+#define  URL_CART  @"http://192.168.0.133:8080/site/isales/cartDtail.htm"
+#define  URL_CARTDELIVERY  @"http://192.168.0.133:8080/site/isales/cartDelivery.htm"
+#define  URL_ADD_TO_CART  @"http://192.168.0.133:8080/site/isales/addToCart.htm"
+#define  URL_CART_REMOVE  @"http://192.168.0.133:8080/site/isales/deleteToCart.htm"
+#define  URL_CART_CHECK  @"http://192.168.0.133:8080/site/isales/checkCartItem.htm"
+#define  URL_CART2WISH  @"http://192.168.0.133:8080/site/isales/cartRemoveToWishlist.htm"
+#define  URL_WISH2CART  @"http://192.168.0.133:8080/site/isales/wishlistRemoveToCart.htm"
 
 
 
 
 
 
 
 
-#define  URL_CATEGORYADDALL  @"http://192.168.0.119:8080/site/isales/categoryAddAllTo.htm"
-#define  URL_SEARCHADDALL  @"http://192.168.0.119:8080/site/isales/searchAddAllTo.htm"
-#define  URL_ITEMSEARCHADDALL @"http://192.168.0.119:8080/site/isales/itemSearchAddAllTo.htm"
+#define  URL_CATEGORYADDALL  @"http://192.168.0.133:8080/site/isales/categoryAddAllTo.htm"
+#define  URL_SEARCHADDALL  @"http://192.168.0.133:8080/site/isales/searchAddAllTo.htm"
+#define  URL_ITEMSEARCHADDALL @"http://192.168.0.133:8080/site/isales/itemSearchAddAllTo.htm"
 
 
 
 
-#define  URL_ITEM_DETAIL  @"http://192.168.0.119:8080/site/isales/modelDetail.htm"
+#define  URL_ITEM_DETAIL  @"http://192.168.0.133:8080/site/isales/modelDetail.htm"
 
 
-#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.119:8080/site/isales/addToWishList.htm"
-#define  URL_WATCHLIST  @"http://192.168.0.119:8080/site/isales/wishList.htm"
-#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.119:8080/site/isales/deleteToWishList.htm"
+#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.133:8080/site/isales/addToWishList.htm"
+#define  URL_WATCHLIST  @"http://192.168.0.133:8080/site/isales/wishList.htm"
+#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.133:8080/site/isales/deleteToWishList.htm"
 
 
 
 
 
 
-#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.119:8080/site/isales/addToPortfolio.htm"
-#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.119:8080/site/isales/deleteToPortfolio.htm"
-#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.119:8080/site/isales/deleteTearSheetPdf.htm"
-#define  URL_PORTFOLIO  @"http://192.168.0.119:8080/site/isales/portfolios.htm"
-#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.119:8080/site/isales/setTearSheetPrice.htm"
-#define  URL_DM_PARAMS @"http://192.168.0.119:8080/site/isales/selectTearSheetParam.htm"
-#define  URL_REQUEST_DM @"http://192.168.0.119:8080/site/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM_DIRECT @"http://192.168.0.119:8080/site/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM @"http://192.168.0.119:8080/site/isales/saveTearSheetPdf.htm"
-#define  URL_DM_LIST @"http://192.168.0.119:8080/site/isales/tearSheetPdfList.htm"
-//#define  URL_DM_SET_QTY @"http://192.168.0.119:8080/site/isales/setTearSheetAvailableQty.htm"
-#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.119:8080/site/isales/getTearSheetAvailableQty.htm"
+#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.133:8080/site/isales/addToPortfolio.htm"
+#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.133:8080/site/isales/deleteToPortfolio.htm"
+#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.133:8080/site/isales/deleteTearSheetPdf.htm"
+#define  URL_PORTFOLIO  @"http://192.168.0.133:8080/site/isales/portfolios.htm"
+#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.133:8080/site/isales/setTearSheetPrice.htm"
+#define  URL_DM_PARAMS @"http://192.168.0.133:8080/site/isales/selectTearSheetParam.htm"
+#define  URL_REQUEST_DM @"http://192.168.0.133:8080/site/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM_DIRECT @"http://192.168.0.133:8080/site/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM @"http://192.168.0.133:8080/site/isales/saveTearSheetPdf.htm"
+#define  URL_DM_LIST @"http://192.168.0.133:8080/site/isales/tearSheetPdfList.htm"
+//#define  URL_DM_SET_QTY @"http://192.168.0.133:8080/site/isales/setTearSheetAvailableQty.htm"
+#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.133:8080/site/isales/getTearSheetAvailableQty.htm"
 
 
-#define  URL_CONTACT_LIST  @"http://192.168.0.119:8080/site/isales/getAllContact.htm"
-#define  URL_SHIPTO_LIST  @"http://192.168.0.119:8080/site/isales/getShipToContact.htm"
+#define  URL_CONTACT_LIST  @"http://192.168.0.133:8080/site/isales/getAllContact.htm"
+#define  URL_SHIPTO_LIST  @"http://192.168.0.133:8080/site/isales/getShipToContact.htm"
 
 
-#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.119:8080/site/isales/getAddAddress.htm"
-#define  URL_ADDRESS_SAVE  @"http://192.168.0.119:8080/site/isales/saveAddress.htm"
+#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.133:8080/site/isales/getAddAddress.htm"
+#define  URL_ADDRESS_SAVE  @"http://192.168.0.133:8080/site/isales/saveAddress.htm"
 
 
 
 
-#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.119:8080/site/isales/creditCard.htm"
-#define  URL_CREDITCARD_SAVE  @"http://192.168.0.119:8080/site/isales/saveAddress.htm"
+#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.133:8080/site/isales/creditCard.htm"
+#define  URL_CREDITCARD_SAVE  @"http://192.168.0.133:8080/site/isales/saveAddress.htm"
 
 
 
 
 
 
-#define  URL_CUSTOMER_INFO  @"http://192.168.0.119:8080/site/isales/getCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.119:8080/site/isales/hasPendingOrderByContact.htm"
-#define  URL_NEW_CUSTOMER  @"http://192.168.0.119:8080/site/isales/getAddCustomer.htm"
-#define  URL_EDIT_CUSTOMER  @"http://192.168.0.119:8080/site/isales/getUpdateCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_SAVE  @"http://192.168.0.119:8080/site/isales/saveCustomer.htm"
-#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.119:8080/site/isales/updateCustomer.htm"
-#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.119:8080/site/isales/updateCustomerBusiCard.htm"
+#define  URL_CUSTOMER_INFO  @"http://192.168.0.133:8080/site/isales/getCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.133:8080/site/isales/hasPendingOrderByContact.htm"
+#define  URL_NEW_CUSTOMER  @"http://192.168.0.133:8080/site/isales/getAddCustomer.htm"
+#define  URL_EDIT_CUSTOMER  @"http://192.168.0.133:8080/site/isales/getUpdateCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_SAVE  @"http://192.168.0.133:8080/site/isales/saveCustomer.htm"
+#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.133:8080/site/isales/updateCustomer.htm"
+#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.133:8080/site/isales/updateCustomerBusiCard.htm"
 
 
 
 
 
 
 
 
 
 
 
 
-#define  URL_ERR_LOG  @"http://192.168.0.119:8080/site/isales/er_log.htm"
+#define  URL_ERR_LOG  @"http://192.168.0.133:8080/site/isales/er_log.htm"
 
 
-#define  URL_UPLOAD_IMG  @"http://192.168.0.119:8080/site/isales/uploadImg.htm"
+#define  URL_UPLOAD_IMG  @"http://192.168.0.133:8080/site/isales/uploadImg.htm"
 
 
 
 
-#define  URL_NPD_POLICY  @"http://192.168.0.119:8080/site/isales/generalPolicy.htm"
+#define  URL_NPD_POLICY  @"http://192.168.0.133:8080/site/isales/generalPolicy.htm"
 
 
 
 
-#define  URL_CHECK_OFFLINE  @"http://192.168.0.119:8080/site/offline/initDatas.htm"
-#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.119:8080/site/offline/uploadOfflineData.htm"
+#define  URL_CHECK_OFFLINE  @"http://192.168.0.133:8080/site/offline/initDatas.htm"
+#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.133:8080/site/offline/uploadOfflineData.htm"
 
 
 
 
-#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.119:8080/site/offline/downloadDatas.htm"
-#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.119:8080/site/offline/confirmVersion.htm"
+#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.133:8080/site/offline/downloadDatas.htm"
+#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.133:8080/site/offline/confirmVersion.htm"
 
 
 
 
-#define  URL_GET_RESULT  @"http://192.168.0.119:8080/site/offline/getResultBySerial.htm"
+#define  URL_GET_RESULT  @"http://192.168.0.133:8080/site/offline/getResultBySerial.htm"
 
 
-#define URL_SET_PRICE_TYPE @"http://192.168.0.119:8080/site/isales/setSeePriceType.htm"
+#define URL_SET_PRICE_TYPE @"http://192.168.0.133:8080/site/isales/setSeePriceType.htm"
 
 
-#define URL_GET_CIVEN_PRICE @"http://192.168.0.119:8080/site/isales/getSeeGivenPrice.htm"
+#define URL_GET_CIVEN_PRICE @"http://192.168.0.133:8080/site/isales/getSeeGivenPrice.htm"
 
 
-#define URL_SET_GIVEN_PRICE @"http://192.168.0.119:8080/site/isales/setSeeGivenPrice.htm"
+#define URL_SET_GIVEN_PRICE @"http://192.168.0.133:8080/site/isales/setSeeGivenPrice.htm"
 
 
-#define URL_SET_MERGE_ORDER @"http://192.168.0.119:8080/site/isales/mergeOrder.htm"
+#define URL_SET_MERGE_ORDER @"http://192.168.0.133:8080/site/isales/mergeOrder.htm"
 
 
-#define URL_REQUEST_LOGIN @"http://192.168.0.119:8080/site/isales/requestLogin.htm"
+#define URL_REQUEST_LOGIN @"http://192.168.0.133:8080/site/isales/requestLogin.htm"
 
 
-#define URL_EMAIL_CART @"http://192.168.0.119:8080/site/isales/sendCartEmail.htm"
+#define URL_EMAIL_CART @"http://192.168.0.133:8080/site/isales/sendCartEmail.htm"
 
 
-#define URL_NOTIFY_ME @"http://192.168.0.119:8080/site/isales/notifyMeEmail.htm"
+#define URL_NOTIFY_ME @"http://192.168.0.133:8080/site/isales/notifyMeEmail.htm"
 
 
 #else
 #else