// // <%= @class_name %>Proxy.m // <%= @project_name %> // // Created by <%= @developer.capitalize %> on <%= @created_on %> // Copyright(c) <%= Time.now.year %>, All rights reserved. // #import "<%= @class_name %>Proxy.h" #import "<%= @class_name %>VO.h" @implementation <%= @class_name %>Proxy -(void)initializeProxy { [super initializeProxy]; self.proxyName = [<%= @class_name %>Proxy NAME]; self.data = [NSMutableArray array]; [self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"eiffel" firstName:@"Eiffel" lastName:@"Qiu" email:@"eiffelqiu@gmail.com" password:@"trustno1" confirmPassword:@"trustno1" department:@"IT"]]; [self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"mulder" firstName:@"Fox" lastName:@"Mulder" email:@"f_mulder@fbi.gov" password:@"trustno1" confirmPassword:@"trustno1" department:@"FBI"]]; [self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"scully" firstName:@"Dana" lastName:@"Scully" email:@"d_scully@fbi.gov" password:@"trustno1" confirmPassword:@"trustno1" department:@"FBI"]]; } +(NSString *)NAME { return @"<%= @class_name %>Proxy"; } -(NSMutableArray *)data { return data; } -(void)create:(id)item { [self.data addObject:item]; } -(void)update:(id)item { for (int i=0; i<[self.data count]; i++) { <%= @class_name %>VO *<%= @project_name %>VO = [self.data objectAtIndex:i]; if ([<%= @project_name %>VO.<%= @project_name %>name isEqualToString:[item <%= @project_name %>name]]) { [self.data replaceObjectAtIndex:i withObject:item]; break; } } } -(void)delete:(id)item { for (int i=0; i<[self.data count]; i++) { <%= @class_name %>VO *<%= @project_name %>VO = [self.data objectAtIndex:i]; if ([<%= @project_name %>VO.<%= @project_name %>name isEqualToString:[item <%= @project_name %>name]]) { [self.data removeObjectAtIndex:i]; break; } } } -(void)dealloc { [super dealloc]; } @end