/******************************************************************************* * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:ScbOrganization.cs * 2.功能描述:产品类别SearchBox * 编辑履历: * 作者 日期 版本 修改内容 * 付斌 2018/07/23 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 ScbOrganization : ScbSearchBox { #region 构造函数 /// /// 构造函数 /// public ScbOrganization() { base.DisplayMember = "OrganizationName"; base.ValueMember = "OrganizationCode"; base.PKMember = "OrganizationID"; base.FormText = "组织机构"; } #endregion #region 属性 /// /// 窗体标题 /// [DefaultValue("组织机构")] [Description("获取或设置控件的窗体标题。"), Category("OrganizationEx")] public override string FormText { get { return base.FormText; } set { base.FormText = value; } } /// /// 获取或设置一个值,该值指示查询结果数据集中的主键。 /// [Description("获取或设置一个值,该值指示查询结果数据集中的主键。"), Category("OrganizationEx")] [DefaultValue("OrganizationID")] public override string PKMember { get { return base.PKMember; } protected set { base.PKMember = value; } } /// /// 获取或设置控件的显示的属性 /// [Description("获取或设置控件的显示的属性。"), Category("OrganizationEx")] [DefaultValue("OrganizationName")] public override string DisplayMember { get { return base.DisplayMember; } set { base.DisplayMember = value; } } /// /// 获取或设置一个属性,该属性将用作控件中的项的实际值。 /// [Description("获取或设置一个属性,该属性将用作控件中的项的实际值。"), Category("CustomerEx")] [DefaultValue("OrganizationCode")] public override string ValueMember { get { return base.ValueMember; } set { base.ValueMember = value; } } /// /// 只显示末端产品类别标识 /// [Description("只显示末端产品类别标识")] public bool IsOnlyDisplayEnd { get; set; } #endregion #region 重写方法 /// /// 创建查询窗体。 /// protected override ISearchBoxForm CreatSearchForm() { F_Organization 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 } }