//
//  EquipmentDataController.h
//  EAMiPad
//
//  Created by Lakshmi Kothapalli on 04/02/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "RecordDataController.h"
#import "R5OBJECTSLOCATION.h"

@class EAMAppDelegate;
@class R5OBJECTS;
@class EAMObjects;
@class DBQuery;
@class GridData;

@interface EquipmentDataController : RecordDataController
{
    R5OBJECTS           *_recordValue;
    R5OBJECTSLOCATION   *_locationrecordValue;
}

@property (nonatomic, unsafe_unretained)    EAMAppDelegate                  *appDelegate;
@property (nonatomic, strong)               EAMObjects                      *objects;
@property (nonatomic, strong)               NSString                        *objOBRType;
@property (nonatomic)                       BOOL                            isAddMode;
@property (nonatomic)                       BOOL                            isCustomFieldValueChanged;
@property (nonatomic,strong)                 NSString                          *isObjOrgCommon;
@property (nonatomic)                       BOOL                    bStatusChanged;
@property (nonatomic)                       BOOL                    isGISEquipment;
@property (nonatomic, strong)   NSDictionary                *customFields;
@property (nonatomic, strong)   NSDictionary                *UDFields;
-(void)loadRecordViewLayoutForEquipment;
- (void)enableFields:(BOOL )enable;
- (void)getEquipment;
-(void)updateEquipment;
-(void)addEquipment;
-(void)addGISAsset;
- (LOVData *)getLOVDataSource:(NSString *)lovName;
- (PickerData *)getPickerDataSource:(NSString *)fieldName;
- (void)deleteEquipment;
- (BOOL)validateInput;
-(void)initDefaultValue;
-(void) getEquipmentCustomFields:(BOOL) isChange;
-(void) disableAllFields:(BOOL) disable;
- (void)updateFieldValue:(NSString *)fieldName withValues:(NSArray *)fieldValues;

-(void) getDefaultEquipment;
- (BOOL)validateEquipmentRValue:(NSString *)value rValue:(NSString *)rValue entity:(NSString *)entity;
- (BOOL)validateDepartment:(NSString *)department organization:(NSString *)org;
- (BOOL)validateOrganization:(NSString *)org;
- (BOOL)validateDistanceUOM:(NSString *)uom;
- (BOOL)validateEquipment:(NSString *)equipment organization:(NSString *)org;
- (NSString *)getFAAMODInstallValue;
- (BOOL)checkESignatureRequired:(NSString *)entity
                               :(NSString *)status
                               :(NSString *)newStatus
                               :(NSString *)equipment;
- (void)addCustomFields;
- (void)setLocationRecordValue:(RecordData *)value;
- (void)updateLocationEquipment;
@end 
