//
//  ActivitiesDataController.h
//  EAMiPad
//
//  Created by Divya Sivakumar on 03/29/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "RecordDataController.h"
#import "R5FleetBookLabor.h"

@class EAMAppDelegate;
@class R5ACTIVITIES;
@class DBQuery;
@class EAMActivities;
@class GridData;
@class R5FLEETBOOKLABOR;

#define TXT_ACT_DEFERMAINTENANCE @"ACT_DEFERMAINTENANCE"


@interface ActivitiesDataController : RecordDataController
{
    R5ACTIVITIES   *_recordValue;
}
@property (nonatomic, strong)  NSDictionary *UDFields;
@property (nonatomic, unsafe_unretained)    EAMAppDelegate      *appDelegate;
@property (nonatomic, strong)               DBQuery                 *dbqueryHandler;
@property (nonatomic, strong)               NSString                *workOrderNumber;
@property (nonatomic, strong)               EAMActivities           *activities;
@property (nonatomic, strong)               NSDate                  *startDate;
@property (nonatomic, strong)               NSString                *strCurAct;
@property (nonatomic, strong)               NSString                *strCurWO;
@property (nonatomic)                       BOOL                    departmentSecurityReadOnly;
@property (nonatomic)                       BOOL                    jTAuthReadOnly;
@property (nonatomic)                       BOOL                    isWorkRequest;
@property (nonatomic)                       BOOL                    isWorkOrderCompleted;
@property (nonatomic)                       BOOL                    isActivityCompleted;
//delete permission
@property (nonatomic)                       BOOL                    jTAuthIsDelete;
@property (nonatomic)                       BOOL                    isWarrantyChecked;
@property (nonatomic)                       BOOL                    haswoactdetailrecords;
@property (nonatomic)                       BOOL                    hasUpdatedChecklists;
@property (nonatomic)                       BOOL                    isEnhancedPlanningChecked;
@property (nonatomic)                       BOOL                    hasWOActDetailRecordsIncludingQualifications;
@property (nonatomic)                       BOOL                    canUpdate;
@property (nonatomic)                       BOOL                    isTaskplanCanChange;
@property (nonatomic)                       int                     laborRecords;
@property (nonatomic, strong)               NSString                *oldTaskPlan;
@property (nonatomic, strong)               NSString                *oldTaskRev;
@property (nonatomic)                       BOOL                    isStartedWOActivityExists;


@property (nonatomic, strong)               EAMListDesigner     *childListScreenConfigData;
-(void)loadRecordViewLayoutForActivities;
- (LOVData *)getLOVDataSource:(NSString *)lovName;

- (BOOL)validateInput;

- (void)addActivity;
- (void)updateActivity;
- (void)deleteActivity;
- (void)getActivities;
- (void)getActivity;
- (void)getDefaultActivity;
- (void)enableFields:(BOOL)setReadOnly;
- (PickerData *)getPickerDataSource:(NSString *)fieldName;
- (void) getScreenConfigForPanel;
-(void) disableStatusField :(BOOL)setReadOnly;
-(void) StartActivity :(R5FLEETBOOKLABOR *) pFleetBLModel;
-(void) resetStartActivity :(R5FLEETBOOKLABOR *) pFleetBLModel;
-(void) StopActivity :(R5FLEETBOOKLABOR *) pFleetBLModel;
-(void) getActivityStartStopStatus :(NSString *) pWo forAct:(NSString *) pAct;
-(BOOL) isStartStopEnabled:(R5ACTIVITIES *) pActivity;
-(void) InitiateStartActivity:(R5FLEETBOOKLABOR *) pFleetRecord;


-(R5ACTIVITIES *)setVMRSCodeXMLPathForDisplay:(R5ACTIVITIES *)mRecordValue;

- (void)addOrRemoveLinearAssetFields;

@end
