lazhen
2024-09-13 b343b593893e2f3278f2695d1411f3aacaeedfc8
_Main/BL/Type_CustomerDemandIDS/Method_GetRowByUnit.qbl
@@ -1,20 +1,19 @@
Quintiq file version 2.0
#parent: #root
Method GetRowByUnit (
  Product_MP product,
  String product,
  String unit
) as CustomerDemandIDSRow
{
  TextBody:
  [*
    // 甄兰鸽 Sep-6-2024 (created)
    row := selectobject( this, Row, row, row.Name() = product.ID() and row.Factory() = unit );
    row := selectobject( this, Row, row, row.Name() = product and row.Factory() = unit );
    if( isnull( row ) ){
      //初始化单元格 
      row := this.Row( relnew, Name := product.ID(), Factory := unit );
      row.Product_MP( relset, product );
      row := this.Row( relnew, Name := product, Factory := unit );
      traverse( this, Column, column ){
        row.Initialize( column, product, unit );
        row.Initialize( column );
      }
    }
    return row;