//
//  MeterReadingDataController.h
//  EAMNext
//
//  Created by Bhavani Srikantam on 29/09/16.
//
//

#import "RecordDataController.h"

@class EAMAppDelegate;
@class EAMReadings;
@class WebQuery;
@class DBQuery;
@class GridData;
@class R5READINGS;
@class R5OBJUSAGEDEFS;

@interface MeterReadingDataController : RecordDataController
{
    R5READINGS   *_recordValue;
}

@property (nonatomic, unsafe_unretained)    EAMAppDelegate          *appDelegate;

@property (nonatomic, strong)            DBQuery           *dbqueryHandler;
@property (nonatomic, strong)            NSString          *equipmentCode;
@property (nonatomic, strong)            NSString          *equipmentOrg;
@property (nonatomic, strong)            NSString          *uomCode;
@property (nonatomic, strong)            NSString          *physicalMeter;
@property (nonatomic, strong)            NSString          *readingCode;
@property (nonatomic, strong)            R5READINGS        *currentRecord;
@property (nonatomic)                       BOOL                    isAddMode;

-(id)initWithMeter:(R5OBJUSAGEDEFS *)objUsage;
-(void)getEquipmentMeterReading;
-(R5READINGS *)convertModelForEditMode:(R5READINGS *)reading;
-(void)getMeterHistory;
-(void)addMeterReading;
-(void)updateMeterReading;
-(void)deleteMeterReading;
- (BOOL)validateInput;
- (LOVData *)getLOVDataSource:(NSString *)lovName;
- (PickerData *)getPickerDataSource:(NSString *)fieldName;
- (void)enableFields:(BOOL)setReadOnly;

+ (NSString *)meterReadingTypeFromDesc:(NSString *)readingDesc;
+ (NSString *)meterReadingDescForType:(NSString *)readingType;

@end
