Преглед изворни кода

新增ERP Mobile 首页数据访问接口。
新增ERP Mobile category数据访问接口。
新增ERP Mobile category 列表数据访问接口。
Apex Mobile release 2.82

Ray Zhang пре 6 година
родитељ
комит
8f21971403

+ 4 - 4
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -1791,7 +1791,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 200203;
+				CURRENT_PROJECT_VERSION = 200227;
 				DEVELOPMENT_TEAM = "";
 				DEVELOPMENT_TEAM = "";
 				ENABLE_BITCODE = YES;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1807,7 +1807,7 @@
 				HEADER_SEARCH_PATHS = "";
 				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_FILE = "Apex Mobile/Apex Mobile-Info.plist";
 				INFOPLIST_FILE = "Apex Mobile/Apex Mobile-Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
-				MARKETING_VERSION = 2.81;
+				MARKETING_VERSION = 2.82;
 				OTHER_LDFLAGS = "-ObjC";
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1830,7 +1830,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Distribution";
 				CODE_SIGN_IDENTITY = "iPhone Distribution";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 200203;
+				CURRENT_PROJECT_VERSION = 200227;
 				DEVELOPMENT_TEAM = "";
 				DEVELOPMENT_TEAM = "";
 				ENABLE_BITCODE = YES;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1842,7 +1842,7 @@
 				HEADER_SEARCH_PATHS = "";
 				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_FILE = "Apex Mobile/Apex Mobile-Info.plist";
 				INFOPLIST_FILE = "Apex Mobile/Apex Mobile-Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
-				MARKETING_VERSION = 2.81;
+				MARKETING_VERSION = 2.82;
 				OTHER_LDFLAGS = "-ObjC";
 				OTHER_LDFLAGS = "-ObjC";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 3 - 3
RedAnt ERP Mobile/common/ERP_Mobile_Model.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
     <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
     <dependencies>
         <deployment identifier="iOS"/>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
@@ -812,7 +812,7 @@
         <image name="btn_addtocart_large" width="124" height="39"/>
         <image name="btn_addtocart_large" width="124" height="39"/>
         <image name="btn_addtoportfolio" width="124" height="39"/>
         <image name="btn_addtoportfolio" width="124" height="39"/>
         <image name="btn_addtowish" width="124" height="39"/>
         <image name="btn_addtowish" width="124" height="39"/>
-        <image name="close" width="32" height="32"/>
+        <image name="close" width="40" height="40"/>
         <image name="hangtag" width="30" height="30"/>
         <image name="hangtag" width="30" height="30"/>
         <image name="notifyMe" width="124" height="39"/>
         <image name="notifyMe" width="124" height="39"/>
         <image name="select" width="32" height="32"/>
         <image name="select" width="32" height="32"/>

+ 63 - 25
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -597,6 +597,16 @@
     //    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     //    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     if(appDelegate.categoryMenu==nil)
     if(appDelegate.categoryMenu==nil)
     {
     {
+        
+        [RANetwork request_category:^(NSMutableDictionary *result) {
+            NSDictionary* category=result;
+            if([[category valueForKey:@"result"] intValue]==2)
+            {
+                appDelegate.categoryMenu = category;
+            }
+        }];
+        return;
+        
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             
             
             
@@ -933,7 +943,14 @@
 {
 {
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     
-    
+    [RANetwork request_category:^(NSMutableDictionary *result) {
+        NSDictionary* category=result;
+        if([[category valueForKey:@"result"] intValue]==2)
+        {
+            appDelegate.categoryMenu = category;
+        }
+    }];
+    return;
     
     
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         
@@ -1511,32 +1528,53 @@
     UIApplication * app = [UIApplication sharedApplication];
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     if(appDelegate.categoryMenu == nil)
     if(appDelegate.categoryMenu == nil)
-        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;
-                    [categorymenuVC SetMenu:appDelegate.categoryMenu ];
-                }
-                else
-                    if([[category valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
-                    {
-                        [categorymenuVC SetMenu:nil ];
-                    }
-                else
+    {
+        [RANetwork request_category:^(NSMutableDictionary *result) {
+            NSDictionary* category=result;
+            if([[category valueForKey:@"result"] intValue]==2)
+            {
+                appDelegate.categoryMenu = category;
+                [categorymenuVC SetMenu:appDelegate.categoryMenu ];
+            }
+            else
+                if([[category valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
                 {
                 {
-                    [RAUtils message_alert:[category valueForKey:@"err_msg"]  title:@"Load Category Menu" controller:self] ;
+                    [categorymenuVC SetMenu:nil ];
                 }
                 }
-                
-                
-                
-            });
-        });
+            else
+            {
+                [RAUtils message_alert:[category valueForKey:@"err_msg"]  title:@"Load Category Menu" controller:self] ;
+            }
+        }];
+        return;
+        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;
+                           [categorymenuVC SetMenu:appDelegate.categoryMenu ];
+                       }
+                       else
+                           if([[category valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
+                           {
+                               [categorymenuVC SetMenu:nil ];
+                           }
+                       else
+                       {
+                           [RAUtils message_alert:[category valueForKey:@"err_msg"]  title:@"Load Category Menu" controller:self] ;
+                       }
+                       
+                       
+                       
+                   });
+               });
+    }
+       
     else
     else
         [categorymenuVC SetMenu:appDelegate.categoryMenu];
         [categorymenuVC SetMenu:appDelegate.categoryMenu];
 }
 }

+ 96 - 0
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -1053,6 +1053,62 @@
         self.mum.center = self.view.center;
         self.mum.center = self.view.center;
 
 
         self.isrefreshing=true;
         self.isrefreshing=true;
+        
+        [RANetwork request_categorylist: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 completionHandler:^(NSMutableDictionary *result) {
+            NSMutableDictionary* category_more = result;
+            
+            [self.mum stopAnimating];
+            self.isrefreshing=false;
+            if (self.dataOperationQueue.operationCount > 1) {
+                return ;
+            }
+            
+            NSDictionary* more_items=[category_more objectForKey:@"items"];
+            if([[category_more valueForKey:@"result"] intValue]==2)
+            {
+                //  self.category_data = category_data;
+                NSMutableDictionary* items_json= [[self.category_data objectForKey:@"items"] mutableCopy];
+                
+                int count =[[more_items valueForKey:@"count"] intValue];
+                for(int i=0;i<count;i++)
+                {
+                    
+                    NSDictionary * item_json = [more_items objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+                    [items_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",i+self.offset]];
+                    
+                    
+                }
+                long newcount=[[[self.category_data objectForKey:@"items"] valueForKey:@"count"] intValue]+count;
+                [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
+                [self.category_data setObject:items_json forKey:@"items"];
+                self.offset+=count;
+                
+                if(count<20)
+                {
+                    self.loadall=true;
+                    
+                }
+                //            NSDictionary * item_json = [self.category_data objectForKey:@"items"];
+                
+                
+                
+                
+                //   DebugLog(@"%@",self.category_data);
+                
+                [self.collectionview reloadData];
+                
+            }
+            else
+            {
+                [RAUtils message_alert:[category_more valueForKey:@"err_msg"] title:@"Loading Category" controller:self] ;
+            }
+            //                self.isrefreshing=false;
+            
+            
+        }];
+        
+        return;
+        
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             
             NSDictionary* category_more=[RANetwork Category: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] ;
             NSDictionary* category_more=[RANetwork Category: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] ;
@@ -1161,6 +1217,46 @@
             
             
             //        self.collectionview.userInteractionEnabled = false;
             //        self.collectionview.userInteractionEnabled = false;
             
             
+            [RANetwork request_categorylist:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:0 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 completionHandler:^(NSMutableDictionary *result) {
+                NSMutableDictionary* category_data = result;
+                [self.mum stopAnimating];
+                self.isrefreshing=false;
+                if (self.dataOperationQueue.operationCount > 1) {
+                    return ;
+                }
+                
+                //                self.collectionview.userInteractionEnabled = true;
+                self.category_data = [category_data mutableCopy];
+                [self.collectionview reloadData];
+                if([[category_data valueForKey:@"result"] intValue]==2)
+                {
+                    
+                    self.collectionview.hidden=false;
+                    NSDictionary * item_json = [self.category_data objectForKey:@"items"];
+                    self.offset =[[item_json valueForKey:@"count"] intValue];
+                    
+                    int total = [[self.category_data valueForKey:@"item_total_count"]intValue];
+                    
+                    if(total<2)
+                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d item",total];
+                    else
+                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d items",total];
+                    
+                }
+                else if([[category_data valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
+                {
+                    self.collectionview.hidden=true;
+                    self.label_net_err.hidden=false;
+                }
+                else
+                {
+                    [RAUtils message_alert:[category_data valueForKey:@"err_msg"]  title:@"Loading Category" controller:self] ;
+                }
+                
+            }];
+            
+            return;
+            
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 
                 NSDictionary* category_data=[RANetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:0 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];
                 NSDictionary* category_data=[RANetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:0 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];

+ 28 - 0
RedAnt ERP Mobile/common/Functions/home/HomeViewController.m

@@ -105,6 +105,34 @@
         self.label_net_err.hidden=true;
         self.label_net_err.hidden=true;
         
         
         self.homeTable.hidden=true;
         self.homeTable.hidden=true;
+        
+        
+        [RANetwork request_home:0 customid:0 completionHandler:^(NSMutableDictionary *result) {
+            [self.mum stopAnimating];
+            NSMutableDictionary* data=result;
+            self.content = data;
+            [self.homeTable reloadData];
+            self.homeTable.hidden=false;
+            if([[data valueForKey:@"result"] intValue]==2)
+            {
+                DebugLog(@"HOMEVIEW JSON LOADED!");
+                
+            }
+            else
+                if([[data valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
+                {
+                    self.label_net_err.hidden=false;
+                }
+                else
+                {
+                    [RAUtils message_alert:[data valueForKey:@"err_msg"] title:@"Loading Home" controller:self] ;
+                }
+            
+            self.isrefreshing=false;
+            
+            ;
+        }];
+        return;
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             
             
             

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

@@ -58,6 +58,26 @@
         UIApplication * app = [UIApplication sharedApplication];
         UIApplication * app = [UIApplication sharedApplication];
     
     
       AppDelegate *appDelegate = (AppDelegate *)[app delegate];
       AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    
+    
+    [RANetwork request_category:^(NSMutableDictionary *result) {
+        NSDictionary* category=result;
+        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] ;
+            }
+    }];
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         
         
         
@@ -351,6 +371,28 @@
     UIApplication * app = [UIApplication sharedApplication];
     UIApplication * app = [UIApplication sharedApplication];
     
     
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    
+    
+    [RANetwork request_category:^(NSMutableDictionary *result) {
+        NSDictionary* category=result;
+        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] ;
+            }
+    }];
+    
+    return;
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         
         
         

+ 6 - 0
RedAnt ERP Mobile/common/data_provider/RANetwork.h

@@ -187,4 +187,10 @@ extern NSString *const ScreenCodeOfflineSync;
 
 
 + (NSDictionary*)request_hangTag:(NSString *)group;
 + (NSDictionary*)request_hangTag:(NSString *)group;
 
 
+
+#pragma mark 2020 new interface
+// 新接口逐步替换以前的网络请求,2020
++(void)request_home:(int) price_template customid:(int) customid completionHandler:(resultHandler)result;
++(void)request_category:(resultHandler)result;
++(void)request_categorylist: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword  offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip  completionHandler:(resultHandler)result;
 @end
 @end

+ 178 - 3
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -56,12 +56,12 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
 
 
 +(NSMutableDictionary*) prepare_addtional_params:(NSMutableDictionary* ) params
 +(NSMutableDictionary*) prepare_addtional_params:(NSMutableDictionary* ) params
 {
 {
-        __block AppDelegate *appDelegate = nil;
+        AppDelegate *appDelegate = nil;
     
     
-    dispatch_sync(dispatch_get_main_queue(), ^{
+
         //some UI methods ej
         //some UI methods ej
         appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
         appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-    });
+
 //    if(appDelegate.user!=nil)
 //    if(appDelegate.user!=nil)
 //        [params setValue:[AESCrypt AES128Encrypt:appDelegate.user key:@"usai"] forKey:@"user"];
 //        [params setValue:[AESCrypt AES128Encrypt:appDelegate.user key:@"usai"] forKey:@"user"];
 //    if(appDelegate.password!=nil)
 //    if(appDelegate.password!=nil)
@@ -4972,4 +4972,179 @@ repeat:
 #endif
 #endif
 }
 }
 
 
+
+
+#pragma mark 2020 new interface
+// 新接口逐步替换以前的网络请求,2020
+
++(void)request_home:(int) price_template customid:(int) customid completionHandler:(resultHandler)result
+{
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = nil;
+    
+    
+    //some UI methods ej
+    appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    if(appDelegate.contact_id!=nil)
+        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    [params setValue:[NSString stringWithFormat:@"%d",price_template]  forKey:@"price_template"];
+    [params setValue:[NSString stringWithFormat:@"%d",customid]  forKey:@"custom_id"];
+    
+    [params setObject:ScreenCodeHomeView forKey:kScreenName];
+    
+    //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.offline_mode)
+    {
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSMutableDictionary* json = [[OLDataProvider offline_home] mutableCopy];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                result(json);
+            });
+        });
+        
+        return;
+    }
+    
+    
+    [self request_interface:URL_LOAD_HOME parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    return;
+    
+}
+
+
++(void)request_category:(resultHandler)result
+{
+    // DebugLog(@"@@@@@@@@@@@@@@@@@@@LOADING CATEGORY MENU");
+    
+    
+    AppDelegate *appDelegate = nil;
+    
+
+        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.offline_mode)
+    {
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSMutableDictionary* json = [[OLDataProvider offline_category_menu] mutableCopy];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                result(json);
+            });
+        });
+        
+        return;
+
+    }
+    [self request_interface:URL_REQUEST_CATMENU parameters:[NSMutableDictionary new] err_record_url:nil completionHandler:result retry:0];
+    
+//
+//    if(![self IsNetworkAvailable])
+//    {
+//        DebugLog(@"NET ERR");
+//
+//        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+//        //        return nil;
+//    }
+//
+//    NSData* json=[self get_json:URL_REQUEST_CATMENU parameters:nil];
+//    //if(json==nil)
+//
+//
+//    if(json==nil)
+//        return nil;
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    return jsobj;
+}
++(void)request_categorylist: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword  offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip  completionHandler:(resultHandler)result
+{
+    
+    
+     AppDelegate *appDelegate = nil;
+    
+
+        //some UI methods ej
+        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
+
+    
+    
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    if(appDelegate.contact_id!=nil)
+        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    if(appDelegate.order_code!=nil)
+        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+    [params setValue:alert forKey:@"alert"];
+    [params setValue:qty forKey:@"sold_by_qty"];
+    [params setValue:available forKey:@"available"];
+    [params setValue:price forKey:@"price"];
+    [params setValue:bestseller forKey:@"bestseller"];
+    [params setValue:modelname forKey:@"modelName"];
+    [params setValue:modeldescrip forKey:@"modelDescription"];
+    
+    [params setValue:[NSString stringWithFormat:@"%d",price_template]  forKey:@"price_template"];
+    [params setValue:[NSString stringWithFormat:@"%d",customid]  forKey:@"custom_id"];
+    [params setValue:category  forKey:@"category"];
+    [params setValue:[NSString stringWithFormat:@"%d",sort_by]  forKey:@"sort_by"];
+    [params setValue:[NSString stringWithFormat:@"%d",sort_by]  forKey:@"sort_by"];
+    [params setValue:[NSString stringWithFormat:@"%ld",limit]  forKey:@"limit"];
+    [params setValue:[NSString stringWithFormat:@"%ld",offset]  forKey:@"offset"];
+    [params setValue:filter forKey:@"filter"];
+    [params setValue:keyword forKey:@"keyword"];
+    
+    [params setObject:ScreenCodeCategory forKey:kScreenName];
+    if (alert) {
+        [params setObject:@"Filter" forKey:kAction];
+    }
+    if ([Singleton sharedInstance].homeItemClick) {
+        [params setObject:@"Brow A Particular Category On Home" forKey:kAction];
+        [Singleton sharedInstance].homeItemClick = NO;
+        
+        NSDictionary *extra = @{@"CoverName" : [Singleton sharedInstance].homeClickedItemName};
+        [Singleton sharedInstance].homeClickedItemName = nil;
+        [params setObject:extra forKey:kExtra];
+
+    }
+    
+    
+        if(appDelegate.offline_mode)
+        {
+                    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                NSMutableDictionary* json = [[OLDataProvider offline_category:params] mutableCopy];
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    result(json);
+                });
+            });
+            
+            return;
+
+        }
+        [self request_interface:URL_CATEGORY parameters:params err_record_url:nil completionHandler:result retry:0];
+        
+        return ;
+    
+    
+//
+//    if(![self IsNetworkAvailable])
+//        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+//
+//    NSData* json=[self get_json:URL_CATEGORY parameters:params];
+//    if(json==nil)
+//        return nil;
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    return jsobj;
+//
+}
 @end
 @end