Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop';
import { DialogSOP } from '../../libappsop/dialogsop';
import { DropDownListSOP } from '../../libappsop/dropdownlistsop';
import { EditFieldSOP } from '../../libappsop/editfieldsop';
 
export interface DialogExternalSupplyFields {
  Product?: string;
  StockingPoint?: string;
  Date?: string;
  ManufacturedDate?: string;
  Quantity?: string;
  Description?: string;
}
 
export class DialogExternalSupply extends DialogSOP<DialogExternalSupplyFields> {
  public static title = 'External Supply';
  private readonly _ddlProduct = new DropDownListSOP('ddlContentProduct');
  private readonly _ddlStockingPoint = new DropDownListSOP('ddlContentStockingPoint');
  private readonly _dsDate = new DateTimeSelectorSOP('dsContentDate');
  private readonly _dsManufacturedDate = new DateTimeSelectorSOP('dsManufaturedDate');
  private readonly _efQuantity = new EditFieldSOP('EditFieldQuantityTon');
  private readonly _efDescription = new EditFieldSOP('EditFieldDescription');
 
  public constructor() {
    super('DialogCreateEditExternalSupply', 'btnOK');
 
    // 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('Product', this._ddlProduct);
    this._uiMap.set('StockingPoint', this._ddlStockingPoint);
    this._uiMap.set('Date', this._dsDate);
    this._uiMap.set('ManufacturedDate', this._dsManufacturedDate);
    this._uiMap.set('Quantity', this._efQuantity);
    this._uiMap.set('Description', this._efDescription);
  }
}