123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- using LYFZ.Software.MainBusiness.DoorCityProcess;
- 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
- {
- public partial class ServiceConsumeHomeSmallForm : LYFZ.Software.UI.MembershipManage.ServiceConsumeHomeSmallForm
- {
- LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
- LYFZ.BLL.BLL_ErpSMSRecord rbll = new LYFZ.BLL.BLL_ErpSMSRecord();
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.BLL.BLL_ErpMemberCardServiceContent mcscbll = new BLL.BLL_ErpMemberCardServiceContent();
- LYFZ.BLL.BLL_ErpMemberCardServiceContentUseLog mcsculog = new BLL.BLL_ErpMemberCardServiceContentUseLog();
- public ServiceConsumeHomeSmallForm()
- {
- }
- /// <summary>
- /// 当前的会员编号
- /// </summary>
- string StrNumber = "";
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void ServiceConsumeHomeSmallForm_Shown(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtTelephone);
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, LYFZ.CustomAttributes.OperatingAuthority.Member_ServiceKoufei))
- { this.btnKoufei.Enabled = false; }
- if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, LYFZ.CustomAttributes.OperatingAuthority.Member_Recharge))
- { this.btnRecharge.Enabled = false; this.btnServiceToolbox.Enabled = false; }
- }
- /// <summary>
- /// 手机号码
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtTelephone_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- string strTelephone = PublicCodeClasses.MaskedTextBoxExGetText(this.txtTelephone);
- this.txtHolder.Text = "";
- this.txtDiscount.Text = "";
- this.txtMemberCardNumber.Text = "";
- this.StrNumber = "";
- this.dgvData.Rows.Clear();
- if (strTelephone != "")
- {
- DataTable tbl = mcbll.GetView_Custom("BView_MemberMain_GoldMember", StrWhere: " 电话 = '" + strTelephone + "' and Mc_Status = '1'", ShowColumnName: "Mc_Number,会员卡号,姓名,电话,金额,折扣").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- DataRow dtRow = null;
- if (tbl.Rows.Count > 1)
- {
- LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.SelectMemberCardSuperSmallForm frm = new SuperSmallForm.SelectMemberCardSuperSmallForm();
- frm.dtDataTable = tbl;
- frm.ShowDialog();
- if (frm.IsSaveed)
- { dtRow = frm.dtRow; }
- else
- { return; }
- }
- else
- { dtRow = tbl.Rows[0]; }
- this.txtMemberCardNumber.Text = dtRow["会员卡号"].ToString().Trim();
- this.txtHolder.Text = dtRow["姓名"].ToString().Trim();
- this.txtTelephone.Text = dtRow["电话"].ToString().Trim();
- this.txtAmount.Text = dtRow["金额"].ToString().Trim();
- this.txtDiscount.Text = dtRow["折扣"].ToString().Trim();
- this.StrNumber = dtRow["Mc_Number"].ToString().Trim();
- tbl = mcscbll.GetServiceContent_Left_ServiceContentSet("Mcse_Number = '" + dtRow["Mc_Number"].ToString().Trim() + "'").Tables[0];
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewCheckBoxCell();
- cell.Value = false;
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["ID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_MemberServiceNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceContent"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceCount"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = string.IsNullOrEmpty(tbl.Rows[i]["Msc_MemberServiceNumber"].ToString_s()) ? "该服务已移除" : "";
- dgvr.Cells.Add(cell);
- this.dgvData.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- /// <summary>
- /// 会员卡
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtMemberCardNumber_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- if (txtMemberCardNumber.Text.Trim() != "")
- {
- DataTable tbl = mcbll.GetView_Custom("BView_MemberMain_GoldMember", StrWhere: " 会员卡号 = '" + txtMemberCardNumber.Text.Trim() + "' and Mc_Status = '1'", ShowColumnName: "Mc_Number,会员卡号,姓名,电话,金额,折扣").Tables[0];
- this.txtHolder.Text = "";
- this.txtTelephone.Text = "";
- this.txtDiscount.Text = "";
- this.StrNumber = "";
- this.dgvData.Rows.Clear();
- if (tbl.Rows.Count > 0)
- {
- this.txtMemberCardNumber.Text = tbl.Rows[0]["会员卡号"].ToString().Trim();
- this.txtHolder.Text = tbl.Rows[0]["姓名"].ToString().Trim();
- this.txtTelephone.Text = tbl.Rows[0]["电话"].ToString().Trim();
- this.txtAmount.Text = tbl.Rows[0]["金额"].ToString().Trim();
- this.txtDiscount.Text = tbl.Rows[0]["折扣"].ToString().Trim();
- this.StrNumber = tbl.Rows[0]["Mc_Number"].ToString().Trim();
- tbl = mcscbll.GetServiceContent_Left_ServiceContentSet("Mcse_Number = '" + tbl.Rows[0]["Mc_Number"].ToString().Trim() + "'").Tables[0];
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewCheckBoxCell();
- cell.Value = false;
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["ID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_MemberServiceNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceContent"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceCount"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = string.IsNullOrEmpty(tbl.Rows[i]["Msc_MemberServiceNumber"].ToString_s())?"该服务已移除":"";
- dgvr.Cells.Add(cell);
- this.dgvData.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- /// <summary>
- /// 列表点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void dgvData_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- if (e.RowIndex >= 0)
- {
- if (Convert.ToBoolean(this.dgvData.CurrentRow.Cells["Column6"].Value) == true)
- { this.dgvData.CurrentRow.Cells["Column6"].Value = false; }
- else
- { this.dgvData.CurrentRow.Cells["Column6"].Value = true; }
- }
- }
- }
- /// <summary>
- /// 扣费
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnKoufei_Click(object sender, EventArgs e)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- if (!LYFZ.BLL.OrderPayment_Member.VerifiedValidity(this.StrNumber, LYFZ.EnumPublic.MemberFunctionAttribute.服务))
- { MessageBoxCustom.Show("对不起!您的会员卡服务有效期已过期,无法使用!"); return; }
- string msgText = "";
-
- ArrayList Servicelist = new ArrayList();
- for (int i = 0; i < this.dgvData.Rows.Count; i++)
- {
- if (this.dgvData.Rows[i].Cells["Column4"].Value.ToString().Trim() == "")
- { this.dgvData.Rows[i].Cells["Column6"].Value = false; }
- if (Convert.ToInt32(this.dgvData.Rows[i].Cells["Column4"].Value) <= 0)
- { this.dgvData.Rows[i].Cells["Column6"].Value = false; }
- if (Convert.ToBoolean(this.dgvData.Rows[i].Cells["Column6"].Value))
- {
- if(this.dgvData.Rows[i].Cells["Column5"].Value.ToString().Trim()== "该服务已移除")
- {
- //MessageBoxCustom.Show("当前服务已被移除,无法进行扣费!");
- if(!string.IsNullOrEmpty(msgText))
- {
- msgText += "\r\n";
- }
- msgText += this.dgvData.Rows[i].Cells["Column3"].Value.ToString().Trim() + " 当前服务已移除,无法进行扣费!";
- continue;
- }
- Hashtable htData = new Hashtable();
- htData["MemberNumber"] = this.StrNumber;
- htData["MemberCardNumber"] = this.txtMemberCardNumber.Text.Trim();
- htData["ServiceID"] = this.dgvData.Rows[i].Cells["Column1"].Value.ToString().Trim();
- htData["ServiceNumber"] = this.dgvData.Rows[i].Cells["Column2"].Value.ToString().Trim();
- htData["ServiceName"] = this.dgvData.Rows[i].Cells["Column3"].Value.ToString().Trim();
- htData["ServiceCount"] = this.dgvData.Rows[i].Cells["Column4"].Value.ToString().Trim();
- htData["strTelephone"] = PublicCodeClasses.MaskedTextBoxExGetText(this.txtTelephone);
- Servicelist.Add(htData);
- }
- }
- if(!string.IsNullOrEmpty(msgText))
- {
- MessageBoxCustom.Show(msgText);
- return;
- }
- if (Servicelist.Count <= 0)
- { MessageBoxCustom.Show("没有可使用次数"); return; }
- DataTable tbl = mcbll.GetList(" Mc_Number = '" + this.StrNumber + "'").Tables[0];
- if (tbl.Rows[0]["Mc_TraderPassword"].ToString().Trim() != "")
- {
- LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.EnterPasswordSuperSmallForm Efrm = new SuperSmallForm.EnterPasswordSuperSmallForm();
- Efrm.Text = "请输入密码";
- Efrm.ShowDialog();
- if (Efrm.Pwd != "")
- {
- if (tbl.Rows[0]["Mc_TraderPassword"].ToString().Trim() != LYFZ.Command.Command_MD5.md5(Efrm.Pwd).Trim())
- { MessageBoxCustom.Show("密码错误"); return; }
- }
- else
- { return; }
- }
- #region 判断是否有欠款
- DataTable dt = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainServiceArrears("欠款", StrQueryCondition: " Where Mcpo_Number = '" + this.StrNumber + "'", StrQueryCondition2: " Where 欠款 > 0");
- if (dt.Rows.Count > 0)
- { MessageBoxCustom.Show("此会员客户有欠款!请选择交完款后再消费,谢谢合作!"); return; }
- #endregion
- if (Servicelist.Count > 1)
- {
- LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.ServiceKoufeiSuperSmallForm frm = new SuperSmallForm.ServiceKoufeiSuperSmallForm();
- frm.Servicelist = Servicelist;
- frm.ShowDialog();
- if (frm.IsSaveed)
- { GetData(); }
- }
- else
- {
- Hashtable htDatas = (Hashtable)Servicelist[0];
- DateTime strTime = SDateTime.Now;
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.GetTextSuperSmallForm frm = new CameraControlBook.SuperSmallForm.GetTextSuperSmallForm();
- frm.Text = "请输入本次消费次数(消费项:" + htDatas["ServiceCount"].ToString().Trim() + ")";
- frm.ShowDialog();
- if (frm.IsOK)
- {
- int test = 0;
- try { test = Convert.ToInt32(frm.StrValue); }
- catch { MessageBoxCustom.Show("消费次数只能输入整数"); return; }
- if (Convert.ToInt32(htDatas["ServiceCount"]) < test)
- { MessageBoxCustom.Show("本次消费次数大于可消费次数,请重新输入"); return; }
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- LYFZ.Model.Model_ErpMemberCardServiceContent model = mcscbll.GetModel("ID", htDatas["ServiceID"].ToString().Trim());
- model.Mcse_ServiceCount = model.Mcse_ServiceCount - test;
- model.Mcse_UpdateDateTime = strTime;
- model.Mcse_UpdateName = strUserID;
- clist.Add(mcscbll.GetUpdateCommandInfo(model));
- LYFZ.Model.Model_ErpMemberCardServiceContentUseLog modelLog = new Model.Model_ErpMemberCardServiceContentUseLog();
- modelLog.Mcsl_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelLog.Mcsl_Number = this.StrNumber;
- modelLog.Mcsl_MemberServiceNumber = htDatas["ServiceNumber"].ToString().Trim();
- modelLog.Mcsl_ServiceContent = htDatas["ServiceName"].ToString().Trim();
- modelLog.Mcsl_ServiceUesNumber = test;
- modelLog.Mcsl_ServiceUesAfterNumber = model.Mcse_ServiceCount;
- modelLog.Mcsl_UpdateDateTime = strTime;
- modelLog.Mcsl_UpdateName = strUserID;
- clist.Add(mcsculog.GetAddCommandInfo(modelLog));
- string StrContentText = modelLog.Mcsl_ServiceContent + "(使用" + modelLog.Mcsl_ServiceUesNumber + "次,剩余" + model.Mcse_ServiceCount + "次)。";
- tbl = sgbll.GetSystemConfigureCustom("Sconfig_IsEnabled", "Sconfig_Code = 'SMSCashSpending'").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tbl.Rows[0]["Sconfig_IsEnabled"]))
- {
- Model.Model_ErpSMSRecord modelsms = new Model.Model_ErpSMSRecord();
- modelsms.Smsr_RecipientNumber = PublicCodeClasses.MaskedTextBoxExGetText(this.txtTelephone);
- modelsms.Smsr_Content = "您会员卡" + this.txtMemberCardNumber.Text.Trim() + "于日期" + strTime.ToString("MM-dd HH:mm") + "消费:使用" + htDatas["ServiceName"].ToString().Trim() + test + "次,剩余可使用次数" + model.Mcse_ServiceCount + "次。";
- modelsms.Smsr_SendCreateDatetime = strTime;
- modelsms.Smsr_Status = "暂未发送";
- modelsms.Smsr_SendPeople = strUserID;
- modelsms.Smsr_CreateDatetime = strTime;
- clist.Add(rbll.GetAddCommandInfo(modelsms));
- }
- }
- if (clist.Count > 0)
- {
- if (MessageBoxCustom.Show("确定要消费吗", "温馨提示", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) <= 0)
- { MessageBoxCustom.Show("消费扣除次数失败"); return; }
- LYFZ.Model.Model_ErpMemberCard modelMc = mcbll.GetModel("Mc_Number", this.StrNumber);
- LYFZ.BLL.OrderPayment_Member.MemberServiceCardUse(modelMc.Mc_CustomerNumber, modelMc.Mc_CradNumber, StrContentText: StrContentText);
- this.dgvData.CurrentRow.Cells["Column4"].Value = Convert.ToInt32(htDatas["ServiceCount"]) - test;
- if (LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MemberManage, LYFZ.CustomAttributes.OperatingAuthority.Print))
- {
- LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.RechargePrintMessageSuperSmallForm frmMesg = new SuperSmallForm.RechargePrintMessageSuperSmallForm();
- frmMesg.lblNameTip = "本次消费" + test + "次数,扣除成功!";
- frmMesg.ShowDialog();
- if (frmMesg.IsSaveed)
- {
- List<Hashtable> hlist = new List<Hashtable>();
- Hashtable htData2 = new Hashtable();
- htData2["ItemName"] = modelLog.Mcsl_ServiceContent;
- htData2["UseCount"] = modelLog.Mcsl_ServiceUesNumber;
- htData2["UseAfterCount"] = modelLog.Mcsl_ServiceUesAfterNumber;
- htData2["UseTime"] = modelLog.Mcsl_UpdateDateTime.ToString("yyyy-MM-dd HH:mm");
- htData2["JingShouRen"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
- hlist.Add(htData2);
- Hashtable htDataX = new Hashtable();
- htDataX["hlist"] = hlist;
- htDataX["strNumber"] = this.StrNumber;
- LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.会员服务消费, htDataX);
- }
- }
- }
- }
- }
- }
- }
- ///// <summary>
- ///// 打印票据
- ///// </summary>
- ///// <param name="PrintType"></param>
- //void PrintBills(LYFZ.EnumPublic.PrinterType PrintType)
- //{
- // try
- // {
- // if (this.dgvData.Rows.Count > 0)
- // {
- // if (this.dgvData.CurrentRow != null)
- // {
- // if (this.dgvData.CurrentRow.Index >= 0)
- // {
- // Hashtable htData = new Hashtable();
- // htData["McNumber"] = this.StrNumber;
- // htData["PaymentItem"] = this.dgvData.CurrentRow.Cells["Column1"].Value.ToString().Trim();
- // htData["PaymentMethod"] = this.dgvData.CurrentRow.Cells["Column5"].Value.ToString().Trim();
- // htData["PaymentAmount"] = this.dgvData.CurrentRow.Cells["Column2"].Value.ToString().Trim();
- // htData["PaymentPeople"] = this.dgvData.CurrentRow.Cells["Column7"].Value.ToString().Trim();
- // new LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat().PrintFixedFormat(LYFZ.EnumPublic.PrintTypeEnum.会员充值收款, htData, PrintType);
- // }
- // }
- // }
- // }
- // catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- //}
- void GetData()
- {
- DataTable tbl = mcbll.GetView_Custom("BView_MemberMain_GoldMember", StrWhere: " 会员卡号 = '" + txtMemberCardNumber.Text.Trim() + "' and Mc_Status = '1'", ShowColumnName: "Mc_Number,会员卡号,姓名,电话,金额").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- this.txtMemberCardNumber.Text = tbl.Rows[0]["会员卡号"].ToString().Trim();
- this.txtHolder.Text = tbl.Rows[0]["姓名"].ToString().Trim();
- this.txtTelephone.Text = tbl.Rows[0]["电话"].ToString().Trim();
- this.txtAmount.Text = tbl.Rows[0]["金额"].ToString().Trim();
- this.StrNumber = tbl.Rows[0]["Mc_Number"].ToString().Trim();
- }
- tbl = mcscbll.GetServiceContent_Left_ServiceContentSet("Mcse_Number = '" + this.StrNumber + "'").Tables[0];
- this.dgvData.Rows.Clear();
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewCheckBoxCell();
- cell.Value = false;
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["ID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_MemberServiceNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceContent"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceCount"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- this.dgvData.Rows.Add(dgvr);
- }
- }
- /// <summary>
- /// 充值
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnRecharge_Click(object sender, EventArgs e)
- {
- if (StrNumber != "")
- {
- string strNumber = "";
- string msgText = "";
- for (int i = 0; i < this.dgvData.Rows.Count; i++)
- {
- if (Convert.ToBoolean(this.dgvData.Rows[i].Cells["Column6"].Value))
- {
- if (this.dgvData.Rows[i].Cells["Column5"].Value.ToString().Trim() == "该服务已移除")
- {
- //MessageBoxCustom.Show("当前服务已被移除,无法进行扣费!");
- if (!string.IsNullOrEmpty(msgText))
- {
- msgText += "\r\n";
- }
- msgText += this.dgvData.Rows[i].Cells["Column3"].Value.ToString().Trim() + " 当前服务已移除,无法进行扣费!";
- continue;
- }
- if (strNumber == "")
- { strNumber += "'" + this.dgvData.Rows[i].Cells["Column2"].Value.ToString().Trim() + "'"; }
- else { strNumber += ",'" + this.dgvData.Rows[i].Cells["Column2"].Value.ToString().Trim() + "'"; }
- }
- }
- if (!string.IsNullOrEmpty(msgText))
- {
- MessageBoxCustom.Show(msgText);
- return;
- }
- if (strNumber.Trim() != "")
- {
- Hashtable htData = new Hashtable();
- htData["MemberCardNumber"] = this.txtMemberCardNumber.Text.Trim();
- htData["MemberCardHolder"] = this.txtHolder.Text.Trim();
- htData["MemberCardAmount"] = this.txtAmount.Text.Trim();
- htData["StrNumber"] = this.StrNumber;
- LYFZ.Software.MainBusiness.MembershipManage.SuperSmallForm.ServiceRechargeSuperSmallForm frm = new SuperSmallForm.ServiceRechargeSuperSmallForm();
- frm.IntRechargeNumber = strNumber.Trim();
- frm.htData = htData;
- frm.ShowDialog();
- if (frm.IsSaveed)
- { GetData(); }
- }
- }
- else { MessageBoxCustom.Show("请您先输入会员卡号"); }
- }
- /// <summary>
- /// 服务箱
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnServiceToolbox_Click(object sender, EventArgs e)
- {
- if (this.StrNumber != "")
- {
- LYFZ.Software.MainBusiness.MembershipManage.SetSmallForm.DataSetServiceBoxSetSmallForm frm = new SetSmallForm.DataSetServiceBoxSetSmallForm();
- frm.StrNumber = this.StrNumber;
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- DataTable tbl = mcscbll.GetServiceContent_Left_ServiceContentSet("Mcse_Number = '" + this.StrNumber + "'").Tables[0];
- this.dgvData.Rows.Clear();
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewCheckBoxCell();
- cell.Value = false;
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["ID"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_MemberServiceNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceContent"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = tbl.Rows[i]["Mcse_ServiceCount"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- this.dgvData.Rows.Add(dgvr);
- }
- }
- }
- else { MessageBoxCustom.Show("请您先输入会员卡号"); }
- }
- }
- }
|