//
//  OperatorChecklistDataController.h
//  EAMiPadConnected
//
//  Created by Sreelakshmi Mereddy on 9/27/16.
//
//

#import "RecordDataController.h"
#import "R5OPERATORACTCHECKLISTS.h"
#import "R5OPERATORCHECKLISTS.h"
#import "LOVData.h"
#import "PickerData.h"
@class EAMAppDelegate;
@protocol OperatorChecklistDataControllerDelegate

- (void)OperatorChecklistDataControllerGetDefaultSuccess:(NSArray *)items withHeader:(NSDictionary *)header;
- (void)OperatorChecklistDataControllerGetSuccess:(NSArray *)items withHeader:(NSDictionary *)header;
- (void)OperatorChecklistDataControllerJobGetSuccess:(NSInteger *)mJobCount;
- (void)OperatorChecklistDataControllerAddSuccess:(NSArray *)items withHeader:(NSDictionary *)header;
- (void)OperatorChecklistDataControllerUpdateSuccess:(NSDictionary *)data;
- (void)OperatorChecklistDataControllerFailed:(NSString *)fault;
- (void)OperatorChecklistDataControllerPerformedSuccess:(NSDictionary *)data;
- (void)OperatorChecklistDataControllerReviewedSuccess:(NSDictionary *)data;
- (void)OperatorChecklistDataControllerCreateFollowUpSuccess:(NSDictionary *)data;
- (void)OperatorChecklistDataControllerCompleteChecklistSuccess:(NSArray *)items withHeader:(NSDictionary *)header;
- (void)OperatorChecklistDataControllerCancelChecklistSuccess:(NSArray *)items withHeader:(NSDictionary *)header;
- (void)OperatorChecklistDataControllerGetEquipmentDepartmentSuccess:(NSString *)department;
@end

@interface OperatorChecklistDataController : RecordDataController

@property (nonatomic,weak) id delegate;
@property (nonatomic,strong,readonly) NSString *workOrder;
@property (nonatomic,strong,readonly) NSString *organization;
@property (nonatomic,strong) NSString *activity;
@property (nonatomic,strong) NSString *mSelectedJob;
@property (nonatomic,strong) R5OPERATORACTCHECKLISTS *currentItem;
@property (nonatomic, assign)   NSInteger   failedCount;
@property (nonatomic) BOOL isConnected;
@property (nonatomic, strong)   NSDictionary                *UDFields;
- (void)getChecklistDefault;
- (void)getChecklist;
- (void)getChecklistWithParameters:(WebQueryParameters *)parameters;
- (void)performChecklistWithUser:(NSString *)user
                    withPassword:(NSString *)password
               withSignatureType:(NSString *)signatureType;
- (void)reviewChecklistWithUser:(NSString *)user
                   withPassword:(NSString *)password
              withSignatureType:(NSString *)signatureType;
- (void)CreateFollowUpWorkOrder;
- (void)updateChecklist:(NSArray *)items;
- (BOOL)canUpdate:(NSString *__autoreleasing *)errorMessage;
- (void)updateFieldValue:(NSString *)fieldName withValues:(NSArray *)fieldValues forItem:(R5ACTCHECKLISTS *)checklistItem;


- (LOVData *)getLOVDataSource:(NSString *)lovName;
- (PickerData *)getPickerDataSource:(NSString *)fieldName;
-(void) addOperatorChecklist;
-(void) getOperatorCheckListsDefault;
- (void) getCheckListItems:(GridData *)gridData;
- (void)getChecklistItems;
-(void) getComments:(NSString *) pTaskChecklistCode;
-(void)cancelOperatorChecklist;
-(void)completeOperatorChecklist;
-(void) getJobs:(NSString *) pOrg;
-(void)getOperatorCheckList;
-(void) getChecklistsFollowUpCount;

- (void)showHideConditionFields;
-(void)getEquipmentOperatorCheckLists:(NSString *)searchString andCurrentPosition:(NSInteger )currentPosition;
-(void)getOperatorCheckLists;
-(void)getConditionAsFound;
-(void)updateOperatorChecklist;
-(void)loadRecordViewLayoutForOperatorChecklist;
- (BOOL)validateInput;
- (void)enableFields:(BOOL ) isReadonly canUpdate:(BOOL ) isCanUpdate;
-(BOOL) hideConditionFields;
- (void)CreateDeferredMaintenance;
-(void)setOpChkConnectionMode;
-(void)deleteOperatorChecklist;
-(void) getRepeatedOccurenceRecord:(R5OPERATORACTCHECKLISTS *) pChecklistItem;
- (void)getEquipmentDepartment:(NSString *) code withOrg:(NSString *)org withDesc:(NSString *) desc;
-(void) getTaskPerformReviewFlags;
@end
