123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521 |
- using LYFZ.Software.MainBusiness.DoorCityProcess;
- 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;
- namespace LYFZ.Software.MainBusiness.MembershipManage.SetSmallForm
- {
- public partial class ViceCardConsumeSmallForm : LYFZ.Software.UI.MembershipManage.SetSmallForm.ViceCardConsumeSmallForm
- {
- public ViceCardConsumeSmallForm()
- {
- this.Load += ViceCardConsumeSmallForm_Load;
- this.btnClose.Click += btnClose_Click;
- this.btnUse.Click += btnUse_Click;
- this.btnFind.Click += btnFind_Click;
- this.btnOrderFind.Click += btnOrderFind_Click;
- this.txtInputViceCard.KeyDown += txtInputViceCard_KeyDown;
- this.txtInputViceCard.Leave += txtInputViceCard_Leave;
- this.lstTextQuery.MouseDoubleClick += lstTextQuery_MouseDoubleClick;
- this.lstTextQuery.KeyDown += lstTextQuery_KeyDown;
- this.panelEx1.Click += panelEx1_Click;
- this.panelEx8.Click += panelEx8_Click;
- this.txtTextQuery.EventTextBoxEx_TextChanged += txtTextQuery_EventTextBoxEx_TextChanged;
- this.txtTextQuery.Click += txtTextQuery_Click;
- this.txtTextQuery.KeyDown += txtTextQuery_KeyDown;
- }
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpMemberCard mcbll = new BLL.BLL_ErpMemberCard();
- LYFZ.BLL.BLL_SMSTemplates smsTemplates = new BLL.BLL_SMSTemplates();
- LYFZ.BLL.BLL_ErpCustomerGroup ctgpbll = new BLL.BLL_ErpCustomerGroup();
- LYFZ.BLL.BLL_ErpSystemConfigure scbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.BLL.BLL_ErpMemberCardPoints mcpsbll = new BLL.BLL_ErpMemberCardPoints();
- LYFZ.BLL.BLL_ErpMemberCardViceCard mcvbll = new BLL.BLL_ErpMemberCardViceCard();
- LYFZ.BLL.BLL_ErpMemberCardBackCash mcbcbll = new BLL.BLL_ErpMemberCardBackCash();
- LYFZ.BLL.BLL_ErpMemberCardOperateLOG mcopbll = new BLL.BLL_ErpMemberCardOperateLOG();
- LYFZ.BLL.BLL_ErpMemberCardPointsLOG mcpsLogbll = new BLL.BLL_ErpMemberCardPointsLOG();
- LYFZ.BLL.BLL_ErpMemberCardBackCashSet mcbcsetbll = new BLL.BLL_ErpMemberCardBackCashSet();
- LYFZ.BLL.BLL_ErpMemberCardAmountChangeLOG mcacbll = new BLL.BLL_ErpMemberCardAmountChangeLOG();
- string StrOrdNumber = "";
- decimal decBackCashCoefficient = 1;
- LYFZ.Model.Model_ErpMemberCardBackCashSet modelMcBcSet = null;
-
-
-
- string strInfoID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
-
-
-
-
-
- void ViceCardConsumeSmallForm_Load(object sender, EventArgs e)
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'BackCashCoefficient'", ShowColumnName: "Sconfig_Value").Tables[0];
- if (tbl.Rows.Count > 0)
- { this.decBackCashCoefficient = Convert.ToDecimal(tbl.Rows[0]["Sconfig_Value"].ToString().Trim()); }
- else
- {
- LYFZ.Model.Model_ErpSystemConfigure model = new Model.Model_ErpSystemConfigure();
- model.Sconfig_Code = "BackCashCoefficient";
- model.Sconfig_Name = "返现系数";
- model.Sconfig_Value = "1";
- model.Sconfig_IsEnabled = true;
- model.Sconfig_Type = "";
- model.Sconfig_Remark = "返现系数(实现返现范围)";
- model.Sconfig_Order = 0;
- model.Sconfig_CreateDatetime = SDateTime.Now;
- model.Sconfig_CreateName = "";
- scbll.Add(model);
- }
- }
-
-
-
-
-
- void btnClose_Click(object sender, EventArgs e)
- { this.Close(); }
-
-
-
-
-
- void btnUse_Click(object sender, EventArgs e)
- {
- if (this.txtViceCardNumber.Text.Trim() != "")
- {
- DateTime strTime = SDateTime.Now;
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- List<Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- LYFZ.Model.Model_ErpMemberCardViceCard modelViceCard = mcvbll.GetModel(Convert.ToInt32(this.txtViceCardNumber.Tag));
- decimal DecBackCashAmount = 0;
- Model.SMSParameters sparameters = new Model.SMSParameters();
- if (this.txtViceCardType.Text.Trim() == "返现副卡")
- {
- #region 返现副卡
- string StrRemark = "";
- bool IsValidity = LYFZ.BLL.OrderPayment_Member.VerifiedValidity(modelViceCard.Mvc_Number, LYFZ.EnumPublic.MemberFunctionAttribute.返现);
- if (!IsValidity)
- {
- StrRemark = "主卡返现有效期已过,不支持返现!";
- MessageBoxCustom.Show("对不起!您所持的副卡所属的主卡返现有效期已过期,即时副卡只作回收将无法返现!");
- }
- modelViceCard.Mvc_Status = "2";
- modelViceCard.Mvc_UpdateDateTime = strTime;
- modelViceCard.Mvc_UpdateName = strUserID;
- modelViceCard.Mvc_Remark = StrRemark;
- clist.Add(mcvbll.GetUpdateCommandInfo(modelViceCard));
- LYFZ.Model.Model_ErpMemberCardOperateLOG modelopLog = new Model.Model_ErpMemberCardOperateLOG();
- modelopLog.mcol_DividedShop = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- modelopLog.mcol_Number = modelViceCard.Mvc_ViceNumber;
- modelopLog.mcol_Type = "4";
- modelopLog.mcol_Remark = StrRemark;
- modelopLog.mcol_CreateDatetime = strTime;
- modelopLog.mcol_CreateName = strUserID;
- clist.Add(mcopbll.GetAddCommandInfo(modelopLog));
- if (IsValidity)
- {
- if (this.txtBackCashAmount.Tag != null)
- {
- if (this.txtSeriesPrice.Text.Trim() == "")
- { MessageBoxCustom.Show("请选择您要返现订单!"); return; }
- if (Convert.ToDecimal(this.txtBackCashAmount.Tag) <= Convert.ToDecimal(this.txtSeriesPrice.Text))
- {
- if (this.modelMcBcSet == null)
- {
- if (MessageBoxCustom.Show("此返现副所属的主卡返现次数已经使用完,是否要回收副卡?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- }
- else
- {
- this.modelMcBcSet.Mcb_IsSpending = 1;
- this.modelMcBcSet.Mcb_ViceNumber = modelViceCard.Mvc_ViceNumber;
- this.modelMcBcSet.Mcb_OrderNumber = this.StrOrdNumber.Trim();
- this.modelMcBcSet.Mcb_SpendingTime = strTime;
- this.modelMcBcSet.Mcb_UpdateDateTime = strTime;
- this.modelMcBcSet.Mcb_UpdateName = strUserID;
- LYFZ.Model.Model_ErpMemberCardBackCash modelBackCash = mcbcbll.GetModel("Mcbc_Number", modelViceCard.Mvc_Number);
- DataTable tbl = orbll.GetView_Custom("tb_ErpMemberCardBackCashSet", StrWhere: "Mcb_Number = '" + modelViceCard.Mvc_Number + "' and Mcb_CashBackGroup = '" + modelViceCard.Mvc_CashBackGroup + "'", ShowColumnName: "Mcb_CashBackAmount,Mcb_IsSpending").Tables[0];
- DataRow[] dtRow = tbl.Select("Mcb_IsSpending = '0'");
- if (dtRow.Length == 1)
- {
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["Mcb_IsSpending"].ToString().Trim() == "1")
- {
- if (tbl.Rows[i]["Mcb_CashBackAmount"].ToString().Trim() != "")
- { DecBackCashAmount += Convert.ToDecimal(tbl.Rows[i]["Mcb_CashBackAmount"]); }
- }
- }
- DecBackCashAmount = Convert.ToDecimal(this.txtBackCashAmount.Text) - DecBackCashAmount;
- }
- else
- { DecBackCashAmount = (this.modelMcBcSet.Mcb_Proportion / 100) * Convert.ToDecimal(this.txtBackCashAmount.Text); }
- List<LYFZ.Model.Model_ErpMemberCardViceCard> mlist = mcvbll.GetModelList("Mvc_Number = '" + modelViceCard.Mvc_Number + "' and Mvc_ViceCardType = '返现副卡' and Mvc_CashBackGroup = '" + modelViceCard.Mvc_CashBackGroup + "' and Mvc_Status = '1'");
- if (mlist.Count == 1)
- {
- modelBackCash.Mcbc_PackagesMoney = 0;
- modelBackCash.Mcbc_CashBackNumber = 0;
- modelBackCash.Mcbc_CashBackProportion = "";
- }
- modelBackCash.Mcbc_AlreadyCashBack += DecBackCashAmount;
- modelBackCash.Mcbc_UpdateDateTime = strTime;
- modelBackCash.Mcbc_UpdateName = strUserID;
- clist.Add(mcbcbll.GetUpdateCommandInfo(modelBackCash));
- this.modelMcBcSet.Mcb_CashBackAmount = DecBackCashAmount;
- clist.Add(mcbcsetbll.GetUpdateCommandInfo(this.modelMcBcSet));
- }
- }
- else
- { MessageBoxCustom.Show("订单套系不在返现套系范围内!"); return; }
- }
- }
- #endregion
- }
- else if (this.txtViceCardType.Text.Trim() == "积分副卡")
- {
- if (string.IsNullOrEmpty(this.StrOrdNumber))
- { MessageBoxCustom.Show("请选择使用的订单!"); return; }
- clist.AddRange(LYFZ.Software.MainBusiness.MembershipManage.MemberPublicClass.ViceCardUse_MainCardPoints(modelViceCard.Mvc_ViceNumber, ref sparameters, StrOrdNumber: this.StrOrdNumber, strTime: strTime));
- }
- if (clist.Count > 0)
- {
- if (MessageBoxCustom.Show("是否要使用?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
- { return; }
- if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) <= 0)
- { MessageBoxCustom.Show("使用失败!"); }
- else
- {
- System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate()
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_Number = '" + modelViceCard.Mvc_Number + "' And Mc_CradNumber != ''", ShowColumnName: "Mc_CustomerNumber,Mc_CradNumber").Tables[0];
- if (dt.Rows.Count > 0)
- {
- if (this.txtViceCardType.Text.Trim() == "返现副卡")
- {
-
- sparameters = new Model.SMSParameters();
- sparameters.CurrentSpendingMemberID = dt.Rows[0]["Mc_CustomerNumber"].ToString().Trim();
- sparameters.CardNumber = dt.Rows[0]["Mc_CradNumber"].ToString().Trim();
- sparameters.XXT = strTime;
- sparameters.TEXT = "您朋友持返现副卡" + this.txtInputViceCard.Text.Trim() + "来订单,获得返现" + DecBackCashAmount + "元";
- sparameters.ReferralsBonusPoints = 0;
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.会员返现卡获得返现金后X分钟, sparameters); }
- catch { }
- }
- else
- {
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.当积分达到或超过X分时, sparameters); }
- catch { }
- try
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.当积分接近X的百分之80时, sparameters); }
- catch { }
- try
- {
- if (!string.IsNullOrEmpty(sparameters.TEXT))
- { smsTemplates.GenerateEventSMS(EnumPublic.SmsSendEvent.会员积分变动后X分钟, sparameters); }
- }
- catch { }
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- }));
- t.Start();
- MessageBoxCustom.Show("使用完成!");
- this.GetClearData();
- }
- }
- }
- else
- { MessageBoxCustom.Show("请输入你要消费的副卡号"); }
- }
-
-
-
-
-
- void btnFind_Click(object sender, EventArgs e)
- { this.GetViceCardData(); }
-
-
-
-
-
- void btnOrderFind_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.CameraControlBook.PublicClass.InputQueryClient(this.txtTextQuery, this.lstTextQuery, 180);
- }
-
-
-
-
-
- void txtInputViceCard_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.GetViceCardData(); }
- }
-
-
-
-
-
- void txtInputViceCard_Leave(object sender, EventArgs e)
- {
-
- }
-
-
-
- void GetViceCardData()
- {
- if (this.txtInputViceCard.Text.Trim() != "")
- {
- DataTable tbl = orbll.GetView_Custom("tb_ErpMemberCardViceCard left join tb_ErpMemberCard on Mc_Number = Mvc_Number left join tb_ErpCustomer on Cus_CustomerNumber = Mc_CustomerNumber left join tb_ErpMemberCardBackCash on Mc_Number = Mcbc_Number", StrWhere: "Mvc_ViceCardNumber = '" + this.txtInputViceCard.Text.Trim() + "' and Mvc_Status = '1'", ShowColumnName: "tb_ErpMemberCardViceCard.ID,Mvc_Number,Mvc_ViceCardNumber,Mvc_ViceCardType,Cus_Name,Cus_Telephone,Mcbc_PackagesMoney").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- this.txtViceCardNumber.Text = tbl.Rows[0]["Mvc_ViceCardNumber"].ToString().Trim();
- this.txtViceCardNumber.Tag = tbl.Rows[0]["ID"].ToString().Trim();
- this.txtViceCardType.Text = tbl.Rows[0]["Mvc_ViceCardType"].ToString().Trim();
- this.txtHolder.Text = tbl.Rows[0]["Cus_Name"].ToString().Trim();
- if (tbl.Rows[0]["Mvc_ViceCardType"].ToString().Trim() == "返现副卡")
- {
- this.txtBackCashAmount.Text = tbl.Rows[0]["Mcbc_PackagesMoney"].ToString().Trim();
- this.txtBackCashAmount.Tag = Convert.ToDecimal(tbl.Rows[0]["Mcbc_PackagesMoney"]) * decBackCashCoefficient;
- this.panelBackCashAmount.Visible = true;
- List<LYFZ.Model.Model_ErpMemberCardBackCashSet> mlistBackCashSet = mcbcsetbll.GetModelList("Mcb_Number = '" + tbl.Rows[0]["Mvc_Number"].ToString().Trim() + "' and (Mcb_ViceNumber = '' or Mcb_ViceNumber is NULL)");
- if (mlistBackCashSet.Count > 0)
- { this.modelMcBcSet = mlistBackCashSet[0]; }
- if (!this.panelEx1.Visible)
- {
- this.panelEx1.Visible = true;
- this.Height += this.panelEx1.Height;
- }
- }
- else if (tbl.Rows[0]["Mvc_ViceCardType"].ToString().Trim() == "积分副卡")
- { this.panelBackCashAmount.Visible = false; }
- else
- {
- this.panelBackCashAmount.Visible = false;
- this.txtBackCashAmount.Tag = null;
- this.modelMcBcSet = null;
- if (this.panelEx1.Visible)
- {
- this.panelEx1.Visible = false;
- this.Height -= this.panelEx1.Height;
- }
- }
- }
- else
- {
- MessageBoxCustom.Show("未找到副卡'" + this.txtInputViceCard.Text.Trim() + "',或已回收,请核对!");
- this.GetClearData();
- return;
- }
- }
- else
- { this.GetClearData(); }
- }
-
-
-
- void GetClearData()
- {
- this.txtViceCardNumber.Text = "";
- this.txtViceCardNumber.Tag = "";
- this.txtViceCardType.Text = "";
- this.txtHolder.Text = "";
- this.txtBackCashAmount.Text = "";
- this.txtBackCashAmount.Tag = null;
- this.modelMcBcSet = null;
- this.txtOrderNumber.Text = "";
- this.txtSeriesName.Text = "";
- this.txtOrdersPerson.Text = "";
- this.txtSeriesPrice.Text = "";
- this.txtManName.Text = "";
- this.txtWomanName.Text = "";
- this.txtInputViceCard.Text = "";
- this.txtTextQuery.Text = "";
- this.StrOrdNumber = "";
- this.lstTextQuery.Visible = false;
- }
-
-
-
-
-
- void lstTextQuery_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (this.lstTextQuery.Items.Count > 0)
- {
- if (((ListItem)this.lstTextQuery.SelectedItem) != null)
- {
- if (string.IsNullOrEmpty(this.txtViceCardNumber.Text.Trim()) || this.txtViceCardNumber.Tag == null)
- { MessageBoxCustom.Show("请先输入副卡"); return; }
- this.GetOrdNumberGetData(((ListItem)this.lstTextQuery.SelectedItem).StrValue.ToString().Trim());
- this.txtTextQuery.Text = ((ListItem)this.lstTextQuery.SelectedItem).StrText;
- }
- }
- this.lstTextQuery.Visible = false;
- }
-
-
-
-
-
- void lstTextQuery_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.lstTextQuery_MouseDoubleClick(this, null); }
- }
-
-
-
-
-
- void panelEx1_Click(object sender, EventArgs e)
- { this.lstTextQuery.Visible = false; }
-
-
-
-
-
- void panelEx8_Click(object sender, EventArgs e)
- { this.lstTextQuery.Visible = false; }
-
-
-
-
-
- void txtTextQuery_EventTextBoxEx_TextChanged(object sender, EventArgs e)
- {
- if (this.txtTextQuery.Text.Trim() == "")
- { this.lstTextQuery.Visible = true; }
- }
-
-
-
-
-
- void txtTextQuery_Click(object sender, EventArgs e)
- { this.txtTextQuery_EventTextBoxEx_TextChanged(null, null); }
-
-
-
-
-
- void txtTextQuery_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)
- { this.lstTextQuery.SelectedIndex = 0; this.lstTextQuery.Focus(); }
- else if (e.KeyCode == Keys.Enter)
- { this.btnOrderFind_Click(this, null); }
- }
-
-
-
-
- void GetOrdNumberGetData(string OrdNumber)
- {
- string strViewName = "tb_ErpOrder left join dbo.tempTB_AggregationCustomer on Ord_Number = GP_OrderNumber";
- string strColumnName = "Ord_SeriesPrice,Cus_Name,Cus_Sex_cs,CASE [Ord_SinceOrderNumber] WHEN '' THEN Ord_Number ELSE Ord_SinceOrderNumber END AS ShowOrdNumber,Ord_SeriesName,Ord_Type,(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName( OrdPe_OrdersPerson) from tb_ErpOrdersPerson where OrdPe_OrderNumber=Ord_Number for xml path('')),1,1,'')) as OrdPe_OrdersPerson";
- DataTable tbl = orbll.GetView_Custom(strViewName, StrWhere: "Ord_Number = '" + OrdNumber + "'", filedOrder: "Ord_Number ASC", ShowColumnName: strColumnName).Tables[0];
- if (tbl.Rows.Count > 0)
- {
- this.txtOrderNumber.Text = tbl.Rows[0]["ShowOrdNumber"].ToString().Trim();
- this.txtSeriesName.Text = tbl.Rows[0]["Ord_SeriesName"].ToString().Trim();
- this.txtOrdersPerson.Text = tbl.Rows[0]["OrdPe_OrdersPerson"].ToString().Trim();
- this.txtSeriesPrice.Text = tbl.Rows[0]["Ord_SeriesPrice"].ToString().Trim();
- string[] StrNameArray = tbl.Rows[0]["Cus_Name"].ToString().Trim().Split('/');
- string[] StrSexArray = tbl.Rows[0]["Cus_Sex_cs"].ToString().Trim().Split('/');
- if (tbl.Rows[0]["Ord_Type"].ToString().Trim() == "0")
- {
- if (StrNameArray.Length > 1)
- {
- if (StrSexArray[0].Trim() == "男")
- { this.lblName1.Text = "男宾姓名:"; }
- else if (StrSexArray[0].Trim() == "女")
- { this.lblName2.Text = "女宾姓名:"; }
- this.txtManName.Text = StrNameArray[0].Trim();
- if (StrSexArray[1].Trim() == "男")
- { this.lblName1.Text = "男宾姓名:"; }
- else if (StrSexArray[1].Trim() == "女")
- { this.lblName2.Text = "女宾姓名:"; }
- this.txtWomanName.Text = StrNameArray[1].Trim();
- }
- else
- {
- this.lblName1.Text = "男宾姓名:";
- this.lblName2.Text = "女宾姓名:";
- if (StrSexArray[0].Trim() == "男")
- { this.txtManName.Text = StrNameArray[0].Trim(); }
- else if (StrSexArray[0].Trim() == "女")
- { this.txtWomanName.Text = StrNameArray[0].Trim(); }
- }
- this.lblName1.Location = new Point(15, this.lblName1.Location.Y);
- this.lblName2.Location = new Point(218, this.lblName2.Location.Y);
- }
- else if (tbl.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- this.lblName1.Text = "宝贝姓名:";
- this.lblName2.Text = "家长姓名:";
- this.txtManName.Text = StrNameArray[0].Trim();
- this.txtWomanName.Text = StrNameArray[1].Trim();
- this.lblName1.Location = new Point(26, this.lblName1.Location.Y);
- this.lblName2.Location = new Point(229, this.lblName2.Location.Y);
- }
- else if (tbl.Rows[0]["Ord_Type"].ToString().Trim() == "2" || tbl.Rows[0]["Ord_Type"].ToString().Trim() == "3")
- {
- this.lblName1.Text = "客户姓名:";
- this.lblName2.Text = "客户性别:";
- this.txtManName.Text = StrNameArray[0].Trim();
- this.txtWomanName.Text = StrSexArray[0].Trim();
- this.lblName1.Location = new Point(26, this.lblName1.Location.Y);
- this.lblName2.Location = new Point(229, this.lblName2.Location.Y);
- }
- this.btnUse.Enabled = true;
- if (this.txtViceCardType.Text.Trim() == "积分副卡")
- {
- if (!LYFZ.BLL.OrderPayment_Member.IsFriendIntroducedPoints(OrdNumber))
- { this.btnUse.Enabled = false; MessageBoxCustom.Show("此订单已经使用朋友转介绍过,不能再使用!"); return; }
- }
- else if (this.txtViceCardType.Text.Trim() == "返现副卡")
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpMemberCardBackCashSet", StrWhere: "Mcb_OrderNumber = '" + OrdNumber + "'", ShowColumnName: "ID");
- DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
- if (dtSet.Tables["ds"].Rows.Count > 0)
- { this.btnUse.Enabled = false; MessageBoxCustom.Show("此订单已经返现过,不能再使用!"); return; }
- }
- this.StrOrdNumber = OrdNumber;
- }
- }
- }
- }
|