Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <UIKit/UIKit.h>
- @interface Dataoperation : UIViewController {
- }
- +(NSMutableArray *) getData : (NSString *) actionType : (NSMutableDictionary *) data;
- -(NSString *)setDBINPUTFormate:(NSString *) tmpstr ;
- @end
- - (void)viewDidLoad {
- [super viewDidLoad];
- }
- +(NSMutableArray *) getData : (NSString *) actionType : (NSMutableDictionary *) data
- {
- NSString *sql;
- NSMutableArray *db_result=[[NSMutableArray alloc] init];
- if([actionType isEqualToString:@"Customer"] )
- {
- //NSLog(@"hii");
- sql=[NSString stringWithFormat:@"Select * from CustomerTable"];
- //NSLog(@"%@",sql);
- db_result=[DBOperation selectData:sql];
- //NSLog(@"%@",[db_result description]);
- }
- else if ([actionType isEqualToString:@"Customer2"]) {
- NSLog(@"SaveOrderInfo %@",[data description]);
- NSMutableDictionary *tmp_dict = [[NSMutableDictionary alloc] init];
- sql=[NSString stringWithFormat:@"Update SalesHeaderLookup set No_of_products='%@',Description='%@',Amount='%@' where rowid='%@'",
- [data valueForKey:@"No_of_products"],
- [data valueForKey:@"Description"],
- [data valueForKey:@"Amount"],
- [data valueForKey:@"rowid"]
- ];
- BOOL flag;
- flag=[DBOperation executeSQL:sql];
- if (flag) {
- [tmp_dict setObject:@"1" forKey:@"success"];
- [db_result addObject:tmp_dict];
- [tmp_dict release];
- }
- else {
- [tmp_dict setObject:@"0" forKey:@"Error"];
- [db_result addObject:tmp_dict];
- [tmp_dict release];
- }
- }
- return db_result;
- }
Advertisement
Add Comment
Please, Sign In to add comment