//
//  BaseService.h
//  EAMiPad
//
//  Created by Ram Madichetty on 9/19/12.
//
//

#import <Foundation/Foundation.h>
#import "WebQuery.h"
@interface BaseService : NSObject

typedef enum
{
    DMLTypeAdd,
    DMLTypeModfied,
    DMLTypeDelete
}DMLType;


@property (nonatomic        )   BOOL    rollBackRecord;
@property (nonatomic        )   int     rollBackQueId;

- (BOOL) updateQueueForTable:(NSString *)tableName
                withTableKey:(NSString *)tableKey
                 withDMLType:(DMLType)dmlType
              withParameters:(NSString *)parameters;

- (BOOL) deleteQueue:(NSString *)tableName
        withTableKey:(NSString *)tableKey;
- (NSString *) getSystemParameters:(NSString *)paramValue;

- (id)runRequest:(NSString *)request withObject:(id)object withParameters:(WebQueryParameters *)parameters withError:(NSError **)error;
- (id)runRequest:(NSString *)request withParameters:(WebQueryParameters *)parameters withError:(NSError **)error;

- (NSString *)getParamAndValuesKey:(id)model;
- (NSString *)getTableParamAndValuesKey:(id)model;
- (WebQueryParameters *)getWebQueryParameters:(id)model;

- (void)beginTransaction;
- (BOOL)isTransactionSuccessful;
- (void)commitTransaction;
- (void)rollbackTransaction;

@end
