|
|
@@ -1596,7 +1596,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username from offline_login where lower(username)='%@' and password='%@'",user.lowercaseString ,[AESCrypt encrypt:password password:@"usai"]];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username,can_update_contact_info from offline_login where lower(username)='%@' and password='%@'",user.lowercaseString ,[AESCrypt encrypt:password password:@"usai"]];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1620,6 +1620,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
int can_show_price = sqlite3_column_int(statement, 0);
|
|
|
int can_see_price = sqlite3_column_int(statement, 1);
|
|
|
|
|
|
@@ -1650,6 +1651,8 @@
|
|
|
username="";
|
|
|
NSString *nsusername= [[NSString alloc]initWithUTF8String:username];
|
|
|
|
|
|
+ int can_update_contact_info = sqlite3_column_int(statement, 13);
|
|
|
+
|
|
|
|
|
|
[header setValue:[NSNumber numberWithBool:can_show_price] forKey:@"can_show_price"];
|
|
|
[header setValue:[NSNumber numberWithBool:can_see_price] forKey:@"can_see_price"];
|
|
|
@@ -1663,6 +1666,8 @@
|
|
|
[header setValue:[NSNumber numberWithBool:can_set_tearsheet_price] forKey:@"can_set_tearsheet_price"];
|
|
|
[header setValue:[NSNumber numberWithBool:can_create_order] forKey:@"can_create_order"];
|
|
|
|
|
|
+ [header setValue:[NSNumber numberWithBool:can_update_contact_info] forKey:@"can_update_contact_info"];
|
|
|
+
|
|
|
[header setValue:nsusername forKey:@"username"];
|
|
|
|
|
|
|
|
|
@@ -2102,7 +2107,7 @@
|
|
|
|
|
|
if(keyword.length==0)
|
|
|
{
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@=1 order by create_time limit %d offset %d",contactType , limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@=1 order by decrypt(company_name) limit %d offset %d",contactType , limit, offset];
|
|
|
count=[iSalesDB get_recordcount:db table:@"offline_contact" where:[NSString stringWithFormat:@"%@='1",contactType]];
|
|
|
}
|
|
|
else
|
|
|
@@ -2112,7 +2117,7 @@
|
|
|
keyword = keyword.lowercaseString;
|
|
|
|
|
|
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@=1 and (lower(contact_id ) like'%%%@%%' or lower(decrypt(company_name)) like '%%%@%%') order by create_time limit %d offset %d",contactType , keyword,keyword,limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@=1 and (lower(contact_id ) like'%%%@%%' or lower(decrypt(company_name)) like '%%%@%%') order by decrypt(company_name) limit %d offset %d",contactType , keyword,keyword,limit, offset];
|
|
|
|
|
|
count=[iSalesDB get_recordcount:db table:@"offline_contact" where:[NSString stringWithFormat:@"%@=1 and (lower(contact_id ) like'%@' or lower(company_name) like'%@')",contactType,keyword,keyword]];
|
|
|
}
|
|
|
@@ -2138,7 +2143,7 @@
|
|
|
NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
|
|
|
|
|
|
|
|
|
- // int editable = sqlite3_column_int(statement, 0);
|
|
|
+ int editable = sqlite3_column_int(statement, 0);
|
|
|
|
|
|
|
|
|
char *company_name = (char*)sqlite3_column_text(statement, 1);
|
|
|
@@ -2297,7 +2302,7 @@
|
|
|
|
|
|
[item setValue:name forKey:@"name"];
|
|
|
[item setValue:nscontact_id forKey:@"contact_id"];
|
|
|
-
|
|
|
+ [item setValue:editable==1?@"true":@"false" forKey:@"can_update"];
|
|
|
[ret setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
i++;
|
|
|
|
|
|
@@ -3071,7 +3076,10 @@
|
|
|
{
|
|
|
return nil;
|
|
|
}
|
|
|
-
|
|
|
++(NSData *) offline_editContact:(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+ return nil;
|
|
|
+}
|
|
|
+ (NSData *)offline_createContact:(NSMutableDictionary *)params {
|
|
|
|
|
|
NSString *path = [[NSBundle mainBundle] pathForResource:@"createContact.json" ofType:nil];
|