FindGuestSuperSmallForm.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using LYFZ.Software.MainBusiness.DoorCityProcess;
  10. namespace LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm
  11. {
  12. public partial class FindGuestSuperSmallForm : LYFZ.Software.UI.MembershipManage.SuperSmallForm.FindGuestSuperSmallForm
  13. {
  14. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  15. public FindGuestSuperSmallForm()
  16. {
  17. this.btnFind.Click += btnFind_Click;
  18. this.txtTextQuery.KeyDown += txtTextQuery_KeyDown;
  19. }
  20. public bool IsSaveed = false;
  21. /// <summary>
  22. /// 选择客户人名
  23. /// </summary>
  24. public string GuestsCustomerNumber = "";
  25. /// <summary>
  26. /// 窗体加载事件
  27. /// </summary>
  28. /// <param name="sender"></param>
  29. /// <param name="e"></param>
  30. protected override void FindGuestSuperSmallForm_Load(object sender, EventArgs e)
  31. {
  32. this.dgvData.DataColumns("客户姓名,客户拼音,客户性别,客户电话,客户微信,客户QQ,宝贝年龄,会员卡号,客户地址,M_Cus_CustomerNumber", strHideField: "M_Cus_CustomerNumber");
  33. }
  34. /// <summary>
  35. /// 确定
  36. /// </summary>
  37. /// <param name="sender"></param>
  38. /// <param name="e"></param>
  39. protected override void btnOK_Click(object sender, EventArgs e)
  40. {
  41. if (this.dgvData.CurrentRow != null)
  42. {
  43. this.GuestsCustomerNumber = this.dgvData.CurrentRow.Cells["M_Cus_CustomerNumber"].Value.ToString().Trim();
  44. this.IsSaveed = true;
  45. this.Close();
  46. }
  47. }
  48. /// <summary>
  49. /// 取消
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. protected override void btnCancel_Click(object sender, EventArgs e)
  54. { this.Close(); }
  55. /// <summary>
  56. /// 回车查找
  57. /// </summary>
  58. /// <param name="sender"></param>
  59. /// <param name="e"></param>
  60. void txtTextQuery_KeyDown(object sender, KeyEventArgs e)
  61. {
  62. if (e.KeyCode == Keys.Enter)
  63. { this.btnFind_Click(this, null); }
  64. }
  65. /// <summary>
  66. /// 查找
  67. /// </summary>
  68. /// <param name="sender"></param>
  69. /// <param name="e"></param>
  70. void btnFind_Click(object sender, EventArgs e)
  71. {
  72. string StrText = this.txtTextQuery.Text.Trim();
  73. if (!string.IsNullOrEmpty(StrText))
  74. {
  75. DataTable tbl = orbll.GetView_Custom("tempTB_AggregationCustomer", StrWhere: "(Cus_Name_py like '%" + StrText + "%' or Cus_Name like '%" + StrText + "%' or Cus_Telephone like '%" + StrText + "%')", ShowColumnName: "Cus_Name AS 客户姓名,Cus_Sex_cs AS 客户性别,Cus_Telephone AS 客户电话,Cus_MicroSignal AS 客户微信,Cus_QQ AS 客户QQ,Age_String AS 宝贝年龄,Mc_CradNumber AS 会员卡号,Cus_Address AS 客户地址,M_Cus_CustomerNumber").Tables[0];
  76. this.dgvData.DataSource(tbl, strHideField: "M_Cus_CustomerNumber");
  77. }
  78. else
  79. { this.dgvData.Rows.Clear(); }
  80. }
  81. }
  82. }