//
//  PromptFields.h
//  EAMiPad
//
//  Created by temp on 01/28/13.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DBQuery.h"
#import "LOVData.h"
#import "RecordDataController.h"
#import "EAMField.h"

@interface ProcessTransaction : NSObject
@property (nonatomic, strong) NSMutableArray *ProcessGroup;
@end

@interface ProcessGroup : NSObject
@property (nonatomic, strong) NSString *WSPROMPTCODE;
@property (nonatomic, strong) NSString *WSPROMPTPROCESSGROUP;
@property (nonatomic, strong) NSMutableArray *PromptFields;
@property (nonatomic, strong) NSMutableArray *CustomFields;
@end

@interface PFIELDS : NSObject

@property (nonatomic, strong) NSString *WSF_WSPMTCODE;
@property (nonatomic, )       int       WSF_LINE;
@property (nonatomic, )       int       WSF_PROCESSGROUP;
@property (nonatomic, strong) NSString *WSF_FIELD;
@property (nonatomic, strong) NSString *WSF_FIELDLABEL;
@property (nonatomic, )       int       WSF_NEXTLINE;
@property (nonatomic, strong) NSString *WSF_TYPE;
@property (nonatomic, strong) NSString *WSF_RTYPE;
@property (nonatomic, strong) NSString *WSF_DISPLAYTYPE;
@property (nonatomic, )       int       WSF_MINLENGTH;
@property (nonatomic, )       int       WSF_MAXLENGTH;
@property (nonatomic, strong) NSString *WSF_DUPPREVVALUE;
@property (nonatomic, strong) NSString *WSF_BRANCHCOND;
@property (nonatomic, strong) NSString *WSF_BRANCHPATTERN;
@property (nonatomic, )       int       WSF_BRANCHGOTO;
@property (nonatomic, strong) NSString *WSF_FIXEDDATA;
@property (nonatomic, strong) NSString *WSF_PATTERN;
@property (nonatomic, strong) NSString *WSF_MOBILEQUERYCODE;
@property (nonatomic, strong) NSString *WSF_SQLQUERYCODE;
@property (nonatomic, strong) NSString *WSF_COMPUTEDDATA;
@property (nonatomic, strong) NSString *WSF_UNMAPPED;
@property (nonatomic, strong) NSString *WSF_ISCONTROLORG;
@property (nonatomic, strong) NSString *WSF_ISCLASS;
@property (nonatomic, strong) NSString *WSF_ISCLASSORG;
@property (nonatomic, strong) NSString *WSF_ISCATEGORY;
@property (nonatomic, strong) NSString *WSF_SYSTEMFIELDTYPE;
@property (nonatomic, strong) NSString *WSF_CLEARPREVVALS;
@property (nonatomic, strong) NSString *DMLTYPE;
@property (nonatomic, strong) EAMField *PROMPT_CONTROL;


@property (nonatomic, strong) NSString *WSF_VALUE;
@property (nonatomic, strong) NSNumber *WSF_NVALUE;
@property (nonatomic, strong) NSDate   *WSF_DVALUE;
@property (nonatomic, strong) NSString *WSF_DISPLAYNAME;

@property (nonatomic, )       int       LASTKEYFIELD;
@end


@interface PromptFields : NSObject


+ (NSArray *)getFields:(NSDictionary *)udfFields
           forPromptID:(NSString *)promptID;

+ (NSArray *)AddPromptKeys:(NSDictionary *)PFields
                        to:(NSArray *)keys ;

+ (NSArray *)AddPromptValues:(NSDictionary *)PFields
                          to:(NSArray *)values
              withRecordData:(RecordData *)recordData;

+ (NSDictionary *)dictionaryFromArray:(NSArray *)array;

+ (void)setReadOnly:(NSDictionary *)PFields
    forParent:(RecordDataController *)parent
        value:(BOOL)value
isKFGetSuccess:(BOOL)isKFGetSuccess;

//user defined fields
+ (NSDictionary *)getUDFields:(NSString *)pmtCode;

//+ (NSArray *)getCustomFields:(PFIELDS *)pfields;
+ (NSArray *)getCustomFields:(int)processGroup
                   inPfields:(NSArray *)pfields
                 forPromptID:(NSString *)promptID;

+ (BOOL) validateCFields:(PFIELDS *)pfields;
+ (NSString *)replaceQueryParams:(NSString *)sql;
+ (NSString *)getDefaultOrg;
+ (NSDictionary *)dictKFFields:(NSArray *)array;
+ (NSArray *)arrayKFFields:(NSArray *)array;
+ (NSDictionary *)dictionaryFromKFArray:(NSArray *)kfArray;
@end
