ScbGoodsType.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:ScbGoodsType.cs
  5. * 2.功能描述:产品类别SearchBox
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 付斌 2018/07/13 1.00 新建
  9. *******************************************************************************/
  10. using System.ComponentModel;
  11. using Dongke.WinForm.Controls;
  12. using Dongke.WinForm.Utilities;
  13. using System;
  14. namespace Dongke.IBOSS.PRD.Client.Controls.SearchBox
  15. {
  16. /// <summary>
  17. /// 产品类别
  18. /// </summary>
  19. public partial class ScbGoodsType : ScbSearchBox
  20. {
  21. #region 构造函数
  22. /// <summary>
  23. /// 构造函数
  24. /// </summary>
  25. public ScbGoodsType()
  26. {
  27. base.DisplayMember = "GoodsTypeName";
  28. base.ValueMember = "GoodsTypeCode";
  29. base.PKMember = "GoodsTypeID";
  30. base.FormText = "产品类别";
  31. }
  32. #endregion
  33. #region 属性
  34. /// <summary>
  35. /// 窗体标题
  36. /// </summary>
  37. [DefaultValue("产品类别")]
  38. [Description("获取或设置控件的窗体标题。"), Category("GoodsTypeEx")]
  39. public override string FormText
  40. {
  41. get
  42. {
  43. return base.FormText;
  44. }
  45. set
  46. {
  47. base.FormText = value;
  48. }
  49. }
  50. /// <summary>
  51. /// 获取或设置一个值,该值指示查询结果数据集中的主键。
  52. /// </summary>
  53. [Description("获取或设置一个值,该值指示查询结果数据集中的主键。"), Category("GoodsTypeEx")]
  54. [DefaultValue("GoodsTypeID")]
  55. public override string PKMember
  56. {
  57. get
  58. {
  59. return base.PKMember;
  60. }
  61. protected set
  62. {
  63. base.PKMember = value;
  64. }
  65. }
  66. /// <summary>
  67. /// 获取或设置控件的显示的属性
  68. /// </summary>
  69. [Description("获取或设置控件的显示的属性。"), Category("GoodsTypeEx")]
  70. [DefaultValue("GoodsTypeName")]
  71. public override string DisplayMember
  72. {
  73. get
  74. {
  75. return base.DisplayMember;
  76. }
  77. set
  78. {
  79. base.DisplayMember = value;
  80. }
  81. }
  82. /// <summary>
  83. /// 获取或设置一个属性,该属性将用作控件中的项的实际值。
  84. /// </summary>
  85. [Description("获取或设置一个属性,该属性将用作控件中的项的实际值。"), Category("CustomerEx")]
  86. [DefaultValue("GoodsTypeCode")]
  87. public override string ValueMember
  88. {
  89. get
  90. {
  91. return base.ValueMember;
  92. }
  93. set
  94. {
  95. base.ValueMember = value;
  96. }
  97. }
  98. ///// <summary>
  99. ///// 获取产品类别ID
  100. ///// </summary>
  101. //[Description("获取产品类别ID")]
  102. //public int? GoodsTypeID
  103. //{
  104. // get
  105. // {
  106. // if (_checkedData != null && _checkedData.Rows.Count > 0)
  107. // {
  108. // return Convert.ToInt32(_checkedData.Rows[0]["GoodsTypeID"] + "");
  109. // }
  110. // else
  111. // {
  112. // return null;
  113. // }
  114. // }
  115. // set
  116. // {
  117. // }
  118. //}
  119. ///// <summary>
  120. ///// 获取产品类别编码
  121. ///// </summary>
  122. //[Description("获取产品类别编码")]
  123. //public string GoodsTypeCode
  124. //{
  125. // get
  126. // {
  127. // if (_checkedData != null && _checkedData.Rows.Count > 0)
  128. // {
  129. // return _checkedData.Rows[0]["GoodsTypeCode"] + "";
  130. // }
  131. // return null;
  132. // }
  133. //}
  134. ///// <summary>
  135. ///// 获取产品类别名称
  136. ///// </summary>
  137. //[Description("获取产品类别名称")]
  138. //public string GoodsTypeName
  139. //{
  140. // get
  141. // {
  142. // if (_checkedData != null && _checkedData.Rows.Count > 0)
  143. // {
  144. // return _checkedData.Rows[0]["GoodsTypeName"] + "";
  145. // }
  146. // return null;
  147. // }
  148. //}
  149. /// <summary>
  150. /// 只显示末端产品类别标识
  151. /// </summary>
  152. [Description("只显示末端产品类别标识")]
  153. public bool IsOnlyDisplayEnd
  154. {
  155. get;
  156. set;
  157. }
  158. #endregion
  159. #region 重写方法
  160. /// <summary>
  161. /// 创建查询窗体。
  162. /// </summary>
  163. protected override ISearchBoxForm CreatSearchForm()
  164. {
  165. F_GoodsType form = FormFactory.CreatForm<F_GoodsType>();
  166. return form;
  167. }
  168. /// <summary>
  169. /// 重写打开查询窗体的方法
  170. /// </summary>
  171. public override void ShowSearchForm()
  172. {
  173. if (this._searchForm == null)
  174. {
  175. return;
  176. }
  177. if (this.ValueFrom == SearchBoxValueFrom.UserInput)
  178. {
  179. string display = this.DisplayMember.ToUpper();
  180. if (display.EndsWith("CODE"))
  181. {
  182. this.SearchForm.SetConditions(this.txtCondition1.Text, "", IsOnlyDisplayEnd);
  183. }
  184. else
  185. {
  186. this.SearchForm.SetConditions(this.txtCondition1.Text, IsOnlyDisplayEnd);
  187. }
  188. }
  189. this._searchForm.Show();
  190. }
  191. #endregion
  192. }
  193. }