/******************************************************************************* * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:ScbGoodsType.cs * 2.功能描述:产品类别SearchBox * 编辑履历: * 作者 日期 版本 修改内容 * 付斌 2018/07/13 1.00 新建 *******************************************************************************/ using System.ComponentModel; using Dongke.WinForm.Controls; using Dongke.WinForm.Utilities; using System; namespace Dongke.IBOSS.PRD.Client.Controls.SearchBox { /// /// 产品类别 /// public partial class ScbGoodsType : ScbSearchBox { #region 构造函数 /// /// 构造函数 /// public ScbGoodsType() { base.DisplayMember = "GoodsTypeName"; base.ValueMember = "GoodsTypeCode"; base.PKMember = "GoodsTypeID"; base.FormText = "产品类别"; } #endregion #region 属性 /// /// 窗体标题 /// [DefaultValue("产品类别")] [Description("获取或设置控件的窗体标题。"), Category("GoodsTypeEx")] public override string FormText { get { return base.FormText; } set { base.FormText = value; } } /// /// 获取或设置一个值,该值指示查询结果数据集中的主键。 /// [Description("获取或设置一个值,该值指示查询结果数据集中的主键。"), Category("GoodsTypeEx")] [DefaultValue("GoodsTypeID")] public override string PKMember { get { return base.PKMember; } protected set { base.PKMember = value; } } /// /// 获取或设置控件的显示的属性 /// [Description("获取或设置控件的显示的属性。"), Category("GoodsTypeEx")] [DefaultValue("GoodsTypeName")] public override string DisplayMember { get { return base.DisplayMember; } set { base.DisplayMember = value; } } /// /// 获取或设置一个属性,该属性将用作控件中的项的实际值。 /// [Description("获取或设置一个属性,该属性将用作控件中的项的实际值。"), Category("CustomerEx")] [DefaultValue("GoodsTypeCode")] public override string ValueMember { get { return base.ValueMember; } set { base.ValueMember = value; } } ///// ///// 获取产品类别ID ///// //[Description("获取产品类别ID")] //public int? GoodsTypeID //{ // get // { // if (_checkedData != null && _checkedData.Rows.Count > 0) // { // return Convert.ToInt32(_checkedData.Rows[0]["GoodsTypeID"] + ""); // } // else // { // return null; // } // } // set // { // } //} ///// ///// 获取产品类别编码 ///// //[Description("获取产品类别编码")] //public string GoodsTypeCode //{ // get // { // if (_checkedData != null && _checkedData.Rows.Count > 0) // { // return _checkedData.Rows[0]["GoodsTypeCode"] + ""; // } // return null; // } //} ///// ///// 获取产品类别名称 ///// //[Description("获取产品类别名称")] //public string GoodsTypeName //{ // get // { // if (_checkedData != null && _checkedData.Rows.Count > 0) // { // return _checkedData.Rows[0]["GoodsTypeName"] + ""; // } // return null; // } //} /// /// 只显示末端产品类别标识 /// [Description("只显示末端产品类别标识")] public bool IsOnlyDisplayEnd { get; set; } #endregion #region 重写方法 /// /// 创建查询窗体。 /// protected override ISearchBoxForm CreatSearchForm() { F_GoodsType form = FormFactory.CreatForm(); return form; } /// /// 重写打开查询窗体的方法 /// public override void ShowSearchForm() { if (this._searchForm == null) { return; } if (this.ValueFrom == SearchBoxValueFrom.UserInput) { string display = this.DisplayMember.ToUpper(); if (display.EndsWith("CODE")) { this.SearchForm.SetConditions(this.txtCondition1.Text, "", IsOnlyDisplayEnd); } else { this.SearchForm.SetConditions(this.txtCondition1.Text, IsOnlyDisplayEnd); } } this._searchForm.Show(); } #endregion } }