//
//  BookLaborDataController.h
//  EAMiPad
//
//  Created by Satish Kumar Jakkula on 1/19/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "RecordDataController.h"

@class EAMAppDelegate;
@class R5BOOKEDLABOR;
@class DBQuery;
@class GridData;
@class EAMBookLabor;
@class R5FLEETBOOKLABOR;

typedef enum
{
  AlertMessageTypeBookLaborShowWorkIsCompletedOnSomeEquipmentConfirmationAC  ,
}AlertMessageTypeBookLabor;

@interface BookLaborDataController : RecordDataController
{
    R5BOOKEDLABOR   *_recordValue;
}

@property (nonatomic, unsafe_unretained)    EAMAppDelegate      *appDelegate;
@property (nonatomic, strong)               NSString                *workOrderNumber;
@property (nonatomic, strong)               NSString                *activityCode;
@property (nonatomic, strong)               EAMBookLabor            *bookLabor;
@property (nonatomic, strong)               NSDate                  *endDate;
@property (nonatomic, strong)               NSDate                  *startDate;
@property (nonatomic,       )               NSTimeInterval          dateDiff;
@property (nonatomic, strong)               NSDate                  *storeFirstEndDate;
@property (nonatomic, strong)               NSNumber                *nextDayHrs;
@property (nonatomic        )               BOOL                    bNextDayHrs;
@property (nonatomic)                       BOOL                    departmentSecurityReadOnly;
@property (nonatomic)                       BOOL                    jTAuthReadOnly;
@property (nonatomic)                       BOOL                    isWorkRequest;
@property (nonatomic)                       BOOL                    isWorkOrderCompleted;
//delete permission
@property (nonatomic)                       BOOL                    jTAuthIsDelete;
@property (nonatomic)                       BOOL                    recordViewDisabled;
@property AlertMessageTypeBookLabor _alertMessageType;
-(void)loadRecordViewLayoutForBookLabor;
- (LOVData *)getLOVDataSource:(NSString *)lovName;
- (BOOL)validateInput;
- (void)addBookLabor;
- (void)deleteBookLabor;
- (void)getBookLabor;
- (void)getLaborBookingDefault;
- (void)getLaborBooking;
- (void)enableFields:(BOOL)setReadOnly;
- (PickerData *)getPickerDataSource:(NSString *)fieldName;
- ( NSDateComponents *)calculateHoursMinutes:(NSNumber *)seconds;
- (NSNumber *)convertToSeconds:(NSString *)hoursminutes;
- (void)calculateNextDayHours;
- (void)deleteStartTime:(NSString *)workOrderNum withWOACT:(NSString *)actNum;
- (void)disableRecordViewForUpdateMode:(BOOL)setReadOnly;
- (void)webQuerySuccesswithData:(NSArray *)data Type:(WebQueryRequestType)type withEntity:(NSString *)entityName;
- (void)webQuerySuccessWithModels:(NSArray *)models withType:(WebQueryRequestType)type withModel:(NSString *)modelName;
- (void)webQueryFailed:(NSString *)fault withType:(WebQueryRequestType)type withEntity:(NSString *)entityName;
- (void)enableFields:(BOOL)setReadOnly;
-(void) addBookLabor:(R5BOOKEDLABOR *) pRecord;
-(void) getCurrentCrewForEmployee;
-(void) addBookLaborForAutoBook :(R5FLEETBOOKLABOR *) pRecord;
@end
