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.Collections; using LYFZ.Software.MainBusiness.DoorCityProcess; using LYFZ.Helper; namespace LYFZ.Software.MainBusiness.MembershipManage.SetSmallForm { public partial class AddGoldCardMemberSmallForm : LYFZ.Software.UI.MembershipManage.SetSmallForm.AddGoldCardMemberSmallForm { LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder(); LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL.BLL_ErpCustomer(); LYFZ.BLL.BLL_ErpSMSRecord smsbll = new BLL.BLL_ErpSMSRecord(); LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard(); LYFZ.BLL.BLL_ErpCustomerGroup ctgpbll = new BLL.BLL_ErpCustomerGroup(); LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure(); LYFZ.BLL.BLL_ErpMemberCardPoints mcpsbll = new BLL.BLL_ErpMemberCardPoints(); LYFZ.BLL.BLL_ErpMemberCardDiscount mcdbll = new BLL.BLL_ErpMemberCardDiscount(); LYFZ.BLL.BLL_ErpMemberCardValidity mcvybll = new BLL.BLL_ErpMemberCardValidity(); LYFZ.BLL.BLL_ErpCustomerGroupMembers ctgmbll = new BLL.BLL_ErpCustomerGroupMembers(); LYFZ.BLL.BLL_ErpMemberCardInterfaceManagement mcimbll = new BLL.BLL_ErpMemberCardInterfaceManagement(); public AddGoldCardMemberSmallForm() { this.txtCradNO.KeyPress += txtCradNO_KeyPress; this.txtCradNO.EventTextBoxEx_TextChanged += txtCradNO_EventTextBoxEx_TextChanged; this.chkMan.Click += chkMan_Click; this.chkWoman.Click += chkWoman_Click; this.txtSecondQueryName.KeyPress += txtSecondQueryName_KeyPress; this.chkBackCash.CheckedChanged += chkBackCash_CheckedChanged; this.chkBackCash_Perpetual.CheckedChanged += chkBackCash_Perpetual_CheckedChanged; this.chkNewTaken.CheckedChanged += chkNewTaken_CheckedChanged; this.chkNewTaken_Perpetual.CheckedChanged += chkNewTaken_Perpetual_CheckedChanged; this.chkPoints.CheckedChanged += chkPoints_CheckedChanged; this.chkPoints_Perpetual.CheckedChanged += chkPoints_Perpetual_CheckedChanged; this.chkService.CheckedChanged += chkService_CheckedChanged; this.chkService_Perpetual.CheckedChanged += chkService_Perpetual_CheckedChanged; this.chkStoredValue.CheckedChanged += chkStoredValue_CheckedChanged; this.chkStoredValue_Perpetual.CheckedChanged += chkStoredValue_Perpetual_CheckedChanged; } public bool bDisInfo = false; /// /// 会员卡编号 /// public string StrNumber = ""; /// /// 是否点保存 /// public bool IsSaveed = false; /// /// 客户编号 /// public string StrClientNumber = ""; bool isFirstLoad = true; List mlsitValidity = new List(); /// /// 窗体加载事件 /// /// /// protected override void AddGoldCardMemberSmallForm_Load(object sender, EventArgs e) { LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtTelephone); this.isFirstLoad = false; bool IsValidity = false; if (this.StrNumber != "") { string StrTabelName = "SELECT Cus_CustomerNumber,Mc_SecondQueryName,Mc_Remark,Cus_BirthdayLunar,Cus_Birthday,Cus_WorkUnit,Cus_Address,Cus_MicroSignal,Cus_QQ,Cus_Telephone,Cus_Sex,Cus_Name,Mc_CradNumber " + "FROM dbo.tb_ErpMemberCard " + "Left Join dbo.tb_ErpCustomer ON Cus_CustomerNumber = Mc_CustomerNumber Where Mc_Number='" + this.StrNumber + "'"; DataTable tbl = orbll.GetView_Custom(StrTabelName).Tables[0]; if (tbl.Rows.Count > 0) { this.txtCradNO.Text = tbl.Rows[0]["Mc_CradNumber"].ToString().Trim(); this.txtCradName.Text = tbl.Rows[0]["Cus_Name"].ToString().Trim(); if (!Convert.ToBoolean(tbl.Rows[0]["Cus_Sex"])) { this.chkMan.Checked = true; this.chkWoman.Checked = false; } else { this.chkWoman.Checked = true; this.chkMan.Checked = false; } this.txtTelephone.Text = tbl.Rows[0]["Cus_Telephone"].ToString().Trim(); this.txtQQ.Text = tbl.Rows[0]["Cus_QQ"].ToString().Trim(); this.txtMicroSignal.Text = tbl.Rows[0]["Cus_MicroSignal"].ToString().Trim(); this.txtAddress.Text = tbl.Rows[0]["Cus_Address"].ToString().Trim(); this.txtUnit.Text = tbl.Rows[0]["Cus_WorkUnit"].ToString().Trim(); this.maskBirthday.StrValue = Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Cus_Birthday"]); if (tbl.Rows[0]["Cus_BirthdayLunar"].ToString().Trim() == "1") { this.chkBirthdayLunar.Checked = true; } this.txtRemark.Text = tbl.Rows[0]["Mc_Remark"].ToString().Trim(); this.txtSecondQueryName.Text = tbl.Rows[0]["Mc_SecondQueryName"].ToString().Trim(); //this.txtCradNO.Enabled = false; //this.txtCradName.Enabled = false; this.btnFind.Visible = false; this.chkMan.Enabled = false; this.chkWoman.Enabled = false; this.txtCradName.Width = 140; this.StrClientNumber = tbl.Rows[0]["Cus_CustomerNumber"].ToString().Trim(); tbl = mcimbll.GetList("Mcim_Number = '" + this.StrNumber + "'").Tables[0]; if (tbl.Rows.Count > 0) { tbl = new Json.JsontoDataTable().toObject(tbl.Rows[0]["Mcim_InterfaceName"].ToString()); try { this.chkPoints.Checked = Convert.ToBoolean(tbl.Rows[0]["Points"]); } catch { this.chkPoints.Checked = false; } try { this.chkStoredValue.Checked = Convert.ToBoolean(tbl.Rows[0]["StoredValue"]); } catch { this.chkStoredValue.Checked = false; } try { this.chkBackCash.Checked = Convert.ToBoolean(tbl.Rows[0]["BackCash"]); } catch { this.chkBackCash.Checked = false; } try { this.chkService.Checked = Convert.ToBoolean(tbl.Rows[0]["Service"]); } catch { this.chkService.Checked = false; } try { this.chkNewTaken.Checked = Convert.ToBoolean(tbl.Rows[0]["NewTaken"]); } catch { this.chkNewTaken.Checked = false; } } else { this.chkPoints.Checked = true; } #region 有效期 mlsitValidity = mcvybll.GetModelList("Mcvy_Number = '" + this.StrNumber + "'"); if (mlsitValidity.Count > 0) { IsValidity = true; for (int i = 0; i < mlsitValidity.Count; i++) { switch ((LYFZ.EnumPublic.MemberFunctionAttribute)Enum.ToObject(typeof(LYFZ.EnumPublic.MemberFunctionAttribute), mlsitValidity[i].Mcvy_Type)) //switch (mlsitValidity[i].Mcvy_Type) { case EnumPublic.MemberFunctionAttribute.储值: this.chkStoredValue.Tag = mlsitValidity[i].ID; if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { this.dtpStoredValue.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime); this.chkStoredValue_Perpetual.Checked = false; } else { this.dtpStoredValue.Enabled = false; this.chkStoredValue_Perpetual.Checked = true; } break; case EnumPublic.MemberFunctionAttribute.积分: this.chkPoints.Tag = mlsitValidity[i].ID; if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { this.dtpPoints.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime); this.chkPoints_Perpetual.Checked = false; } else { this.dtpPoints.Enabled = false; this.chkPoints_Perpetual.Checked = true; } break; case EnumPublic.MemberFunctionAttribute.返现: this.chkBackCash.Tag = mlsitValidity[i].ID; if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { this.dtpBackCash.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime); this.chkBackCash_Perpetual.Checked = false; } else { this.dtpBackCash.Enabled = false; this.chkBackCash_Perpetual.Checked = true; } break; case EnumPublic.MemberFunctionAttribute.服务: this.chkService.Tag = mlsitValidity[i].ID; if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { this.dtpService.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime); this.chkService_Perpetual.Checked = false; } else { this.dtpService.Enabled = false; this.chkService_Perpetual.Checked = true; } break; case EnumPublic.MemberFunctionAttribute.新摄会: this.chkNewTaken.Tag = mlsitValidity[i].ID; if (!string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { this.dtpNewTaken.DateValue = LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime); this.chkNewTaken_Perpetual.Checked = false; } else { this.dtpNewTaken.Enabled = false; this.chkNewTaken_Perpetual.Checked = true; } break; } } } #endregion if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, LYFZ.CustomAttributes.OperatingAuthority.ValidityDateTime)) { this.chkStoredValue_Perpetual.Enabled = false; this.chkPoints_Perpetual.Enabled = false; this.chkBackCash_Perpetual.Enabled = false; this.chkService_Perpetual.Enabled = false; this.chkNewTaken_Perpetual.Enabled = false; this.dtpStoredValue.Enabled = false; this.dtpPoints.Enabled = false; this.dtpBackCash.Enabled = false; this.dtpService.Enabled = false; this.dtpNewTaken.Enabled = false; } } else { this.btnCancel.Visible = false; MessageBoxCustom.Show("非法进入"); this.Close(); } } else { if (!string.IsNullOrEmpty(this.StrClientNumber)) { this.GetClientData(); } this.chkPoints.Checked = true; } if (!IsValidity) { this.chkBackCash_Perpetual.Checked = true; this.chkNewTaken_Perpetual.Checked = true; this.chkPoints_Perpetual.Checked = true; this.chkService_Perpetual.Checked = true; this.chkStoredValue_Perpetual.Checked = true; } else { if (this.chkStoredValue.Tag == null) { this.chkStoredValue_Perpetual.Checked = true; } if (this.chkPoints.Tag == null) { this.chkPoints_Perpetual.Checked = true; } if (this.chkBackCash.Tag == null) { this.chkBackCash_Perpetual.Checked = true; } if (this.chkService.Tag == null) { this.chkService_Perpetual.Checked = true; } if (this.chkNewTaken.Tag == null) { this.chkNewTaken_Perpetual.Checked = true; } } this.isFirstLoad = true; ///会员管理服务卡会员的版本权限 List hideControl = new List(); //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D; hideControl.Add(this.chkService); hideControl.Add(this.labelEx16); hideControl.Add(this.dtpService); hideControl.Add(this.chkService_Perpetual); LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl( VersionControl.VersionFunctionEnum.会员管理服务卡会员, hideControl, null, null); ///会员管理服务卡会员的版本权限 hideControl = new List(); //LYFZSS.SystemSpecterPossessed.ISystemSpecterPossessed.GetMySystemSpecter = LYFZSS.SystemSpecterType.SST_D; hideControl.Add(this.chkNewTaken); hideControl.Add(this.labelEx17); hideControl.Add(this.dtpNewTaken); hideControl.Add(this.chkNewTaken_Perpetual); LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl( VersionControl.VersionFunctionEnum.会员管理摄友会会员, hideControl, null, null); if(bDisInfo) { InitInputData(); } } public void InitInputData() { this.txtCradNO.Enabled = false; this.txtCradName.Enabled = false; this.btnFind.Enabled = false; this.txtSecondQueryName.Enabled = false; this.txtTelephone.Enabled = false; this.txtQQ.Enabled = false; this.maskBirthday.Enabled = false; this.chkBirthdayLunar.Enabled = false; this.txtMicroSignal.Enabled = false; this.chkMan.Enabled = false; this.chkWoman.Enabled = false; this.txtUnit.Enabled = false; this.chkPoints.Enabled = false; this.chkStoredValue.Enabled = false; this.chkBackCash.Enabled = false; this.chkService.Enabled = false; this.chkNewTaken.Enabled = false; this.txtAddress.Enabled = false; this.dtpPoints.Enabled = false; this.dtpStoredValue.Enabled = false; this.dtpBackCash.Enabled = false; this.dtpService.Enabled = false; this.dtpNewTaken.Enabled = false; this.chkPoints_Perpetual.Enabled = false; this.chkStoredValue_Perpetual.Enabled = false; this.chkBackCash_Perpetual.Enabled = false; this.chkService_Perpetual.Enabled = false; this.chkNewTaken_Perpetual.Enabled = false; } /// /// 关闭窗体后发生事件 /// /// /// protected override void AddGoldCardMemberSmallForm_FormClosing(object sender, FormClosingEventArgs e) { try { if (this.Owner != null) { GoldManagementSmallForm frm1 = (GoldManagementSmallForm)this.Owner; if (frm1 != null) { frm1.RefreshParentForm = IsSaveed; } } } catch { } } /// /// 查找 /// /// /// protected override void btnFind_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.FindGuestSuperSmallForm frm = new SuperSmallForm.FindGuestSuperSmallForm(); //frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual; //this.Location = new Point(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2 - (this.Width + frm.Width) / 2, this.Location.Y); //frm.Location = new Point(this.Location.X + this.Width + 1, this.Location.Y); frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; frm.ShowDialog(); if (frm.IsSaveed) { this.StrClientNumber = frm.GuestsCustomerNumber; this.GetClientData(); } else { if (this.StrClientNumber.Trim() == "") { this.txtCradName.ReadOnly = false; } } } /// /// /// void GetClientData() { this.isFirstLoad = false; DataTable tbl = ctbll.GetListCustomer("Cus_Name,Cus_Sex,Cus_Telephone,Cus_Birthday,Cus_BirthdayLunar,Cus_QQ,Cus_MicroSignal,Cus_Address,Cus_WorkUnit", " Cus_CustomerNumber = '" + this.StrClientNumber + "'").Tables[0]; this.txtCradName.Text = tbl.Rows[0]["Cus_Name"].ToString().Trim(); this.txtCradName.ReadOnly = true; this.txtTelephone.Text = tbl.Rows[0]["Cus_Telephone"].ToString().Trim(); if (!Convert.ToBoolean(tbl.Rows[0]["Cus_Sex"])) { this.chkMan.Checked = true; } else { this.chkWoman.Checked = true; } this.maskBirthday.StrValue = Command.Command_Validate.DateTimeToString(tbl.Rows[0]["Cus_Birthday"]); this.chkBirthdayLunar.Checked = LYFZ.Command.Command_Validate.DateLunar(tbl.Rows[0]["Cus_BirthdayLunar"]); this.txtQQ.Text = tbl.Rows[0]["Cus_QQ"].ToString().Trim(); this.txtMicroSignal.Text = tbl.Rows[0]["Cus_MicroSignal"].ToString().Trim(); this.txtAddress.Text = tbl.Rows[0]["Cus_Address"].ToString().Trim(); this.txtUnit.Text = tbl.Rows[0]["Cus_WorkUnit"].ToString().Trim(); this.GetMemberNumber(); this.txtSecondQueryName.Text = LYFZ.DAL.DAL_ErpCustomer.ClientNumberGetClientAllChildName(this.StrClientNumber); this.isFirstLoad = true; } /// /// 电话号码发生改变时 /// /// /// protected override void txtTelephone_TextChanged(object sender, EventArgs e) { if (this.isFirstLoad) { string StrTelephone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtTelephone); DataTable tblClient = mcbll.GetView_Custom("tb_ErpCustomer", StrWhere: "Cus_Telephone='" + StrTelephone + "'", ShowColumnName: "Cus_CustomerNumber,Cus_Name,Cus_Sex,Cus_Birthday,Cus_BirthdayLunar,Cus_QQ,Cus_MicroSignal,Cus_Address,Cus_WorkUnit").Tables[0];// tblClient.Select("Cus_Telephone Like '" + CusTelephone + "%'"); if (StrTelephone.Length == 11) { if (tblClient.Rows.Count > 0) { if (this.StrClientNumber.Trim() != tblClient.Rows[0]["Cus_CustomerNumber"].ToString().Trim()) { this.isFirstLoad = false; if (MessageBoxCustom.Show("根据电话<" + StrTelephone + ">查找到1位相同客户,是否要加载此客户资料?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No) { this.txtTelephone.Text = StrTelephone.Substring(0, StrTelephone.Length - 1); this.txtTelephone.ForCharMaskedTextBox(); } else { this.txtCradName.Text = tblClient.Rows[0]["Cus_Name"].ToString().Trim(); this.txtTelephone.Text = StrTelephone; if (tblClient.Rows[0]["Cus_Sex"].ToString().Trim() == "0") { this.chkMan.Checked = true; } else { this.chkWoman.Checked = true; } this.maskBirthday.StrValue = Command.Command_Validate.DateTimeToString(tblClient.Rows[0]["Cus_Birthday"]); if (tblClient.Rows[0]["Cus_BirthdayLunar"].ToString().Trim() != "") { if (tblClient.Rows[0]["Cus_BirthdayLunar"].ToString().Trim() == "1") { this.chkBirthdayLunar.Checked = true; } } this.txtQQ.Text = tblClient.Rows[0]["Cus_QQ"].ToString().Trim(); this.txtMicroSignal.Text = tblClient.Rows[0]["Cus_MicroSignal"].ToString().Trim(); this.txtAddress.Text = tblClient.Rows[0]["Cus_Address"].ToString().Trim(); this.txtUnit.Text = tblClient.Rows[0]["Cus_WorkUnit"].ToString().Trim(); this.StrClientNumber = tblClient.Rows[0]["Cus_CustomerNumber"].ToString().Trim(); this.GetMemberNumber(); } this.isFirstLoad = true; } } } } //else { isFirstLoad = true; } } /// /// 获取会员编号 /// void GetMemberNumber() { DataTable tbl_Card = mcbll.GetMemberCrad_TopOne("Mc_Number,Mc_CradNumber,Mc_CreateDatetime", "Mc_CustomerNumber = '" + this.StrClientNumber + "' and Mc_Status ='1' ").Tables[0]; if (tbl_Card.Rows.Count > 0) { if (tbl_Card.Rows[0]["Mc_CradNumber"].ToString().Trim() == "") { this.StrNumber = tbl_Card.Rows[0]["Mc_Number"].ToString().Trim(); } } } /// /// 保存 /// /// /// protected override void btnSave_Click(object sender, EventArgs e) { #region 验证 //卡号 if (this.txtCradNO.Text.Trim() == "") { MessageBoxCustom.Show("卡号不能为空"); return; } //用户姓名 if (this.txtCradName.Text.Trim() == "") { MessageBoxCustom.Show("客户姓名不能为空"); return; } string StrTelephone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtTelephone); //电话 if (StrTelephone != "") { if (LYFZ.Command.Command_Validate.IsMobilePhone(StrTelephone) == false) { MessageBoxCustom.Show("电话格式输入错误"); this.txtTelephone.Text = ""; return; } } else { MessageBoxCustom.Show("请输入电话号码"); return; } //QQ if (this.txtQQ.Text.Trim() != "") { if (LYFZ.Command.Command_Validate.IsNumber(this.txtQQ.Text.Trim()) == false) { MessageBoxCustom.Show("QQ号只能输入整数"); this.txtQQ.Text = ""; return; } } //生日 int intMasse = this.maskBirthday.CheckDateValue(this.maskBirthday, this.chkBirthdayLunar); if (intMasse == 1) { MessageBoxCustom.Show("客户生日日期格式输入错误!"); return; } else if (intMasse == 2) { MessageBoxCustom.Show("客户生日:" + this.maskBirthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历!"); return; } if (!this.chkStoredValue_Perpetual.Checked) { if (string.IsNullOrEmpty(this.dtpStoredValue.DateValue.Trim())) { MessageBoxCustom.Show("储值功能没有选择永久,请输入有效期!"); return; } } if (!this.chkPoints_Perpetual.Checked) { if (string.IsNullOrEmpty(this.dtpPoints.DateValue.Trim())) { MessageBoxCustom.Show("积分功能没有选择永久,请输入有效期!"); return; } } if (!this.chkBackCash_Perpetual.Checked) { if (string.IsNullOrEmpty(this.dtpBackCash.DateValue.Trim())) { MessageBoxCustom.Show("返现功能没有选择永久,请输入有效期!"); return; } } if (!this.chkService_Perpetual.Checked) { if (string.IsNullOrEmpty(this.dtpService.DateValue.Trim())) { MessageBoxCustom.Show("服务功能没有选择永久,请输入有效期!"); return; } } if (!this.chkNewTaken_Perpetual.Checked) { if (string.IsNullOrEmpty(this.dtpNewTaken.DateValue.Trim())) { MessageBoxCustom.Show("新摄会功能没有选择永久,请输入有效期!"); return; } } #endregion DateTime strTime = SDateTime.Now; string strUserName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; List clist = new List(); LYFZ.Model.Model_ErpCustomer ModelCustomer = null; LYFZ.Model.Model_ErpCustomerGroup modelClientGroup = null; if (string.IsNullOrEmpty(this.StrClientNumber)) { DataTable tbl = ctbll.GetListCustomer("Cus_CustomerNumber", "Cus_Telephone = '" + StrTelephone + "'").Tables[0]; if (tbl.Rows.Count == 0) { this.StrClientNumber = LYFZ.BLL.BLL_ErpCustomer.GetClientNumber(); #region 新增 //客户表 ModelCustomer = new Model.Model_ErpCustomer(); ModelCustomer.Cus_CustomerNumber = this.StrClientNumber; ModelCustomer.Cus_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); ModelCustomer.Cus_Type = ""; ModelCustomer.Cus_Name = LYFZ.BLL.OtherCommonModel.ClearSpecialCharacter(this.txtCradName.Text.Trim()); ModelCustomer.Cus_NamePinyin = LYFZ.Command.Command_ChineseToPinyin.GetChineseSpellPinyin(this.txtCradName.Text).ToLower(); ModelCustomer.Cus_Sex = this.chkMan.Checked ? false : true; ModelCustomer.Cus_Telephone = StrTelephone; ModelCustomer.Cus_QQ = this.txtQQ.Text.Trim(); ModelCustomer.Cus_MicroSignal = this.txtMicroSignal.Text.Trim(); ModelCustomer.Cus_Birthday = ""; ModelCustomer.Cus_BirthdayLunar = ""; ModelCustomer.Cus_Zodiac = ""; if (this.maskBirthday.StrValue.Trim() != "") { ModelCustomer.Cus_Birthday = this.maskBirthday.StrValue; ModelCustomer.Cus_BirthdayLunar = this.chkBirthdayLunar.Checked ? "1" : "0"; ModelCustomer.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(ModelCustomer.Cus_Birthday, this.chkBirthdayLunar.Checked); } else { ModelCustomer.Cus_BirthdayLunar = ""; } ModelCustomer.Cus_Address = this.txtAddress.Text.Trim(); ModelCustomer.Cus_WorkUnit = this.txtUnit.Text.Trim(); ModelCustomer.Cus_CreateName = strUserName; ModelCustomer.Cus_CreateDateTime = strTime; clist.Add(ctbll.GetAddCommandInfo(ModelCustomer)); //客户组表 modelClientGroup = new Model.Model_ErpCustomerGroup(); modelClientGroup.GP_OrderNumber = ""; modelClientGroup.GP_CustomerGroupID = LYFZ.BLL.BLL_ErpCustomer.GetNewClientGroupNumber(); modelClientGroup.GP_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); modelClientGroup.GP_GroupType = 1; modelClientGroup.GP_CustomerType = -1; modelClientGroup.GP_CustomerStatus = "正常"; modelClientGroup.GP_LossReason = ""; modelClientGroup.GP_DegreeOfIntent = ""; modelClientGroup.GP_CustomerSource = ""; modelClientGroup.GP_IntroducerCustomerID = ""; modelClientGroup.GP_Remark = ""; modelClientGroup.GP_BelongsPersonID = ""; modelClientGroup.GP_CreateDatetime = strTime; modelClientGroup.GP_CreateName = strUserName; modelClientGroup.GP_ISIntentionCustomer = 0; modelClientGroup.GP_RemindEvent = ""; clist.Add(ctgpbll.GetAddCommandInfo(modelClientGroup)); //客户成员表 LYFZ.Model.Model_ErpCustomerGroupMembers modelClientMember = new Model.Model_ErpCustomerGroupMembers(); modelClientMember.GM_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); modelClientMember.GM_CustomerGroupID = modelClientGroup.GP_CustomerGroupID; modelClientMember.GM_CustomerID = ModelCustomer.Cus_CustomerNumber; modelClientMember.GM_Master = 1; modelClientMember.GM_ProtagonistCustomer = 1; modelClientMember.GM_RelatedPersonID = modelClientMember.GM_CustomerID; modelClientMember.GM_Relation = "本人"; modelClientMember.GM_IsOrder = 0; modelClientMember.GM_IsOrderNumber = ""; clist.Add(ctgmbll.GetAddCommandInfo(modelClientMember)); #endregion } else { this.StrClientNumber = tbl.Rows[0]["Cus_CustomerNumber"].ToString().Trim(); } } else { #region 修改 ModelCustomer = ctbll.GetModel("Cus_CustomerNumber", this.StrClientNumber); ModelCustomer.Cus_Name = this.txtCradName.Text.Trim(); ModelCustomer.Cus_Telephone = StrTelephone; ModelCustomer.Cus_QQ = this.txtQQ.Text.Trim(); ModelCustomer.Cus_MicroSignal = this.txtMicroSignal.Text.Trim(); ModelCustomer.Cus_Birthday = ""; ModelCustomer.Cus_BirthdayLunar = ""; ModelCustomer.Cus_Zodiac = ""; if (this.maskBirthday.StrValue.Trim() != "") { ModelCustomer.Cus_Birthday = this.maskBirthday.StrValue; ModelCustomer.Cus_BirthdayLunar = this.chkBirthdayLunar.Checked ? "1" : "0"; ModelCustomer.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(ModelCustomer.Cus_Birthday, this.chkBirthdayLunar.Checked); } else { ModelCustomer.Cus_BirthdayLunar = ""; } ModelCustomer.Cus_Address = this.txtAddress.Text.Trim(); ModelCustomer.Cus_WorkUnit = this.txtUnit.Text.Trim(); ModelCustomer.Cus_UpdateDateTime = strTime; ModelCustomer.Cus_UpdateName = strUserName; clist.Add(ctbll.GetUpdateCommandInfo(ModelCustomer)); #endregion } bool IsSendSMS = false; bool IsUpdateClient = false; LYFZ.Model.Model_ErpMemberCard ModelCard = null; DataTable dtmcv = mcbll.GetView_Custom("(SELECT Mvc_ViceCardNumber,Mvc_ViceCardType,Mc_CradNumber FROM tb_ErpMemberCardViceCard Left Join tb_ErpMemberCard on Mvc_Number = Mc_Number where Mvc_Status = '1') as tb", StrWhere: "tb.Mvc_ViceCardNumber = '" + txtCradNO.Text.Trim() + "'", ShowColumnName: "Mvc_ViceCardNumber,Mvc_ViceCardType,Mc_CradNumber").Tables[0]; if (dtmcv.Rows.Count > 0) { MessageBoxCustom.Show("此卡号有在作副卡使用,使用状况(副卡类型:" + dtmcv.Rows[0]["Mvc_ViceCardType"].ToString().Trim() + ";所在主卡号:" + dtmcv.Rows[0]["Mc_CradNumber"].ToString().Trim() + ")"); return; } if (string.IsNullOrEmpty(this.StrNumber)) { if (mcbll.GetList("Mc_CradNumber = '" + txtCradNO.Text.Trim() + "' and Mc_Status = '1'").Tables[0].Rows.Count > 0) { MessageBoxCustom.Show("此卡号有在使用,不能重复开卡"); return; } DataTable tbl_Card = mcbll.GetMemberCrad_TopOne("Mc_CradNumber,Mc_CreateDatetime", "Mc_CustomerNumber = '" + this.StrClientNumber + "' and Mc_Status ='1' ").Tables[0]; if (tbl_Card.Rows.Count > 0) { if (tbl_Card.Rows[0]["Mc_CradNumber"].ToString().Trim() != "") { if (MessageBoxCustom.Show("客户" + this.txtCradName.Text.Trim() + "已办理有会员卡,是否要再办理新卡?", "温馨提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } //MessageBoxCustom.Show("此客户已开有会员卡号,请核对!"); return; } } #region 保存会员资料 LYFZ.Model.Model_ErpSystemConfigure sgModel = LYFZ.BLL.OrderPayment_Member.GetNewMenberNumber(); clist.Add(sgbll.GetUpdateCommandInfo(sgModel)); ModelCard = new Model.Model_ErpMemberCard(); ModelCard.Mc_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); ModelCard.Mc_Number = sgModel.Sconfig_Value; ModelCard.Mc_CradNumber = this.txtCradNO.Text.Trim(); ModelCard.Mc_CustomerNumber = this.StrClientNumber; ModelCard.Mc_SecondQueryName = this.txtSecondQueryName.Text.Trim(); DataTable tbl_Grade = mcbll.GetView_Custom("tb_ErpMemberCardGradeSet", "ID = 1", "Mcgs_GradeName").Tables[0]; if (tbl_Grade.Rows.Count > 0) { ModelCard.Mc_CardType = tbl_Grade.Rows[0]["Mcgs_GradeName"].ToString().Trim(); } else { //ModelCard.Mc_CardType = "积分卡"; ModelCard.Mc_CardType = "无"; } ModelCard.Mc_TraderPassword = ""; ModelCard.Mc_UsedNumber = ""; ModelCard.Mc_Status = "1"; ModelCard.Mc_Remark = this.txtRemark.Text.Trim(); ModelCard.Mc_OpenCardSource = "会员开卡," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); ModelCard.Mc_CreateDatetime = strTime; ModelCard.Mc_CreateName = strUserName; clist.Add(mcbll.GetAddCommandInfo(ModelCard)); LYFZ.Model.Model_ErpMemberCardPoints modelPoints = new Model.Model_ErpMemberCardPoints(); modelPoints.Mcps_Number = ModelCard.Mc_Number; modelPoints.Mcps_TotalPoints = 0; modelPoints.Mcps_AvailablePoints = 0; modelPoints.Mcps_OpenCardSource = "会员开卡," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); modelPoints.Mcps_UpdateDateTime = strTime; modelPoints.Mcps_UpdateName = strUserName; clist.Add(mcpsbll.GetAddCommandInfo(modelPoints)); #endregion #region 界面管理 DataTable newdtb = new DataTable(); newdtb.Columns.Add("Points", typeof(bool)); newdtb.Columns.Add("StoredValue", typeof(bool)); newdtb.Columns.Add("BackCash", typeof(bool)); newdtb.Columns.Add("Service", typeof(bool)); newdtb.Columns.Add("NewTaken", typeof(bool)); DataRow newRow = newdtb.NewRow(); newRow["Points"] = this.chkPoints.Checked.ToString(); newRow["StoredValue"] = this.chkStoredValue.Checked.ToString(); newRow["BackCash"] = this.chkBackCash.Checked.ToString(); newRow["Service"] = this.chkService.Checked.ToString(); newRow["NewTaken"] = this.chkNewTaken.Checked.ToString(); newdtb.Rows.Add(newRow); LYFZ.Model.Model_ErpMemberCardInterfaceManagement Modelmcim = new Model.Model_ErpMemberCardInterfaceManagement(); Modelmcim.Mcim_Number = ModelCard.Mc_Number; Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb); Modelmcim.Mcim_UpdateDatetime = strTime; Modelmcim.Mcim_UpdateName = strUserName; clist.Add(mcimbll.GetAddCommandInfo(Modelmcim)); #endregion IsSendSMS = true; } else { ModelCard = mcbll.GetModel("Mc_Number", this.StrNumber); DataTable tbl_SD = mcbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CradNumber = '" + this.txtCradNO.Text.Trim() + "' and Mc_Number != '" + this.StrNumber + "' and Mc_Status ='1'", ShowColumnName: "ID").Tables[0]; if (tbl_SD.Rows.Count > 0) { MessageBoxCustom.Show("此卡号已有人使用,不能重复使用!"); return; } if (string.IsNullOrEmpty(ModelCard.Mc_CradNumber)) { IsSendSMS = true; } ModelCard.Mc_CradNumber = this.txtCradNO.Text.Trim(); ModelCard.Mc_SecondQueryName = this.txtSecondQueryName.Text.Trim(); ModelCard.Mc_Remark = this.txtRemark.Text.Trim(); clist.Add(mcbll.GetUpdateCommandInfo(ModelCard)); LYFZ.Model.Model_ErpMemberCardPoints modelPoints = mcpsbll.GetModel("Mcps_Number", ModelCard.Mc_Number); if (modelPoints.ID <= 0) { modelPoints = new Model.Model_ErpMemberCardPoints(); modelPoints.Mcps_Number = ModelCard.Mc_Number; modelPoints.Mcps_TotalPoints = 0; modelPoints.Mcps_AvailablePoints = 0; modelPoints.Mcps_OpenCardSource = "会员卡修改," + new System.Diagnostics.StackTrace(new System.Diagnostics.StackFrame(true)).ToString(); modelPoints.Mcps_UpdateDateTime = strTime; modelPoints.Mcps_UpdateName = strUserName; clist.Add(mcpsbll.GetAddCommandInfo(modelPoints)); } #region 界面管理 DataTable newdtb = new DataTable(); newdtb.Columns.Add("Points", typeof(bool)); newdtb.Columns.Add("StoredValue", typeof(bool)); newdtb.Columns.Add("BackCash", typeof(bool)); newdtb.Columns.Add("Service", typeof(bool)); newdtb.Columns.Add("NewTaken", typeof(bool)); DataRow newRow = newdtb.NewRow(); newRow["Points"] = this.chkPoints.Checked.ToString(); newRow["StoredValue"] = this.chkStoredValue.Checked.ToString(); newRow["BackCash"] = this.chkBackCash.Checked.ToString(); newRow["Service"] = this.chkService.Checked.ToString(); newRow["NewTaken"] = this.chkNewTaken.Checked.ToString(); newdtb.Rows.Add(newRow); LYFZ.Model.Model_ErpMemberCardInterfaceManagement Modelmcim = mcimbll.GetModel("Mcim_Number", this.StrNumber); if (Modelmcim.ID <= 0) { Modelmcim = new Model.Model_ErpMemberCardInterfaceManagement(); Modelmcim.Mcim_Number = this.StrNumber; Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb); Modelmcim.Mcim_UpdateDatetime = strTime; Modelmcim.Mcim_UpdateName = strUserName; clist.Add(mcimbll.GetAddCommandInfo(Modelmcim)); } else { Modelmcim.Mcim_Number = this.StrNumber; Modelmcim.Mcim_InterfaceName = new Json.JsontoDataTable().toJson(newdtb); Modelmcim.Mcim_UpdateDatetime = strTime; Modelmcim.Mcim_UpdateName = strUserName; clist.Add(mcimbll.GetUpdateCommandInfo(Modelmcim)); } #endregion #region 修改 LYFZ.Model.Model_ErpCustomer model_Cus = ctbll.GetModel("Cus_CustomerNumber", this.StrClientNumber); model_Cus.Cus_Name = this.txtCradName.Text.Trim(); model_Cus.Cus_Telephone = StrTelephone; model_Cus.Cus_QQ = this.txtQQ.Text.Trim(); model_Cus.Cus_MicroSignal = this.txtMicroSignal.Text.Trim(); model_Cus.Cus_Birthday = ""; model_Cus.Cus_BirthdayLunar = ""; model_Cus.Cus_Zodiac = ""; if (this.maskBirthday.StrValue.Trim() != "") { model_Cus.Cus_Birthday = this.maskBirthday.StrValue; model_Cus.Cus_BirthdayLunar = this.chkBirthdayLunar.Checked ? "1" : "0"; model_Cus.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(model_Cus.Cus_Birthday, this.chkBirthdayLunar.Checked); } else { model_Cus.Cus_BirthdayLunar = ""; } model_Cus.Cus_Address = this.txtAddress.Text.Trim(); model_Cus.Cus_WorkUnit = this.txtUnit.Text.Trim(); model_Cus.Cus_UpdateDateTime = strTime; model_Cus.Cus_UpdateName = strUserName; clist.Add(ctbll.GetUpdateCommandInfo(model_Cus)); IsUpdateClient = true; #endregion } if (!this.chkStoredValue.Checked) { if(ModelCard.Mc_Money>0) { MessageBoxCustom.Show("当前会员卡存在余款,不能取消储值功能。如果需要取消,请先将余款清退。"); return; } else { clist.Add(LYFZ.BLL.OrderPayment_Member.GetValidityLogs("[修改]", ModelCard.Mc_CradNumber,1, "将会员卡的储值功能取消功能。")); } } LYFZ.Model.Model_ErpMemberCardValidity modelValidity = null; if (this.mlsitValidity.Count > 0) { for (int i = 0; i < this.mlsitValidity.Count; i++) { DateTime dtTime = mlsitValidity[i].Mcvy_ValidityTime; string StrLogTime = ""; if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime))) { StrLogTime += "‘永久有效’"; } else { StrLogTime += "," + LYFZ.Command.Command_Validate.DateTimeToString(mlsitValidity[i].Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; } modelValidity = mlsitValidity[i]; switch ((LYFZ.EnumPublic.MemberFunctionAttribute)Enum.ToObject(typeof(LYFZ.EnumPublic.MemberFunctionAttribute), modelValidity.Mcvy_Type)) { case LYFZ.EnumPublic.MemberFunctionAttribute.储值: if (this.chkStoredValue_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpStoredValue.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.积分: if (this.chkPoints_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpPoints.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.返现: if (this.chkBackCash_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpBackCash.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.服务: if (this.chkService_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpService.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.新摄会: if (this.chkNewTaken_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpNewTaken.DateValue).AddDays(1).AddSeconds(-1); } break; } if (LYFZ.Command.Command_Validate.DateTimeToString(dtTime) == LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime)) { continue; } modelValidity.Mcvy_UpdateDatetime = strTime; modelValidity.Mcvy_UpdateName = strUserName; clist.Add(mcvybll.GetUpdateCommandInfo(modelValidity)); if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime))) { StrLogTime += "修改为‘永久有效’"; } else { StrLogTime += "修改为‘" + LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; } clist.Add(LYFZ.BLL.OrderPayment_Member.GetValidityLogs("[修改]", ModelCard.Mc_CradNumber, modelValidity.Mcvy_Type, StrLogTime)); } } for (int i = 1; i < 6; i++) { modelValidity = new Model.Model_ErpMemberCardValidity(); modelValidity.Mcvy_Number = ModelCard.Mc_Number; modelValidity.Mcvy_Type = i; switch ((LYFZ.EnumPublic.MemberFunctionAttribute)Enum.ToObject(typeof(LYFZ.EnumPublic.MemberFunctionAttribute), i)) { case LYFZ.EnumPublic.MemberFunctionAttribute.储值: if (this.chkStoredValue.Tag != null) { continue; } if (this.chkStoredValue_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpStoredValue.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.积分: if (this.chkPoints.Tag != null) { continue; } if (this.chkPoints_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpPoints.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.返现: if (this.chkBackCash.Tag != null) { continue; } if (this.chkBackCash_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpBackCash.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.服务: if (this.chkService.Tag != null) { continue; } if (this.chkService_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpService.DateValue).AddDays(1).AddSeconds(-1); ; } break; case LYFZ.EnumPublic.MemberFunctionAttribute.新摄会: if (this.chkNewTaken.Tag != null) { continue; } if (this.chkNewTaken_Perpetual.Checked) { modelValidity.Mcvy_ValidityTime = LYFZ.WinAPI.CustomPublicMethod.GetNullDateTime(); } else { modelValidity.Mcvy_ValidityTime = Convert.ToDateTime(this.dtpNewTaken.DateValue).AddDays(1).AddSeconds(-1); ; } break; } modelValidity.Mcvy_CreateDatetime = strTime; modelValidity.Mcvy_CreateName = strUserName; clist.Add(mcvybll.GetAddCommandInfo(modelValidity)); string StrLogTime = ""; if (string.IsNullOrEmpty(LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime))) { StrLogTime += "‘永久有效’"; } else { StrLogTime += "‘" + LYFZ.Command.Command_Validate.DateTimeToString(modelValidity.Mcvy_ValidityTime, "yyyy-MM-dd HH:mm:ss") + "’"; } clist.Add(LYFZ.BLL.OrderPayment_Member.GetValidityLogs("[新增]", ModelCard.Mc_CradNumber, modelValidity.Mcvy_Type, StrLogTime)); } if (clist.Count > 0) { if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0) { //if (modelClientGroup != null) //{ LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(modelClientGroup.GP_CustomerGroupID); } if (IsUpdateClient && !string.IsNullOrEmpty(this.StrClientNumber)) { DataTable dtc = orbll.GetView_Custom("tb_ErpCustomerGroupMembers", StrWhere: "GM_CustomerID = '" + this.StrClientNumber + "'", ShowColumnName: "GM_CustomerGroupID").Tables[0]; for (int i = 0; i < dtc.Rows.Count; i++) { LYFZ.DAL.DAL_ErpCustomer.UpdateAggregationCustomer(dtc.Rows[i]["GM_CustomerGroupID"].ToString().Trim()); } } if (IsSendSMS) { #region 流程短信 LYFZ.BLL.OrderPayment_Member.OpenMemberSendSMS(ModelCustomer.Cus_CustomerNumber, ModelCard.Mc_CradNumber, StrStoreNumber: LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID()); #endregion } this.IsSaveed = true; this.StrClientNumber = ""; MessageBoxCustom.Show("保存成功"); this.Close(); } else { MessageBoxCustom.Show("保存失败"); } } } /// /// 取消 /// /// /// protected override void btnCancel_Click(object sender, EventArgs e) { this.Close(); } /// /// 会员卡号限制输入 /// /// /// void txtCradNO_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == " ") { e.Handled = true; } } /// /// 卡号输入变化事件 /// /// /// void txtCradNO_EventTextBoxEx_TextChanged(object sender, EventArgs e) { if (this.txtCradNO.Text.Trim() != "") { char[] charList = this.txtCradNO.Text.Trim().ToCharArray(); string StrCardText = ""; for (int i = 0; i < charList.Length; i++) { if (!string.IsNullOrEmpty(charList[i].ToString().Trim())) { StrCardText += charList[i].ToString().Trim(); } } this.txtCradNO.Text = StrCardText; } } /// /// 输入限制 /// /// /// void txtSecondQueryName_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar) && !Char.IsLetterOrDigit(e.KeyChar)) { e.Handled = true; } if (LYFZ.BLL.OtherCommonModel.IsQaJiaoChar(e.KeyChar)) { e.Handled = true; } } /// /// 点击男 /// /// /// void chkMan_Click(object sender, EventArgs e) { this.chkWoman.Checked = false; this.chkMan.Checked = true; } /// /// 点击女 /// /// /// void chkWoman_Click(object sender, EventArgs e) { this.chkWoman.Checked = true; this.chkMan.Checked = false; } #region 界面管理 /// /// 选择返现 /// /// /// void chkBackCash_CheckedChanged(object sender, EventArgs e) { //if (this.chkBackCash.Checked) //{ // this.dtpBackCash.Enabled = true; // this.chkBackCash_Perpetual.Enabled = true; //} //else //{ // this.dtpBackCash.DateValue = ""; // this.dtpBackCash.Enabled = false; // this.chkBackCash_Perpetual.Checked = false; // this.chkBackCash_Perpetual.Enabled = false; //} } string StrBackCashValueTime = ""; /// /// 选择返现——永久 /// /// /// void chkBackCash_Perpetual_CheckedChanged(object sender, EventArgs e) { if (this.chkBackCash_Perpetual.Checked) { this.StrBackCashValueTime = this.dtpBackCash.DateValue; this.dtpBackCash.DateValue = ""; this.dtpBackCash.Enabled = false; } else { this.dtpBackCash.Enabled = true; this.dtpBackCash.DateValue = this.StrBackCashValueTime; } } /// /// 新摄会选择 /// /// /// void chkNewTaken_CheckedChanged(object sender, EventArgs e) { //if (this.chkNewTaken.Checked) //{ // this.dtpNewTaken.Enabled = true; // this.chkNewTaken_Perpetual.Enabled = true; //} //else //{ // this.dtpNewTaken.DateValue = ""; // this.dtpNewTaken.Enabled = false; // this.chkNewTaken_Perpetual.Checked = false; // this.chkNewTaken_Perpetual.Enabled = false; //} } string StrNewTakenValueTime = ""; /// /// 新摄会选择——永久 /// /// /// void chkNewTaken_Perpetual_CheckedChanged(object sender, EventArgs e) { if (this.chkNewTaken_Perpetual.Checked) { this.StrNewTakenValueTime = this.dtpNewTaken.DateValue; this.dtpNewTaken.DateValue = ""; this.dtpNewTaken.Enabled = false; } else { this.dtpNewTaken.Enabled = true; this.dtpNewTaken.DateValue = this.StrNewTakenValueTime; } } /// /// 选择积分 /// /// /// void chkPoints_CheckedChanged(object sender, EventArgs e) { //if (this.chkPoints.Checked) //{ // this.dtpPoints.Enabled = true; // this.chkPoints_Perpetual.Enabled = true; //} //else //{ // this.dtpPoints.DateValue = ""; // this.dtpPoints.Enabled = false; // this.chkPoints_Perpetual.Checked = false; // this.chkPoints_Perpetual.Enabled = false; //} } string StrPointsValueTime = ""; /// /// 选择积分——永久 /// /// /// void chkPoints_Perpetual_CheckedChanged(object sender, EventArgs e) { if (this.chkPoints_Perpetual.Checked) { this.StrPointsValueTime = this.dtpPoints.DateValue; this.dtpPoints.DateValue = ""; this.dtpPoints.Enabled = false; } else { this.dtpPoints.Enabled = true; this.dtpPoints.DateValue = this.StrPointsValueTime; } } /// /// 选择服务 /// /// /// void chkService_CheckedChanged(object sender, EventArgs e) { //if (this.chkService.Checked) //{ // this.dtpService.Enabled = true; // this.chkService_Perpetual.Enabled = true; //} //else //{ // this.dtpService.DateValue = ""; // this.dtpService.Enabled = false; // this.chkService_Perpetual.Checked = false; // this.chkService_Perpetual.Enabled = false; //} } string StrServiceValueTime = ""; /// /// 选择服务——永久 /// /// /// void chkService_Perpetual_CheckedChanged(object sender, EventArgs e) { if (this.chkService_Perpetual.Checked) { this.StrServiceValueTime = this.dtpService.DateValue; this.dtpService.DateValue = ""; this.dtpService.Enabled = false; } else { this.dtpService.Enabled = true; this.dtpService.DateValue = this.StrServiceValueTime; } } /// /// 选择储值 /// /// /// void chkStoredValue_CheckedChanged(object sender, EventArgs e) { //if (this.chkStoredValue.Checked) //{ // this.dtpStoredValue.Enabled = true; // this.chkStoredValue_Perpetual.Enabled = true; //} //else //{ // this.dtpStoredValue.DateValue = ""; // this.dtpStoredValue.Enabled = false; // this.chkStoredValue_Perpetual.Checked = false; // this.chkStoredValue_Perpetual.Enabled = false; //} } string StrStoredValueTime = ""; /// /// 选择储值——永久 /// /// /// void chkStoredValue_Perpetual_CheckedChanged(object sender, EventArgs e) { if (this.chkStoredValue_Perpetual.Checked) { this.StrStoredValueTime = this.dtpStoredValue.DateValue; this.dtpStoredValue.DateValue = ""; this.dtpStoredValue.Enabled = false; } else { this.dtpStoredValue.Enabled = true; this.dtpStoredValue.DateValue = this.StrStoredValueTime; } } #endregion } }