/*******************************************************************************
* Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
* 类的信息:
* 1.程序名称:ScbSAPCode.cs
* 2.功能描述:SAP物料编码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
{
///
/// SAP物料编码
///
public partial class ScbSAPCode : ScbSearchBox
{
#region 构造函数
///
/// 构造函数
///
public ScbSAPCode()
{
base.DisplayMember = "MaterialCode";
base.ValueMember = "MaterialCode";
base.PKMember = "Guid";
base.FormText = "物料编码";
}
#endregion
#region 属性
///
/// 获取或设置查询条件(多选时,不能设置)。
///
[Description("获取或设置查询条件(多选时,不能设置)。"), Category("CustomerEx")]
[DefaultValue("")]
[Browsable(true)]
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
//[EditorBrowsable(EditorBrowsableState.Advanced)]
public override string Text
{
get
{
return this.txtCondition1.Text.Trim();
}
set
{
if (!this.MultiSelect /*&& !this.EditReadOnly && !this.ReadOnly*/)
{
this.txtCondition1.Text = value;
}
//base.Text = value;
}
}
///
/// 窗体标题
///
[DefaultValue("物料编码")]
[Description("获取或设置控件的窗体标题。"), Category("SAPCodeEx")]
public override string FormText
{
get
{
return base.FormText;
}
set
{
base.FormText = value;
}
}
///
/// 获取或设置一个值,该值指示查询结果数据集中的主键。
///
[Description("获取或设置一个值,该值指示查询结果数据集中的主键。"), Category("MaterialCodeEx")]
[DefaultValue("Guid")]
public override string PKMember
{
get
{
return base.PKMember;
}
protected set
{
base.PKMember = value;
}
}
///
/// 获取或设置控件的显示的属性
///
[Description("获取或设置控件的显示的属性。"), Category("MaterialCodeEx")]
[DefaultValue("MaterialCode")]
public override string DisplayMember
{
get
{
return base.DisplayMember;
}
set
{
base.DisplayMember = value;
}
}
///
/// 获取或设置一个属性,该属性将用作控件中的项的实际值。
///
[Description("获取或设置一个属性,该属性将用作控件中的项的实际值。"), Category("MaterialCodeEx")]
[DefaultValue("MaterialCode")]
public override string ValueMember
{
get
{
return base.ValueMember;
}
set
{
base.ValueMember = value;
}
}
/////
///// 获取SAP物料编码ID
/////
//[Description("获取SAP物料编码ID")]
//public int? SAPCodeID
//{
// get
// {
// if (_checkedData != null && _checkedData.Rows.Count > 0)
// {
// return Convert.ToInt32(_checkedData.Rows[0]["SAPCodeID"] + "");
// }
// else
// {
// return null;
// }
// }
// set
// {
// }
//}
/////
///// 获取SAP物料编码编码
/////
//[Description("获取SAP物料编码编码")]
//public string SAPCodeCode
//{
// get
// {
// if (_checkedData != null && _checkedData.Rows.Count > 0)
// {
// return _checkedData.Rows[0]["SAPCodeCode"] + "";
// }
// return null;
// }
//}
/////
///// 获取SAP物料编码名称
/////
//[Description("获取SAP物料编码名称")]
//public string SAPCodeName
//{
// get
// {
// if (_checkedData != null && _checkedData.Rows.Count > 0)
// {
// return _checkedData.Rows[0]["SAPCodeName"] + "";
// }
// return null;
// }
//}
#endregion
#region 重写方法
///
/// 创建查询窗体。
///
protected override ISearchBoxForm CreatSearchForm()
{
F_SAPCode 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, base.CheckedData?.Copy());
}
else
{
this.SearchForm.SetConditions(this.txtCondition1.Text);
}
}
this._searchForm.Show();
}
#endregion
}
}