/// <summary>
  /// Hooks on Initialized event of the <c>EcoResProductVariantFlavorDisplayOrderView</c> form data source and adjusts data source query.
  /// </summary>
  /// <param name = "_sender">The data source object that triggers the event.</param>
  /// <param name = "_e">Event arguments.</param>
  [FormDataSourceEventHandler(formDataSourceStr(EcoResProductVariants, EcoResProductVariantFlavorDisplayOrderView), FormDataSourceEventType::Initialized)]
  public void ecoResProductVariantFlavorDisplayOrderView_ValidatingWrite(FormDataSource _sender, FormDataSourceEventArgs _e)
  {
  if (isConfigurationkeyEnabled(configurationKeyNum(Retail)))
  {
  _sender.queryBuildDataSource().addLink(fieldNum(EcoResProductVariantFlavor, DistinctProductVariant), fieldNum(EcoResProductVariantFlavorDisplayOrderView, DistinctProductVariant));
  _sender.queryBuildDataSource().addLink(fieldNum(EcoResProductVariantFlavor, Flavor), fieldNum(EcoResProductVariantFlavorDisplayOrderView, Flavor));
   
  _sender.queryBuildDataSource().addOrderByField(fieldNum(EcoResProductVariantFlavorDisplayOrderView, RetailDisplayOrder));
  _sender.queryBuildDataSource().addOrderByField(fieldNum(EcoResProductVariantFlavorDisplayOrderView, Name));
  }
  }
   
  加range/link 到 新加的datasource [View] (extension) 內:
  /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    [FormDataSourceEventHandler(formDataSourceStr(SalesTable, ABC_ADDaView), FormDataSourceEventType::Initialized)]
    public static void ABC_ADDaView_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
    {
        sender.queryBuildDataSource().addLink(fieldNum(SalesTable, SalesId), fieldNum(ABC_ADDaView, SalesId));
    }
 
創作者介紹
創作者 lionlionchopper 的頭像
lionlionchopper

呆子獅的夢想世界

lionlionchopper 發表在 痞客邦 留言(0) 人氣()