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;
///
/// 本地分店ID
///
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 clist = new List();
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 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() == "返现副卡")
{
//XXX 为客户姓名;XXN 为会员卡号;TEXT 为获得返现金内容(如:本次某某朋友为您返现金5000元); XXT 为获得返现金时间
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 { }
//DataTable tbl = orbll.GetView_Custom("tempTB_AggregationCustomer", StrWhere: "GP_OrderNumber = '" + this.StrOrdNumber + "'", ShowColumnName: "M_Cus_CustomerNumber").Tables[0];
//if (tbl.Rows.Count > 0)
//{
// int IntPointsIntr = LYFZ.BLL.BLL_ErpMemberCard.GetPoints_AgoPeriod(LYFZ.EnumPublic.MemberPointsType.txtReferral_RMB, Convert.ToDecimal(this.txtSeriesPrice.Text), LYFZ.BLL.OrderPayment_Member.StrInfoID, tbl.Rows[0]["M_Cus_CustomerNumber"].ToString().Trim());
// sparameters.CurrentSpendingMemberID = dt.Rows[0]["Mc_CustomerNumber"].ToString().Trim();
// sparameters.CardNumber = dt.Rows[0]["Mc_CradNumber"].ToString().Trim();
// sparameters.XXT = strTime;
// sparameters.TEXT = "您朋友持积分副卡" + modelViceCard.Mvc_ViceCardNumber + "来订单,获得" + IntPointsIntr + "积分";
// sparameters.ReferralsBonusPoints = IntPointsIntr;
// try
// { 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)
{
//this.GetViceCardData();
}
///
/// 获取副卡资料
///
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 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;
}
}
}
}