yanyuan
2023-10-08 9fad19fbb830f6a4f2e2625916a28919d0600a91
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
49
50
51
52
53
54
55
56
57
58
59
60
Quintiq file version 2.0
#parent: pnlActions/btnOk
Response OnClick () id:Response_pnlActions_btnOk_OnClick
{
  #keys: '[414382.0.400131334]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    //feedback := Translations::FilllingCapacity_ValidateInput();
    //
    //checkValue := not dropDownStringListProductID.Text() = '' and not dropDownStringListSalesSegmentName.Text() = ''
    //              and not dropDownStringListStockPointID.Text() = '' and not dropDownStringListCustomer.Text() = ''
    //              and not edtQuantity.Text() = '' and not dropDownStringListUnitOfMeasureName.Text() = ''
    //              and not edtSalesAmount.Text() = ''
    //
    //return checkValue;
  *]
  QuillAction
  {
    Body:
    [*
      Form.ApplyChanges();
      
      data := guard( DataHolderFillingCapacityOrder.Data().WrappedInstance(), null( FillingCapacityOrder ) );;
      if ( isnull( data ) ) {
        MacroPlan.FillingCapacityOrder( relnew,
                                        ID                 := OS::GenerateGUIDAsString(),
                                        ProductID          := guard( ddlProduct_MP.Data().ID(), "null" ),
                                        BusinessType       := guard( ddlBusinessType.Data().BusinessTypeName(), "null" ),
                                        SalesSegmentName   := guard( ddlSalesSegment.Data().Name(), "null" ),
                                        StockingPointID    := guard( ddlStockingPoint_MP.Data().ID(), "null" ),
                                        Customer           := efCustomerName.Text(),
                                        Quantity           := [Real]edtQuantity.Text(),
                                        UnitOfMeasureName  := ddlUnitOfMeasure_MP.Data().Name(),
                                        ForecastDemandDate := dsForecastDemandDate.Date(),
                                        DemandDate         := dsDemandDate.Date(),
                                        OrderType          := ddslOrderType.Text(),
                                        SalesAmount        := [Number]edtSalesAmount.Text(),
                                        CurrencyID         := ddlCurrency_MP.Data().ID()
                                       );
      } else {
        data.ProductID( guard( ddlProduct_MP.Data().ID(), "null" ) );
        data.BusinessType( guard( ddlBusinessType.Data().BusinessTypeName(), "null" ) );
        data.SalesSegmentName( guard( ddlSalesSegment.Data().Name(), "null" ) );
        data.StockingPointID( guard( ddlStockingPoint_MP.Data().ID(), "null" ) );
        data.Customer( efCustomerName.Text() );
        data.Quantity( [Real]edtQuantity.Text() );
        data.UnitOfMeasureName( ddlUnitOfMeasure_MP.Data().Name() );
        data.ForecastDemandDate( dsForecastDemandDate.Date() );
        data.DemandDate( dsDemandDate.Date() );
        data.OrderType( ddslOrderType.Text() );
        data.SalesAmount( [Number]edtSalesAmount.Text() );
        data.CurrencyID( ddlCurrency_MP.Data().ID() );
      }
      
      Form.Close();
    *]
    GroupServerCalls: false
  }
}