|
|
@@ -1096,10 +1096,39 @@ static const int totalPage = 3;
|
|
|
// valuestr = [self getValue:valuefrom];
|
|
|
if(true)
|
|
|
{
|
|
|
- if(valuestr.length>0)
|
|
|
- [modify_item setValue:valuestr forKey:@"value"];
|
|
|
- else
|
|
|
+ if(valuestr.length>0) {
|
|
|
+ NSString *control = [modify_item objectForKey:@"control"];
|
|
|
+ if ([control isEqualToString:@"enum"]) {
|
|
|
+ NSMutableDictionary *cadedate = [[modify_item objectForKey:@"cadedate"] mutableCopy];
|
|
|
+ int count = [[cadedate objectForKey:@"count"] intValue];
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ NSString *key = [NSString stringWithFormat:@"val_%d",i];
|
|
|
+ NSMutableDictionary *val = [[cadedate objectForKey:key] mutableCopy];
|
|
|
+ int check = [[val objectForKey:@"check"] intValue];
|
|
|
+ NSString *val_id = [val objectForKey:@"value_id"];
|
|
|
+ NSString *val_value = [val objectForKey:@"value"];
|
|
|
+ // state 通过id判断, country 通过value判断
|
|
|
+ if (check == 1 && (![val_id isEqualToString:valuestr] && ![val_value isEqualToString:valuestr])) {
|
|
|
+ check = 0;
|
|
|
+ [val setObject:@(check) forKey:@"check"];
|
|
|
+ [cadedate setObject:val forKey:key];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ([val_id isEqualToString:valuestr] || [val_value isEqualToString:valuestr]) {
|
|
|
+ check = 1;
|
|
|
+ [val setObject:@(check) forKey:@"check"];
|
|
|
+ [cadedate setObject:val forKey:key];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [modify_item setObject:cadedate forKey:@"cadedate"];
|
|
|
+ } else {
|
|
|
+ [modify_item setValue:valuestr forKey:@"value"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
[modify_item setValue:@"" forKey:@"value"];
|
|
|
+ }
|
|
|
[modify_item setValue:@"true" forKey:@"dirty"];
|
|
|
[section_json setObject:modify_item forKey:[NSString stringWithFormat:@"item_%d",ic ]];
|
|
|
}
|
|
|
@@ -1488,5 +1517,424 @@ static const int totalPage = 3;
|
|
|
self.request_url = [urgencyDic objectForKey:@"request_url"];
|
|
|
}
|
|
|
|
|
|
+-(void) handle_action_return:(NSMutableDictionary *)value indexPath :(NSIndexPath*) indexPath action:(int) action_code
|
|
|
+{
|
|
|
+ DebugLog(@"commoneditor return %ld_%ld",(long)indexPath.section,(long)indexPath.row);
|
|
|
+ NSMutableDictionary* section_json=nil;
|
|
|
+
|
|
|
+ NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
|
+
|
|
|
+ bool is_subaction = [value[@"is_subaction"] boolValue];
|
|
|
+ int subaction_tag= [value[@"subaction_tag"] intValue];
|
|
|
+ [value removeObjectForKey:@"is_subaction"];
|
|
|
+ [value removeObjectForKey:@"subaction_tag"];
|
|
|
+ if(is_subaction)
|
|
|
+ {
|
|
|
+ NSMutableDictionary* sub_action = [[item_json objectForKey:[NSString stringWithFormat:@"item_%d",subaction_tag]] mutableCopy];
|
|
|
+ int refresh = [[sub_action valueForKey:@"refresh"] intValue];
|
|
|
+ NSString* refresh_trigger = [sub_action valueForKey:@"name"];
|
|
|
+ NSDictionary * restore_json=[sub_action objectForKeyedSubscript:@"restore"];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ NSString* subid=[sub_action valueForKey:@"subid"];
|
|
|
+
|
|
|
+ UITableViewCell *cell = [self.editorTable cellForRowAtIndexPath:indexPath];
|
|
|
+
|
|
|
+ NSString* required = [sub_action valueForKey:@"required"];
|
|
|
+ if([required isEqualToString:@"true"] && value.count==0)
|
|
|
+ {
|
|
|
+ CALayer *layer = [cell.contentView layer];
|
|
|
+ // layer.borderColor = [[UIColor redColor] CGColor];
|
|
|
+ // layer.borderWidth = 1.0;
|
|
|
+
|
|
|
+ layer.shadowColor = [UIColor redColor].CGColor;
|
|
|
+ layer.shadowOffset = CGSizeMake(0, 0);
|
|
|
+ layer.shadowOpacity = 1;
|
|
|
+ layer.shadowRadius = 2.0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CALayer *layer = [cell.contentView layer];
|
|
|
+ // layer.borderColor = [[UIColor redColor] CGColor];
|
|
|
+ // layer.borderWidth = 1.0;
|
|
|
+
|
|
|
+ layer.shadowColor = [UIColor clearColor].CGColor;
|
|
|
+ layer.shadowOffset = CGSizeMake(0, 0);
|
|
|
+ layer.shadowOpacity = 1;
|
|
|
+ layer.shadowRadius = 2.0;
|
|
|
+ }
|
|
|
+ if(value.count!=0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(action_code==ACTION_SAVE_DATA)
|
|
|
+ {
|
|
|
+ [sub_action setObject:value forKey:@"data"];
|
|
|
+
|
|
|
+
|
|
|
+ if(subid==nil)
|
|
|
+ {
|
|
|
+ [sub_action setValue:@"true" forKey:@"dirty"];
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
+ int count=0;
|
|
|
+
|
|
|
+ count=[[section_json valueForKey:@"count"] intValue];
|
|
|
+
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
+ {
|
|
|
+ NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]];
|
|
|
+ if([[olditem valueForKey:@"name"] isEqualToString:[sub_action valueForKey:@"name" ]])
|
|
|
+ {
|
|
|
+ // sub_action = [item_json objectForKey:[NSString stringWithFormat:@"item_%d",[value[@"subaction_tag"] intValue]]];
|
|
|
+ [item_json setObject:sub_action forKey:[NSString stringWithFormat:@"item_%d",[value[@"subaction_tag"] intValue]]];
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",i ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ assert(@"not impl");
|
|
|
+ NSArray* idarr=[subid componentsSeparatedByString:@"_"];
|
|
|
+ int section = [(NSString*)idarr[0] intValue];
|
|
|
+ int item=[(NSString*)idarr[1] intValue];
|
|
|
+
|
|
|
+
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d", section]] mutableCopy];
|
|
|
+ NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+ sub_action= [self enum_subitem_changed:[olditem mutableCopy] subid:idarr value:sub_action step:2];
|
|
|
+ [sub_action setValue:@"true" forKey:@"dirty"];
|
|
|
+
|
|
|
+ [item_json setObject:sub_action forKey:[NSString stringWithFormat:@"item_%d",[value[@"subaction_tag"] intValue]]];
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(action_code==ACTION_FILL_SECTION)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(subid==nil)
|
|
|
+ {
|
|
|
+ NSDictionary* jsonmap=[sub_action valueForKey:@"key_map"];
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
+ int icount=[[section_json valueForKey:@"count"] intValue];
|
|
|
+ for (int ic=0;ic<icount;ic++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary* modify_item= [[section_json objectForKey:[NSString stringWithFormat:@"item_%d",ic ]] mutableCopy];
|
|
|
+
|
|
|
+ NSString* valuefrom= [jsonmap valueForKey:[modify_item valueForKey:@"name"]];
|
|
|
+
|
|
|
+ NSString* valuestr= [value valueForKey:valuefrom];
|
|
|
+
|
|
|
+ if(valuestr !=nil)
|
|
|
+ {
|
|
|
+ // 2018-01-19 Place Order Select Ship To未刷新State Enum
|
|
|
+ NSString *control = [modify_item objectForKey:@"control"];
|
|
|
+ if ([control isEqualToString:@"enum"]) {
|
|
|
+ NSMutableDictionary *cadedate = [[modify_item objectForKey:@"cadedate"] mutableCopy];
|
|
|
+ int count = [[cadedate objectForKey:@"count"] intValue];
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ NSString *key = [NSString stringWithFormat:@"val_%d",i];
|
|
|
+ NSMutableDictionary *val = [[cadedate objectForKey:key] mutableCopy];
|
|
|
+ int check = [[val objectForKey:@"check"] intValue];
|
|
|
+ NSString *val_id = [val objectForKey:@"value_id"];
|
|
|
+ NSString *val_value = [val objectForKey:@"value"];
|
|
|
+ // state 通过id判断, country 通过value判断
|
|
|
+ if (check == 1 && (![val_id isEqualToString:valuestr] && ![val_value isEqualToString:valuestr])) {
|
|
|
+ check = 0;
|
|
|
+ [val setObject:@(check) forKey:@"check"];
|
|
|
+ [cadedate setObject:val forKey:key];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ([val_id isEqualToString:valuestr] || [val_value isEqualToString:valuestr]) {
|
|
|
+ check = 1;
|
|
|
+ [val setObject:@(check) forKey:@"check"];
|
|
|
+ [cadedate setObject:val forKey:key];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [modify_item setObject:cadedate forKey:@"cadedate"];
|
|
|
+ } else {
|
|
|
+ [modify_item setValue:valuestr forKey:@"value"];
|
|
|
+ }
|
|
|
+
|
|
|
+ // [modify_item setValue:valuestr forKey:@"value"];
|
|
|
+
|
|
|
+ [modify_item setValue:@"true" forKey:@"dirty"];
|
|
|
+ [section_json setObject:modify_item forKey:[NSString stringWithFormat:@"item_%d",ic ]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ NSArray* idarr=[subid componentsSeparatedByString:@"_"];
|
|
|
+ int section = [(NSString*)idarr[0] intValue];
|
|
|
+ int item=[(NSString*)idarr[1] intValue];
|
|
|
+ NSDictionary* jsonmap=[sub_action valueForKey:@"key_map"];
|
|
|
+
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d", section]] mutableCopy];
|
|
|
+ NSMutableDictionary * olditem=[[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]] mutableCopy];
|
|
|
+ NSMutableDictionary* olditem_sub_action = [[olditem objectForKey:[NSString stringWithFormat:@"item_%d",subaction_tag]] mutableCopy];
|
|
|
+
|
|
|
+ olditem_sub_action= [self fill_switch_subitem:olditem subid:nil source:value mapping:jsonmap ];
|
|
|
+
|
|
|
+
|
|
|
+ [olditem_sub_action setValue:@"true" forKey:@"dirty"];
|
|
|
+ [olditem setObject:olditem_sub_action forKey:[NSString stringWithFormat:@"item_%d",[value[@"subaction_tag"] intValue]]];
|
|
|
+ [section_json setObject:olditem forKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // [section_json setObject:sub_action forKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row ]];
|
|
|
+
|
|
|
+ [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ DebugLog(@"CONTENT UPDATE:%@",[RAConvertor DataTOjsonString:self.content_data_download]);
|
|
|
+ self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(refresh==1)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(restore_json!=nil)
|
|
|
+ {
|
|
|
+ int rc=[[restore_json valueForKey:@"count"] intValue];
|
|
|
+ for(int ir=0;ir<rc;ir++)
|
|
|
+ {
|
|
|
+ NSString* name = [restore_json valueForKey:[NSString stringWithFormat:@"item_%d",ir]];
|
|
|
+
|
|
|
+
|
|
|
+ int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
|
|
|
+ for(int i=0;i<section_count;i++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
|
|
|
+ // NSMutableDictionary * to_sectionjson = [[to objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
|
|
|
+ int item_count = [[sectionjson valueForKey:@"count"] intValue];
|
|
|
+ for(int j=0;j<item_count;j++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
+ // NSMutableDictionary * to_itemjson=[[to_sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
+
|
|
|
+ if([[itemjson valueForKey:@"name"] isEqualToString:name])
|
|
|
+ {
|
|
|
+ [itemjson removeObjectForKey:@"dirty"];
|
|
|
+ [sectionjson setObject:itemjson forKey:[NSString stringWithFormat:@"item_%d",j ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [self.content_data_download setObject:sectionjson forKey:[NSString stringWithFormat:@"section_%d",i ]];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // DebugLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
|
|
|
+ [self.editorTable reloadData ];
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
+ NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
+ NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ NSString* subid=[item_json valueForKey:@"subid"];
|
|
|
+
|
|
|
+ UITableViewCell *cell = [self.editorTable cellForRowAtIndexPath:indexPath];
|
|
|
+
|
|
|
+ NSString* required = [item_json valueForKey:@"required"];
|
|
|
+ if([required isEqualToString:@"true"] && value.count==0)
|
|
|
+ {
|
|
|
+ CALayer *layer = [cell.contentView layer];
|
|
|
+ // layer.borderColor = [[UIColor redColor] CGColor];
|
|
|
+ // layer.borderWidth = 1.0;
|
|
|
+
|
|
|
+ layer.shadowColor = [UIColor redColor].CGColor;
|
|
|
+ layer.shadowOffset = CGSizeMake(0, 0);
|
|
|
+ layer.shadowOpacity = 1;
|
|
|
+ layer.shadowRadius = 2.0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CALayer *layer = [cell.contentView layer];
|
|
|
+ // layer.borderColor = [[UIColor redColor] CGColor];
|
|
|
+ // layer.borderWidth = 1.0;
|
|
|
+
|
|
|
+ layer.shadowColor = [UIColor clearColor].CGColor;
|
|
|
+ layer.shadowOffset = CGSizeMake(0, 0);
|
|
|
+ layer.shadowOpacity = 1;
|
|
|
+ layer.shadowRadius = 2.0;
|
|
|
+ }
|
|
|
+ if(value.count!=0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(action_code==ACTION_SAVE_DATA)
|
|
|
+ {
|
|
|
+ [item_json setObject:value forKey:@"data"];
|
|
|
+
|
|
|
+
|
|
|
+ if(subid==nil)
|
|
|
+ {
|
|
|
+ [item_json setValue:@"true" forKey:@"dirty"];
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
+ int count=0;
|
|
|
+
|
|
|
+ count=[[section_json valueForKey:@"count"] intValue];
|
|
|
+
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
+ {
|
|
|
+ NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]];
|
|
|
+ if([[olditem valueForKey:@"name"] isEqualToString:[item_json valueForKey:@"name" ]])
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",i ]];
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ assert(@"not impl");
|
|
|
+ NSArray* idarr=[subid componentsSeparatedByString:@"_"];
|
|
|
+ int section = [(NSString*)idarr[0] intValue];
|
|
|
+ int item=[(NSString*)idarr[1] intValue];
|
|
|
+
|
|
|
+
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d", section]] mutableCopy];
|
|
|
+ NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+ item_json= [self enum_subitem_changed:[olditem mutableCopy] subid:idarr value:item_json step:2];
|
|
|
+ [item_json setValue:@"true" forKey:@"dirty"];
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(action_code==ACTION_FILL_SECTION)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(subid==nil)
|
|
|
+ {
|
|
|
+ NSDictionary* jsonmap=[item_json valueForKey:@"key_map"];
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
+ int icount=[[section_json valueForKey:@"count"] intValue];
|
|
|
+ for (int ic=0;ic<icount;ic++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary* modify_item= [[section_json objectForKey:[NSString stringWithFormat:@"item_%d",ic ]] mutableCopy];
|
|
|
+
|
|
|
+ NSString* valuefrom= [jsonmap valueForKey:[modify_item valueForKey:@"name"]];
|
|
|
+
|
|
|
+ NSString* valuestr= [value valueForKey:valuefrom];
|
|
|
+
|
|
|
+ if(valuestr !=nil)
|
|
|
+ {
|
|
|
+
|
|
|
+ [modify_item setValue:valuestr forKey:@"value"];
|
|
|
+
|
|
|
+ [modify_item setValue:@"true" forKey:@"dirty"];
|
|
|
+ [section_json setObject:modify_item forKey:[NSString stringWithFormat:@"item_%d",ic ]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ NSArray* idarr=[subid componentsSeparatedByString:@"_"];
|
|
|
+ int section = [(NSString*)idarr[0] intValue];
|
|
|
+ int item=[(NSString*)idarr[1] intValue];
|
|
|
+ NSDictionary* jsonmap=[item_json valueForKey:@"key_map"];
|
|
|
+
|
|
|
+ section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d", section]] mutableCopy];
|
|
|
+ NSMutableDictionary * olditem=[[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]] mutableCopy];
|
|
|
+
|
|
|
+ olditem= [self fill_switch_subitem:olditem subid:nil source:value mapping:jsonmap ];
|
|
|
+
|
|
|
+
|
|
|
+ [olditem setValue:@"true" forKey:@"dirty"];
|
|
|
+ [section_json setObject:olditem forKey:[NSString stringWithFormat:@"item_%d",item ]];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row ]];
|
|
|
+
|
|
|
+ [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ DebugLog(@"CONTENT UPDATE:%@",[RAConvertor DataTOjsonString:self.content_data_download]);
|
|
|
+ self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(refresh==1)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(restore_json!=nil)
|
|
|
+ {
|
|
|
+ int rc=[[restore_json valueForKey:@"count"] intValue];
|
|
|
+ for(int ir=0;ir<rc;ir++)
|
|
|
+ {
|
|
|
+ NSString* name = [restore_json valueForKey:[NSString stringWithFormat:@"item_%d",ir]];
|
|
|
+
|
|
|
+
|
|
|
+ int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
|
|
|
+ for(int i=0;i<section_count;i++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
|
|
|
+ // NSMutableDictionary * to_sectionjson = [[to objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
|
|
|
+ int item_count = [[sectionjson valueForKey:@"count"] intValue];
|
|
|
+ for(int j=0;j<item_count;j++)
|
|
|
+ {
|
|
|
+ NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
+ // NSMutableDictionary * to_itemjson=[[to_sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
+
|
|
|
+ if([[itemjson valueForKey:@"name"] isEqualToString:name])
|
|
|
+ {
|
|
|
+ [itemjson removeObjectForKey:@"dirty"];
|
|
|
+ [sectionjson setObject:itemjson forKey:[NSString stringWithFormat:@"item_%d",j ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [self.content_data_download setObject:sectionjson forKey:[NSString stringWithFormat:@"section_%d",i ]];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // DebugLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
|
|
|
+ [self.editorTable reloadData ];
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
@end
|