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
37
38
39
40
41
42
import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop';
import { DialogSOP } from '../../libappsop/dialogsop';
import { DropDownListSOP } from '../../libappsop/dropdownlistsop';
import { EditFieldSOP } from '../../libappsop/editfieldsop';
 
export interface DialogForecastFields {
  SalesSegment?: string;
  Product?: string;
  StockingPoint?: string;
  Start?: string;
  End?: string;
  OriginalQuantity?: string;
  NettedQuantity?: string;
  Price?: string;
}
 
export class DialogForecast extends DialogSOP<DialogForecastFields> {
  public static readonly title = 'Forecast';
  public readonly ddlSalesSegment = new DropDownListSOP('DropDownListSalesSegment');
  public readonly ddlProduct = new DropDownListSOP('DropDownListProduct');
  public readonly ddlStockingPoint = new DropDownListSOP('DropDownListStockingPoint');
  public readonly dsStart = new DateTimeSelectorSOP('DateSelectorStart');
  public readonly dsEnd = new DateTimeSelectorSOP('DateSelectorEnd');
  public readonly efOriginalQuantity = new EditFieldSOP('EditFieldQuantityUom');
  public readonly efNettedQuantity = new EditFieldSOP('EditFieldNettedQty');
  public readonly efPrice = new EditFieldSOP('EditFieldPrice');
 
  public constructor() {
    super('DialogCreateEditForecast');
 
    // 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('SalesSegment', this.ddlSalesSegment);
    this._uiMap.set('Product', this.ddlProduct);
    this._uiMap.set('StockingPoint', this.ddlStockingPoint);
    this._uiMap.set('Start', this.dsStart);
    this._uiMap.set('End', this.dsEnd);
    this._uiMap.set('OriginalQuantity', this.efOriginalQuantity);
    this._uiMap.set('NettedQuantity', this.efNettedQuantity);
    this._uiMap.set('Price', this.efPrice);
  }
}