123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569 |
- 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 System.Globalization;
- using LYFZ.ComponentLibrary;
- using LYFZ.BLL;
- using LYFZ.Software.UI.Customers.OldCustomer;
- using LYFZ.Model;
- using LYFZ.DAL;
- namespace LYFZ.Software.MainBusiness.Customers
- {
- public partial class FrmOldCustomerRecord : LYFZ.Software.UI.Customers.FrmOldCustomerRecord
- {
- /// <summary>
- /// 订单号
- /// </summary>
- public string Theorderno;
- /// <summary>
- /// 客户组编号
- /// </summary>
- string Customergroup;
- /// <summary>
- /// 主联系人ID
- /// </summary>
- int masterID;
- /// <summary>
- /// 是否有修改过
- /// </summary>
- public bool IsSaved = false;
- public FrmOldCustomerRecord()
- {
- this.btnUnbind.Click += btnUnbind_Click;
- this.dgv2.CellDoubleClick += dgv2_CellDoubleClick;
- this.chkLKH.Click += chkLKH_Click;
- this.chkPYJS.Click += chkPYJS_Click;
- this.chkQT.Click += chkQT_Click;
- this.btnQQCall.Click += btnQQCall_Click;
- this.btnDial.Click += btnDial_Click;
- this.txtCus_FixedPhone.KeyPress += txtCus_FixedPhone_KeyPress;
- }
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL_ErpCustomer();
- LYFZ.BLL.BLL_ErpCustomerGroup cgbll = new BLL_ErpCustomerGroup();
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void FrmOldCustomerRecord_Load(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_Telephone);
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_FixedPhone);
- this.btnUnbind.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MicroInfo, CustomAttributes.OperatingAuthority.MicroInfo_Unbind);
- this.btnUpdate.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersCustomerCompetence, CustomAttributes.OperatingAuthority.Update);
- this.Text = "编辑";
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAC", this.cmbCus_Region, strHideFiled: "");
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbCus_CustomerSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD");
- DataTable dt2 = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + Theorderno + "'", ShowColumnName: "GP_CustomerSource,GP_CustomerGroupID,GP_CustomerType").Tables[0];
- if (dt2.Rows.Count > 0)
- {
- this.Text = "编辑" + type(dt2.Rows[0]["GP_CustomerType"].ToString()) + "客户";
- switch (dt2.Rows[0]["GP_CustomerSource"].ToString().Trim())
- {
- case "老客户":
- this.chkLKH.Checked = true;
- this.chkLKH_Click(null, null);
- break;
- case "朋友介绍":
- this.chkPYJS.Checked = true;
- this.chkPYJS_Click(null, null);
- break;
- default:
- this.chkQT.Checked = true;
- this.chkQT_Click(null, null);
- this.cmbCus_CustomerSource.Text = dt2.Rows[0]["GP_CustomerSource"].ToString().Trim();
- break;
- }
- Customergroup = dt2.Rows[0]["GP_CustomerGroupID"].ToString();
- DataTable dt = orbll.GetView_Custom("tb_ErpCustomerGroupMembers Left Join tb_ErpCustomer on GM_CustomerID = Cus_CustomerNumber", StrWhere: "GM_CustomerGroupID = '" + Customergroup + "'", ShowColumnName: "tb_ErpCustomer.ID,Cus_Name,Cus_Sex,Cus_Birthday,Cus_BirthdayLunar,Cus_QQ,Cus_MicroSignal,Cus_Zodiac,Cus_DayForMarriage,Cus_DayForMarriageLunar,Cus_Telephone,Cus_FixedPhone,Cus_Region,Cus_Address,Cus_WorkUnit,Cus_CustomerNumber,Cus_Grade,Cus_Type,Cus_OpenID,GM_CustomerGroupID,GM_CustomerID,GM_RelatedPersonID,GM_Relation,tb_ErpCustomerGroupMembers.ID as GMID", filedOrder: "tb_ErpCustomer.ID").Tables[0];
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- if (dt.Rows[t]["GM_Relation"].ToString().Trim() != "本人")
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //姓名 0
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_Name"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //性别 1
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToBoolean(dt.Rows[t]["Cus_Sex"]) == false ? "男" : "女";
- dgvr.Cells.Add(cell);
- //生日 2
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_Birthday"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //生日历类 3
- cell = new DataGridViewTextBoxCell();
- cell.Value = Lunar(dt.Rows[t]["Cus_BirthdayLunar"].ToString().Trim());
- dgvr.Cells.Add(cell);
- //QQ 4
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_QQ"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //微信 5
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_MicroSignal"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //手机 6
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_Telephone"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //固定电话 7
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_FixedPhone"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //地区 8
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_Region"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //地址 9
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_Address"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //工作单位 10
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_WorkUnit"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //ID 11
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["ID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //联系人 12
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["GM_Relation"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //客户编号 14
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Cus_CustomerNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- // //GM客户组表ID 13
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["GMID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- dgv2.Rows.Add(dgvr);
- }
- else
- {
- #region 赋值
- string Cus_BirthdayLunar = dt.Rows[t]["Cus_BirthdayLunar"].ToString();
- if (Cus_BirthdayLunar.ToString() == "1")
- { this.chkCus_Lunar.Checked = true; }
- //姓名
- txtCus_Name.Text = dt.Rows[t]["Cus_Name"].ToString();
- //生日
- txtCus_Birthday.Text = dt.Rows[t]["Cus_Birthday"].ToString();
- //QQ
- txtCus_QQ.Text = dt.Rows[t]["Cus_QQ"].ToString();
- //微信
- txtCus_MicroSignal.Text = dt.Rows[t]["Cus_MicroSignal"].ToString();
- //手机
- txtCus_Telephone.Text = dt.Rows[t]["Cus_Telephone"].ToString();
- //固定电话
- txtCus_FixedPhone.Text = dt.Rows[t]["Cus_FixedPhone"].ToString();
- //区域
- cmbCus_Region.Text = dt.Rows[t]["Cus_Region"].ToString();
- //地址
- txtCus_Address.Text = dt.Rows[t]["Cus_Address"].ToString();
- //单位
- txtCus_WorkUnit.Text = dt.Rows[t]["Cus_WorkUnit"].ToString();
- //来源
- // cmbCus_CustomerSource.Text = dt.Rows[t]["Cus_Name"].ToString();
- //性别
- if (!Convert.ToBoolean(dt.Rows[t]["Cus_Sex"]))
- { this.radCus_Nan.Checked = true; }
- else
- { this.radCus_Nv.Checked = true; }
- /*if (!string.IsNullOrEmpty(dt.Rows[t]["Cus_OpenID"].ToString().Trim()))
- { this.txtMicroID.Text = "已绑定"; }
- else
- { this.txtMicroID.Text = "未绑定"; }*/
- BindMicroData(dt.Rows[t]["Cus_CustomerNumber"].ToString());
- masterID = Convert.ToInt32(dt.Rows[t]["ID"]);
- #endregion
- }
- }
- }
- else
- { MessageBoxCustom.Show("此订单没有用户"); }
- }
- /// <summary>
- /// 客户微信绑定
- /// </summary>
- void BindMicroData(string customerID)
- {
- BLL_CustomerAndWxOpen bllWxOpen = new BLL_CustomerAndWxOpen();
- DataTable dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
- BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
- LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
- modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
- if (string.IsNullOrEmpty(modInterFace.AppID))
- {
- modInterFace.AppID = "";
- }
- DataRow[] drList = dt.Select(" APPID = '" + modInterFace.AppID + "' ");
- if (drList.Length > 0)
- { this.txtMicroID.Text = "已绑定"; }
- else
- { this.txtMicroID.Text = "未绑定"; }
- }
- /// <summary>
- /// 解除客户微信绑定
- /// </summary>
- /// <param name="customerID"></param>
- bool UnBindMicroData(string customerID)
- {
- BLL_CustomerAndWxOpen bllWxOpen = new BLL_CustomerAndWxOpen();
- DataTable dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
- BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
- LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
- modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
- if(string.IsNullOrEmpty( modInterFace.AppID))
- {
- modInterFace.AppID = "";
- }
- DataRow[] drList = dt.Select(" APPID = '" + modInterFace.AppID + "' ");
- if (drList.Length > 0)
- {
- bllWxOpen.Delete(drList[0]["ID"]);
- dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
- string strOpenID = "";
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (!string.IsNullOrEmpty(strOpenID))
- {
- strOpenID += "/";
- }
- strOpenID += dt.Rows[i]["APPID"] + ":" + dt.Rows[i]["WxOpenId"];
- }
- Model_ErpCustomer model = ctbll.GetModel(Convert.ToInt32(this.masterID));
- model.Cus_OpenID = strOpenID;
- ctbll.Update(model);
- return true;
- //this.txtMicroID.Text = "已绑定";
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 修改客户资料
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnUpdate_Click(object sender, EventArgs e)
- {
- Model_ErpCustomer model = ctbll.GetModel(masterID);
- Model_ErpCustomerGroup gpmodel = cgbll.GetModel("GP_OrderNumber", Theorderno);
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- try
- {
- #region 验证输入框不能为空
- if (string.IsNullOrEmpty(txtCus_Name.Text))
- { MessageBoxCustom.Show("客户姓名不能为空!"); return; }
- if (string.IsNullOrEmpty(txtCus_Telephone.Text))
- { MessageBoxCustom.Show("客户手机不能为空!"); return; }
- string StrPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
- if (!string.IsNullOrEmpty(StrPhone))
- {
- if (StrPhone.Length != 11)
- { MessageBoxCustom.Show("手机号码必须为11位数!"); return; }
- DataTable tblClient = orbll.GetView_Custom("tb_ErpCustomer", StrWhere: "Cus_Telephone = '" + StrPhone + "' and ID != '" + masterID + "'", ShowColumnName: "ID").Tables[0];
- if (tblClient.Rows.Count > 0)
- { MessageBoxCustom.Show("手机号已存在"); return; }
- }
- int intMasse = this.txtCus_Birthday.CheckDateValue(this.txtCus_Birthday, this.chkCus_Lunar);
- if (intMasse == 1) { MessageBoxCustom.Show("客户生日日期格式输入错误!"); return; }
- else if (intMasse == 2)
- { MessageBoxCustom.Show("客户生日:" + this.txtCus_Birthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历!"); return; }
- if (chkLKH.Checked == false && chkQT.Checked == false && chkPYJS.Checked == false)
- { MessageBoxCustom.Show("请选择客户来源"); return; }
- #endregion
- model.Cus_Name = LYFZ.BLL.OtherCommonModel.ClearSpecialCharacter(this.txtCus_Name.Text);
- model.Cus_NamePinyin = LYFZ.Command.Command_ChineseToPinyin.GetChineseSpellPinyin(model.Cus_Name).ToLower();
- if (this.radCus_Nan.Checked == true)
- { model.Cus_Sex = false; }
- else
- { model.Cus_Sex = true; }
- model.Cus_Birthday = "";
- model.Cus_BirthdayLunar = "";
- model.Cus_Zodiac = "";
- if (txtCus_Birthday.StrValue.Trim() != "")
- {
- model.Cus_Birthday = txtCus_Birthday.StrValue.Trim();
- model.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(this.txtCus_Birthday.StrValue.Trim(), this.chkCus_Lunar.Checked);
- if (chkCus_Lunar.Checked == true)
- { model.Cus_BirthdayLunar = "1"; }
- else
- { model.Cus_BirthdayLunar = "0"; }
- }
- model.Cus_QQ = this.txtCus_QQ.Text;
- model.Cus_MicroSignal = this.txtCus_MicroSignal.Text;
- model.Cus_Telephone = StrPhone;
- model.Cus_FixedPhone = this.txtCus_FixedPhone.Text;
- model.Cus_Region = this.cmbCus_Region.Text;
- model.Cus_Address = this.txtCus_Address.Text;
- model.Cus_WorkUnit = this.txtCus_WorkUnit.Text;
- model.Cus_CustomerSource = cmbCus_CustomerSource.Text;
- model.Cus_UpdateDateTime = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime();
- model.Cus_UpdateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- clist.Add(ctbll.GetUpdateCommandInfo(model));
- if (this.chkLKH.Checked == true)
- {
- gpmodel.GP_CustomerSource = "老客户";
- gpmodel.GP_IntroducerCustomerID = "";
- }
- if (this.chkPYJS.Checked == true)
- { gpmodel.GP_CustomerSource = "朋友介绍"; }
- if (chkQT.Checked == true)
- {
- gpmodel.GP_CustomerSource = cmbCus_CustomerSource.Text.Trim();
- gpmodel.GP_IntroducerCustomerID = "";
- }
- clist.Add(cgbll.GetUpdateCommandInfo(gpmodel));
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) >= 0)
- {
- DAL_ErpCustomer.UpdateAggregationCustomer(Theorderno);
- this.IsSaved = true;
- //日志
- LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog(LYFZ.EnumPublic.SystemLogsType.修改客户资料, "联系人:" + model.Cus_Name + ",修改联系人资料的客户组:" + gpmodel.GP_CustomerGroupID + ",时间:" + SDateTime.Now, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name);
- MessageBoxCustom.Show("保存成功");
- }
- else
- { MessageBoxCustom.Show("保存失败"); }
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- /// <summary>
- /// 解绑
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnUnbind_Click(object sender, EventArgs e)
- {
- if (this.txtMicroID.Text.Trim() == "已绑定")
- {
- if (MessageBoxCustom.Show("是否要解除绑定?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- LYFZ.Model.Model_ErpCustomer model = ctbll.GetModel(Convert.ToInt32(this.masterID));
- model.Cus_OpenID = "";
- model.Cus_UpdateDateTime = SDateTime.Now;
- model.Cus_UpdateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- ctbll.Update(model);
- if (UnBindMicroData(model.Cus_CustomerNumber))
- {
- MessageBoxCustom.Show("解绑成功!");
- this.txtMicroID.Text = "未绑定";
- }
- else
- { MessageBoxCustom.Show("解绑失败"); }
- }
- }
- /// <summary>
- /// 获取客户资料做修改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgv2_CellDoubleClick(object sender, EventArgs e)
- {
- try
- {
- if (dgv2.Rows.Count > 0)
- {
- bool IsUpdate = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersCustomerCompetence, CustomAttributes.OperatingAuthority.Update);
- LYFZ.Software.MainBusiness.Customers.OldCustomer.FrmAddContacts frm = new OldCustomer.FrmAddContacts();
- frm.btnSave.Enabled = IsUpdate;
- frm.Zhuangtai = "编辑";
- frm.GP = Customergroup.Trim();
- frm.YouID = dgv2.CurrentRow.Cells["ID"].Value.ToString().Trim();
- frm.GMID = dgv2.CurrentRow.Cells["GMID"].Value.ToString().Trim();
- if (frm.ShowDialog() == DialogResult.OK)
- {
- this.IsSaved = true;
- this.dgv2.Rows.Clear();
- this.FrmOldCustomerRecord_Load(null, null);
- }
- }
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- /// <summary>
- /// 设置客户来源
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCustomerSource_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
- set.TypeName = "AAAAAAF";
- set.Version = "Version";
- if (set.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbCus_CustomerSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD"); }
- }
- /// <summary>
- /// 设置客户区域
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnRegion_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
- set.TypeName = "AAAAAAC";
- set.Version = "Version";
- if (set.ShowDialog() == DialogResult.OK)
- { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAC", this.cmbCus_Region, strHideFiled: ""); }
- }
- /// <summary>
- /// 打电话
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDial_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtCus_Telephone);
- }
- /// <summary>
- /// QQ呼叫
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQQCall_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(txtCus_QQ.Text.Trim());
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #region 文本框输入
- void txtCus_FixedPhone_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- {
- e.Handled = true;
- }
- }
- protected override void txtCus_Telephone_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- {
- e.Handled = true;
- }
- }
- protected override void txtCus_QQ_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- {
- e.Handled = true;
- }
- }
- #endregion
- #region 单选框事件
- void chkQT_Click(object sender, EventArgs e)
- {
- try
- {
- chkLKH.Checked = false;
- chkPYJS.Checked = false;
- cmbCus_CustomerSource.Enabled = true;
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- void chkPYJS_Click(object sender, EventArgs e)
- {
- try
- {
- cmbCus_CustomerSource.Enabled = false;
- chkLKH.Checked = false;
- chkQT.Checked = false;
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- void chkLKH_Click(object sender, EventArgs e)
- {
- try
- {
- chkPYJS.Checked = false;
- chkQT.Checked = false;
- cmbCus_CustomerSource.Enabled = false;
- }
- catch (Exception ex)
- { MessageBoxCustom.Show(ex.Message); }
- }
- #endregion
- /// <summary>
- /// 返回日历类别
- /// </summary>
- /// <param name="lun"></param>
- /// <returns></returns>
- string Lunar(string lun)
- {
- string luns = "";
- switch (lun)
- {
- case "0": luns = "公历"; break;
- case "1": luns = "农历"; break;
- case "2": luns = "农历润月"; break;
- }
- return luns;
- }
- /// <summary>
- /// 返回类型的中文
- /// </summary>
- /// <param name="py"></param>
- /// <returns></returns>
- string type(string py)
- {
- string pyE = "";
- switch (py)
- {
- case "3": pyE = "服务"; break;
- case "0": pyE = "婚纱"; break;
- case "1": pyE = "儿童"; break;
- case "2": pyE = "写真"; break;
- }
- return pyE;
- }
- }
- }
|