1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using LYFZ.Software.MainBusiness.DoorCityProcess;
- namespace LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm
- {
- public partial class FindGuestSuperSmallForm : LYFZ.Software.UI.MembershipManage.SuperSmallForm.FindGuestSuperSmallForm
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public FindGuestSuperSmallForm()
- {
- this.btnFind.Click += btnFind_Click;
- this.txtTextQuery.KeyDown += txtTextQuery_KeyDown;
- }
- public bool IsSaveed = false;
- /// <summary>
- /// 选择客户人名
- /// </summary>
- public string GuestsCustomerNumber = "";
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void FindGuestSuperSmallForm_Load(object sender, EventArgs e)
- {
- this.dgvData.DataColumns("客户姓名,客户拼音,客户性别,客户电话,客户微信,客户QQ,宝贝年龄,会员卡号,客户地址,M_Cus_CustomerNumber", strHideField: "M_Cus_CustomerNumber");
- }
- /// <summary>
- /// 确定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnOK_Click(object sender, EventArgs e)
- {
- if (this.dgvData.CurrentRow != null)
- {
- this.GuestsCustomerNumber = this.dgvData.CurrentRow.Cells["M_Cus_CustomerNumber"].Value.ToString().Trim();
- this.IsSaveed = true;
- this.Close();
- }
- }
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCancel_Click(object sender, EventArgs e)
- { this.Close(); }
- /// <summary>
- /// 回车查找
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtTextQuery_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.btnFind_Click(this, null); }
- }
- /// <summary>
- /// 查找
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnFind_Click(object sender, EventArgs e)
- {
- string StrText = this.txtTextQuery.Text.Trim();
- if (!string.IsNullOrEmpty(StrText))
- {
- 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];
- this.dgvData.DataSource(tbl, strHideField: "M_Cus_CustomerNumber");
- }
- else
- { this.dgvData.Rows.Clear(); }
- }
- }
- }
|