renhao
2023-09-21 1aa9f2bb83dd9e4b7517f1cbf06b0db53979bb31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { DialogSOP } from '../../libappsop/dialogsop';
import { EditFieldSOP } from '../../libappsop/editfieldsop';
import { DropDownListSOP } from '../../libappsop/dropdownlistsop';
import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop';
 
export interface DialogSupplyCostFields {
  Account?: string;
  Cost?: string;
  Product?: string;
  StockingPoint?: string;
  Date?: string;
  ManufacturedDate?: string;
  Quantity?: string;
  Description?: string;
}
 
export class DialogSupplyCost extends DialogSOP<DialogSupplyCostFields> {
  public static title = 'Supply Cost';
 
  // Dropdown Lists
  public ddlAccount = new DropDownListSOP('ddlAccount');
  public ddlProduct = new DropDownListSOP('ddlContentProduct');
  public ddlStockingPoint = new DropDownListSOP('ddlContentStockingPoint');
 
  // Edit Fields
  public efCost = new EditFieldSOP('EditFieldCost');
  public efQuantity = new EditFieldSOP('EditFieldQuantityTon');
  public efDescription = new EditFieldSOP('EditFieldDescription');
 
  // Date Time Selectors
  public dtsDate = new DateTimeSelectorSOP('dsContentDate');
  public dtsManufacturedDate = new DateTimeSelectorSOP('dsManufaturedDate');
 
  public constructor() {
    super('DialogCreateEditSupplyCost');
 
    // Set UI element mapping to pair the UI name to the UI element for use in DialogSOP to find the UI object to set value or verify value
    // This prevents each new Dialog to duplicate code just to set/verify UI element value
    this._uiMap.set('Account', this.ddlAccount);
    this._uiMap.set('Cost', this.efCost);
    this._uiMap.set('Product', this.ddlProduct);
    this._uiMap.set('StockingPoint', this.ddlStockingPoint);
    this._uiMap.set('Date', this.dtsDate);
    this._uiMap.set('ManufacturedDate', this.dtsManufacturedDate);
    this._uiMap.set('Quantity', this.efQuantity);
    this._uiMap.set('Description', this.efDescription);
  }
}