using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm { public partial class PointsSetSuperSmallForm : LYFZ.Software.UI.MembershipManage.SuperSmallForm.PointsSetSuperSmallForm { public PointsSetSuperSmallForm() { this.chkHaveCardPoints.Click += chkHaveCardPoints_Click; this.chkNoCardPoints.Click += chkNoCardPoints_Click; } LYFZ.BLL.BLL_ErpSystemConfigure bll = new BLL.BLL_ErpSystemConfigure(); LYFZ.BLL.BLL_ErpMemberCardPointsRuleSet mcprbll = new BLL.BLL_ErpMemberCardPointsRuleSet(); string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID; List mlist = new List(); /// /// 窗体加载事件 /// /// /// protected override void PointsSetSuperSmallForm_Shown(object sender, EventArgs e) { //DataTable tbl = bll.GetList("Sconfig_Code = 'PointToRMB'").Tables[0]; //if (tbl.Rows.Count > 0) //{ this.txtPointsToRMB_Points.Text = tbl.Rows[0]["Sconfig_Value"].ToString().Trim(); } mlist = mcprbll.GetModelList(""); } /// /// 窗体加载事件 /// /// /// protected override void PointsSetSuperSmallForm_Load(object sender, EventArgs e) { DateTime strTime = SDateTime.Now; List clist = null; LYFZ.Model.Model_ErpMemberCardPointsRuleSet model = null; bool IsWhile = true; while (IsWhile) { clist = new List(); IsWhile = false; DataTable tblPointsRule = mcprbll.GetAllList().Tables[0]; tblPointsRule.PrimaryKey = new DataColumn[] { tblPointsRule.Columns["Mcprs_Code"] }; DataRow dtRow = tblPointsRule.Rows.Find("PointToRMB_Point");//积分多少=人民币1元 if (dtRow != null) { this.txtPointsToRMB_Points.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow["Mcprs_Value"].ToString().Trim()); if (dtRow["Mcprs_Type"].ToString().Trim() == "0") { model = mcprbll.GetModel(Convert.ToInt32(dtRow["ID"])); model.Mcprs_Type = "3"; model.Mcprs_UpdateDatetime = strTime; model.Mcprs_UpdateName = strUserID; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetUpdateCommandInfo(model)); IsWhile = true; } } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "3"; model.Mcprs_Code = "PointToRMB_Point"; model.Mcprs_Name = "积分兑换人民币"; model.Mcprs_Value = 1; model.Mcprs_Remark = "积分多少=人民币1元"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow1 = tblPointsRule.Rows.Find("AgoPeriod_RMB");//前期消费多少元得1积分 if (dtRow1 != null) { this.txtAgoPeriod_RMB.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow1["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "0"; model.Mcprs_Code = "AgoPeriod_RMB"; model.Mcprs_Name = "前期消费"; model.Mcprs_Value = 1; model.Mcprs_Remark = "前期消费多少元得1积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow2 = tblPointsRule.Rows.Find("LatePeriod_RMB");//后期消费多少元得1积分 if (dtRow2 != null) { this.txtLatePeriod_RMB.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow2["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "0"; model.Mcprs_Code = "LatePeriod_RMB"; model.Mcprs_Name = "后期消费"; model.Mcprs_Value = 1; model.Mcprs_Remark = "后期消费多少元得1积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow3 = tblPointsRule.Rows.Find("txtReferral_RMB");//转介绍前期消费多少元得1积分 if (dtRow3 != null) { this.txtReferral_RMB.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow3["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "0"; model.Mcprs_Code = "txtReferral_RMB"; model.Mcprs_Name = "转介绍前期消费"; model.Mcprs_Value = 1; model.Mcprs_Remark = "转介绍前期消费多少元得1积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow4 = tblPointsRule.Rows.Find("Dianqing_Day");//店庆当天 if (dtRow4 != null) { this.txtDianqing_Day.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow4["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "Dianqing_Day"; model.Mcprs_Name = "店庆当天"; model.Mcprs_Value = 0; model.Mcprs_Remark = "店庆当天"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow5 = tblPointsRule.Rows.Find("Dianqing_Month");//店庆当月 if (dtRow5 != null) { this.txtDianqing_Month.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow5["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "Dianqing_Month"; model.Mcprs_Name = "店庆当月"; model.Mcprs_Value = 0; model.Mcprs_Remark = "店庆当月"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow6 = tblPointsRule.Rows.Find("Birthday_Day");//生日当天 if (dtRow6 != null) { this.txtBirthday_Day.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow6["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "Birthday_Day"; model.Mcprs_Name = "生日当天"; model.Mcprs_Value = 0; model.Mcprs_Remark = "生日当天"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow7 = tblPointsRule.Rows.Find("Birthday_Month");//生日当月 if (dtRow7 != null) { this.txtBirthday_Month.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow7["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "Birthday_Month"; model.Mcprs_Name = "生日当月"; model.Mcprs_Value = 0; model.Mcprs_Remark = "生日当月"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow8 = tblPointsRule.Rows.Find("WeddingAnniversary_Day");//结婚纪念日当天 if (dtRow8 != null) { this.txtWeddingAnniversary_Day.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow8["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "WeddingAnniversary_Day"; model.Mcprs_Name = "结婚纪念日当天"; model.Mcprs_Value = 0; model.Mcprs_Remark = "结婚纪念日当天"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow9 = tblPointsRule.Rows.Find("WeddingAnniversary_Month");//结婚纪念日当月 if (dtRow9 != null) { this.txtWeddingAnniversary_Month.Text = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow9["Mcprs_Value"].ToString().Trim()); } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "1"; model.Mcprs_Code = "WeddingAnniversary_Month"; model.Mcprs_Name = "结婚纪念日当月"; model.Mcprs_Value = 0; model.Mcprs_Remark = "结婚纪念日当月"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow10 = tblPointsRule.Rows.Find("PointsSet_HaveCardPoints");//有卡积分 if (dtRow10 != null) { this.chkHaveCardPoints.Checked = Convert.ToInt32(dtRow10["Mcprs_Value"]) > 0 ? true : false; } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "4"; model.Mcprs_Code = "PointsSet_HaveCardPoints"; model.Mcprs_Name = "有卡积分"; model.Mcprs_Value = 0; model.Mcprs_Remark = "积分设置有卡积分 0:为false不积分;1:为true积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow dtRow11 = tblPointsRule.Rows.Find("PointsSet_NoCardPoints");//无卡也积分 if (dtRow11 != null) { this.chkNoCardPoints.Checked = Convert.ToInt32(dtRow11["Mcprs_Value"]) > 0 ? true : false; } else { model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "4"; model.Mcprs_Code = "PointsSet_NoCardPoints"; model.Mcprs_Name = "无卡也积分"; model.Mcprs_Value = 0; model.Mcprs_Remark = "积分设置无卡也积分 0:为false不积分;1:为true积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = strUserID; clist.Add(mcprbll.GetAddCommandInfo(model)); IsWhile = true; } DataRow[] dtRow12 = tblPointsRule.Select("Mcprs_Type = '2'");//特定日期 for (int j = 0; j < dtRow12.Length; j++) { DataGridViewRow dgvr = new DataGridViewRow(); DataGridViewCell cell = null; cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dtRow12[j]["Mcprs_DateStart"].ToString().Trim()); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.Command.Command_Validate.DateTimeToString(dtRow12[j]["Mcprs_DateEnd"].ToString().Trim()); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = LYFZ.Command.Command_Validate.RemoveLastExcessZero(dtRow12[j]["Mcprs_Value"].ToString().Trim()); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = dtRow12[j]["ID"].ToString().Trim(); dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); } if (clist.Count > 0) { LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist); } } } /// /// 确定 /// /// /// protected override void btnOK_Click(object sender, EventArgs e) { DateTime strTime = SDateTime.Now; List clist = new List(); if (string.IsNullOrEmpty(this.txtPointsToRMB_Points.Text.Trim())) { MessageBoxCustom.Show("积分换人民币,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtAgoPeriod_RMB.Text.Trim())) { MessageBoxCustom.Show("前期消费获得积分,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtLatePeriod_RMB.Text.Trim())) { MessageBoxCustom.Show("后期消费获得积分,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtReferral_RMB.Text.Trim())) { MessageBoxCustom.Show("转介绍前期消费获得积分,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtDianqing_Day.Text.Trim())) { MessageBoxCustom.Show("婚庆当天倍数,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtDianqing_Month.Text.Trim())) { MessageBoxCustom.Show("婚庆当月倍数,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtBirthday_Day.Text.Trim())) { MessageBoxCustom.Show("生日当天倍数,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtBirthday_Month.Text.Trim())) { MessageBoxCustom.Show("生日当月倍数,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtWeddingAnniversary_Day.Text.Trim())) { MessageBoxCustom.Show("结婚纪念日当天倍数,不能为空!"); return; } if (string.IsNullOrEmpty(this.txtWeddingAnniversary_Month.Text.Trim())) { MessageBoxCustom.Show("结婚纪念日日当月倍数,不能为空!"); return; } #region 消费积分设置、节日积分设置 List ilist = new List(); for (int i = 0; i < mlist.Count; i++) { LYFZ.Model.Model_ErpMemberCardPointsRuleSet model = mlist[i]; if (model.Mcprs_Type.Trim() != "2") { switch (model.Mcprs_Code.Trim()) { case "PointToRMB_Point": model.Mcprs_Value = Convert.ToDecimal(this.txtPointsToRMB_Points.Text); break; case "AgoPeriod_RMB": model.Mcprs_Value = Convert.ToDecimal(this.txtAgoPeriod_RMB.Text); break; case "LatePeriod_RMB": model.Mcprs_Value = Convert.ToDecimal(this.txtLatePeriod_RMB.Text); break; case "txtReferral_RMB": model.Mcprs_Value = Convert.ToDecimal(this.txtReferral_RMB.Text); break; case "Dianqing_Day": model.Mcprs_Value = Convert.ToDecimal(this.txtDianqing_Day.Text); break; case "Dianqing_Month": model.Mcprs_Value = Convert.ToDecimal(this.txtDianqing_Month.Text); break; case "Birthday_Day": model.Mcprs_Value = Convert.ToDecimal(this.txtBirthday_Day.Text); break; case "Birthday_Month": model.Mcprs_Value = Convert.ToDecimal(this.txtBirthday_Month.Text); break; case "WeddingAnniversary_Day": model.Mcprs_Value = Convert.ToDecimal(this.txtWeddingAnniversary_Day.Text); break; case "WeddingAnniversary_Month": model.Mcprs_Value = Convert.ToDecimal(this.txtWeddingAnniversary_Month.Text); break; case "PointsSet_HaveCardPoints": model.Mcprs_Value = this.chkHaveCardPoints.Checked ? 1 : 0; break; case "PointsSet_NoCardPoints": model.Mcprs_Value = this.chkNoCardPoints.Checked ? 1 : 0; break; } model.Mcprs_UpdateDatetime = strTime; model.Mcprs_UpdateName = strUserID; clist.Add(mcprbll.GetUpdateCommandInfo(model)); ilist.Add(model.ID); } } for (int i = 0; i < ilist.Count; i++) { for (int j = 0; j < mlist.Count; j++) { if (mlist[j].ID == ilist[i]) { mlist.RemoveAt(j); } } } #endregion for (int i = 0; i < this.dgvData.Rows.Count; i++) { if (this.dgvData.Rows[i].Cells["Column4"].Value.ToString().Trim() != "")//ID是否存在 { if (this.dgvData.Rows[i].Cells["Column4"].Tag != null)//数据是否修改过 { for (int j = 0; j < mlist.Count; j++) { if (mlist[j].ID.ToString().Trim() == this.dgvData.Rows[i].Cells["Column4"].Value.ToString().Trim()) { LYFZ.Model.Model_ErpMemberCardPointsRuleSet model = mlist[j]; model.Mcprs_DateStart = Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column1"].Value); model.Mcprs_DateEnd = Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column2"].Value); model.Mcprs_Value = Convert.ToDecimal(this.dgvData.Rows[i].Cells["Column3"].Value); model.Mcprs_UpdateDatetime = strTime; model.Mcprs_UpdateName = strUserID; clist.Add(mcprbll.GetUpdateCommandInfo(model)); break; } } } } else { LYFZ.Model.Model_ErpMemberCardPointsRuleSet model = new Model.Model_ErpMemberCardPointsRuleSet(); model.Mcprs_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID(); model.Mcprs_Type = "2"; model.Mcprs_Code = "[" + this.dgvData.Rows[i].Cells["Column1"].Value + "]-[" + this.dgvData.Rows[i].Cells["Column2"].Value + "]"; model.Mcprs_Name = "[" + Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column1"].Value).ToString("MM-dd") + "]-[" + Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column2"].Value).ToString("MM-dd") + "]"; model.Mcprs_DateStart = Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column1"].Value); model.Mcprs_DateEnd = Convert.ToDateTime(this.dgvData.Rows[i].Cells["Column2"].Value); model.Mcprs_Value = Convert.ToDecimal(this.dgvData.Rows[i].Cells["Column3"].Value); model.Mcprs_Remark = "特定日期[" + this.dgvData.Rows[i].Cells["Column1"].Value + "]-[" + this.dgvData.Rows[i].Cells["Column2"].Value + "]得" + this.dgvData.Rows[i].Cells["Column3"].Value + "积分"; model.Mcprs_CreateDatetime = strTime; model.Mcprs_CreateName = ""; clist.Add(mcprbll.GetAddCommandInfo(model)); } } if (clist.Count > 0) { if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) <= 0) { MessageBoxCustom.Show("保存失败"); } LYFZ.BLL.BLL_ErpMemberCard.AgainGettblPointsRule(); MessageBoxCustom.Show("保存成功"); this.Close(); } } /// /// 关闭 /// /// /// protected override void btnClose_Click(object sender, EventArgs e) { this.Close(); } /// /// 有卡积分 /// /// /// void chkHaveCardPoints_Click(object sender, EventArgs e) { if (!this.chkHaveCardPoints.Checked) { this.chkNoCardPoints.Checked = false; } } /// /// 无卡也积分 /// /// /// void chkNoCardPoints_Click(object sender, EventArgs e) { if (!this.chkHaveCardPoints.Checked) { this.chkHaveCardPoints.Checked = true; } } /// /// 删除特定日期 /// /// /// protected override void btnDelete_Click(object sender, EventArgs e) { if (this.dgvData.Rows.Count > 0) { if (this.dgvData.CurrentCell.ColumnIndex >= 0 && this.dgvData.CurrentRow.Index >= 0) { if (MessageBoxCustom.Show("删除后则不能恢复,你确定要删除吗?", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } this.dgvData.Rows.RemoveAt(this.dgvData.CurrentRow.Index); } } } /// /// 添加特定日期 /// /// /// protected override void btnAddDate_Click(object sender, EventArgs e) { LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.ParticularDateSetSetSuperSmallForm frm = new ParticularDateSetSetSuperSmallForm(); frm.mlist = this.mlist; frm.ShowDialog(); if (frm.IsSaveed) { DataGridViewRow dgvr = new DataGridViewRow(); DataGridViewCell cell = null; cell = new DataGridViewTextBoxCell(); cell.Value = frm.strStartDate.Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = frm.strEndDate.Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = frm.strValue.Trim(); dgvr.Cells.Add(cell); cell = new DataGridViewTextBoxCell(); cell.Value = ""; dgvr.Cells.Add(cell); this.dgvData.Rows.Add(dgvr); } } LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.PointsRuleMultipleTestSuperSmallForm frm = null; /// /// 测试 /// /// /// protected override void btnTest_Click(object sender, EventArgs e) { if (frm != null) { frm.Close(); } frm = new PointsRuleMultipleTestSuperSmallForm(); frm.Show(); } /// /// 列表双击事件 /// /// /// protected override void dgvData_MouseDoubleClick(object sender, MouseEventArgs e) { if (this.dgvData.Rows.Count > 0) { if (this.dgvData.CurrentRow.Index >= 0 && this.dgvData.CurrentCell.ColumnIndex >= 0) { LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.ParticularDateSetSetSuperSmallForm frm = new ParticularDateSetSetSuperSmallForm(); frm.mlist = this.mlist; frm.strID = this.dgvData.CurrentRow.Cells["Column4"].Value.ToString().Trim(); frm.strStartDate = this.dgvData.CurrentRow.Cells["Column1"].Value.ToString().Trim(); frm.strEndDate = this.dgvData.CurrentRow.Cells["Column2"].Value.ToString().Trim(); frm.strValue = this.dgvData.CurrentRow.Cells["Column3"].Value.ToString().Trim(); frm.ShowDialog(); if (frm.IsSaveed) { this.dgvData.CurrentRow.Cells["Column1"].Value = frm.strStartDate.Trim(); this.dgvData.CurrentRow.Cells["Column2"].Value = frm.strEndDate.Trim(); this.dgvData.CurrentRow.Cells["Column3"].Value = frm.strValue.Trim(); this.dgvData.CurrentRow.Cells["Column4"].Tag = "1"; } } } } /// /// 前期消费_积分限制输入 /// /// /// protected override void txtAgoPeriod_Points_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 前期消费_人民币限制输入 /// /// /// protected override void txtAgoPeriod_RMB_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 生日_当天限制输入 /// /// /// protected override void txtBirthday_Day_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtBirthday_Day.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 生日_当月限制输入 /// /// /// protected override void txtBirthday_Month_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtBirthday_Month.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 店庆_当天限制输入 /// /// /// protected override void txtDianqing_Day_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtDianqing_Day.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 店庆_当月限制输入 /// /// /// protected override void txtDianqing_Month_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtDianqing_Month.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 后期消费_积分限制输入 /// /// /// protected override void txtLatePeriod_Points_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 后期消费_人民币限制输入 /// /// /// protected override void txtLatePeriod_RMB_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 积分换人民币_积分限制输入 /// /// /// protected override void txtPointsToRMB_Points_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 积分换人民币_人民币限制输入 /// /// /// protected override void txtPointsToRMB_RMB_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 转介绍_积分限制输入 /// /// /// protected override void txtReferral_Points_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 转介绍_人民币限制输入 /// /// /// protected override void txtReferral_RMB_KeyPress(object sender, KeyPressEventArgs e) { if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 结婚纪念日当天限制输入 /// /// /// protected override void txtWeddingAnniversary_Day_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtWeddingAnniversary_Day.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } /// /// 结婚纪念日当月限制输入 /// /// /// protected override void txtWeddingAnniversary_Month_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToString(e.KeyChar) == ".") { if (this.txtWeddingAnniversary_Month.Text.Trim().IndexOf('.') != -1) { e.Handled = true; } } else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { e.Handled = true; } } } }