예제 #1
0
 private void txtCardID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         string strCardID = txtCardID.Text.Trim();
         if (strCardID == "0")
         {
             txtName.Text  = "";
             txtphone.Text = "";
         }
         else
         {
             Exception err = null;
             CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
             assres = cs.GetAssociatorName(strCardID, out err);
             if (assres == null || err != null)
             {
                 txtName.Text  = assres.strAssName;
                 txtphone.Text = assres.strLinkPhone;
             }
             else
             {
                 txtName.Text  = "";
                 txtphone.Text = "";
             }
         }
     }
 }
예제 #2
0
        private void frmSpecialCons_Load(object sender, System.EventArgs e)
        {
            cmbGoodsName.Text     = "请输入...";
            txtTolCount.ReadOnly  = true;
            txtTolCharge.ReadOnly = true;
            txtBalance.ReadOnly   = true;
            txtGoodsID.ReadOnly   = true;
            txtPay.ReadOnly       = true;
            txtPrice.ReadOnly     = true;

            this.label15.Visible = false;
            this.label17.Visible = false;
            this.txtPay.Visible  = false;

            this.txtAssID.Visible  = false;
            this.txtCardID.Visible = false;

            txtCount.Text   = "1";
            txtPay.Text     = "0";
            txtBalance.Text = "0";
            txtPrice.Text   = "0";

            groupBox3.BackColor = Color.Snow;

            this.cmbSepcialType.Items.Add("门店报损");
            this.cmbSepcialType.Items.Add("门店品尝");
            this.cmbSepcialType.Items.Add("门店退货");
            this.cmbSepcialType.SelectedIndex = 0;
            SpecTypeIndex = -10;

            err = null;
            CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
            assres = cs.GetAssociatorName("VMaster", out err);
            if (assres != null)
            {
                txtCardID.Text = assres.strCardID;
                txtAssID.Text  = assres.strAssID;
            }
            else
            {
                MessageBox.Show("无门店特殊客户,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (err != null)
                {
                    clog.WriteLine(err);
                }
                return;
            }

            dtConsItem = new DataTable();
            dtConsItem.Columns.Add("GoodsID");
            dtConsItem.Columns.Add("GoodsName");
            dtConsItem.Columns.Add("Price");
            dtConsItem.Columns.Add("Count");
            dtConsItem.Columns.Add("Rate");
            dtConsItem.Columns.Add("Fee");
            dtConsItem.Columns.Add("Comments");
            dtConsItem.Columns["Comments"].DefaultValue = "";
            DgBind();
        }
예제 #3
0
        private void txtCardID_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar != 13)
            {
//				if(e.KeyChar==8||e.KeyChar==42)
//				{
//					return;
//				}
//				if(e.KeyChar<48||e.KeyChar>57)
//				{
//					e.Handled=true;
//					return;
//				}
            }
            else
            {
                Ping      ping = new Ping();
                PingReply pr   = ping.Send("10.10.10.203");
                if (pr.Status != IPStatus.Success)
                {
                    MessageBox.Show("童鞋!vpn掉线了或者网速太慢!,请检查vpn连接!");
                    return;
                }

                err = null;
                string strCardID = txtCardID.Text.Trim();
                if (strCardID == "")
                {
                    MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    txtAssID.Text      = assres.strAssID;
                    txtAssName.Text    = assres.strAssName;
                    txtLinkPhone.Text  = assres.strLinkPhone;
                    txtCharge.Text     = assres.dCharge.ToString();
                    txtCardID.ReadOnly = true;
                    sbtnLose.Enabled   = true;
                }
                else
                {
                    MessageBox.Show("你输入的会员卡有误或者不是正常在用会员!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    return;
                }
            }
        }
예제 #4
0
        private void sbtnRead_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋,补充值失败!vpn掉线了或者网速太慢!,请检查vpn连接!");
                return;
            }

            string strresult = "";

            lblerr.Visible = false;
            chs            = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult != "")
                {
                    strresult = this.GetColCh(strresult, "ERR");
                }
                MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行消费!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    if (chs.dCurCharge == -1)
                    {
                        chs.dCurCharge = assres.dCharge;
                    }
                    if (chs.iCurIg == -1)
                    {
                        chs.iCurIg = assres.iIgValue;
                    }
                    txtAssID.Text       = assres.strAssID;
                    txtCardID.Text      = assres.strCardID;
                    txtAssName.Text     = assres.strAssName;
                    txtLinkPhone.Text   = assres.strLinkPhone;
                    txtCharge.Text      = chs.dCurCharge.ToString();
                    txtCardID.ReadOnly  = true;
                    sbtnFill.Enabled    = true;
                    sbtnRead.Enabled    = false;
                    txtFillFee.ReadOnly = false;
                    txtFillFee.Focus();
                }
                else
                {
                    MessageBox.Show("无此会员,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                }
            }
        }
예제 #5
0
        private void btnRead_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋,刷卡失败!vpn掉线了或者网速太慢!,请检查vpn连接!");
                return;
            }

            string strresult = "";

            CMSMStruct.CardHardStruct chs = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult != "")
                {
                    strresult = this.GetColCh(strresult, "ERR");
                }
                MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行消费撤消!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,卡号:" + chs.strCardID + ",请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }

                    err = null;
                    DataSet dsout = cs.GetAssConsLast(assres.strCardID, out err);
                    if (dsout == null || err != null)
                    {
                        MessageBox.Show(err.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
#if !DEBUG
                        if (chs.dCurCharge != Math.Round(double.Parse(dsout.Tables["CurCharge"].Rows[0]["nFeeCur"].ToString()), 2))
                        {
                            MessageBox.Show("会员卡上当前余额与上次消费后余额不相符,不能撤消!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            return;
                        }
                        else
                        {
#endif
                        txtAssID.Text     = assres.strAssID;
                        txtCurCharge.Text = chs.dCurCharge.ToString();
                        txtCardID.Text    = assres.strCardID;
                        txtAssName.Text   = assres.strAssName;

                        this.txtBillNo.Text   = dsout.Tables["Bill"].Rows[0]["iSerial"].ToString();
                        this.txtConsFee.Text  = dsout.Tables["Bill"].Rows[0]["nPay"].ToString();
                        this.txtConsDate.Text = dsout.Tables["Bill"].Rows[0]["dtTime"].ToString();

                        this.dataGrid1.SetDataBinding(dsout.Tables["ConsItem"], "");
                        this.EnToCh("商品编号,商品名称,单价,数量,折扣金额,实收金额", "80,130,70,50,60,70", dsout.Tables["ConsItem"], this.dataGrid1);

                        btnRead.Enabled        = false;
                        this.btnRemove.Enabled = true;
#if !DEBUG
                    }
#endif
                    }
                }
                else
                {
                    MessageBox.Show("无会员资料,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    return;
                }
            }
        }
예제 #6
0
        private void sbtnRead_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋!VPN掉线了或者网速太慢,请检查vpn连接!");
                return;
            }

            string strresult = "";

            lblerr.Visible = false;
            chs            = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult != "")
                {
                    strresult = this.GetColCh(strresult, "ERR");
                }
                MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            string aaccc = chs.strCardID;

//			chs.strCardID="GY000011";
            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行充值!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    if (chs.dCurCharge == -1)
                    {
                        chs.dCurCharge = assres.dCharge;
                    }
                    if (int.Parse(SysInitial.Card) == 8)
                    {
                        if (chs.dCurCharge <= 2 && assres.strAssType == "AT001")
                        {
                            double dRate = 0;
                            if (!cs.AssTypeTrans(assres.strCardID, "AT002", out dRate, out err))
                            {
                                clog.WriteLine("变更卡类型失败:" + assres.strCardID + "。\n" + err.ToString());
                            }
                            else
                            {
                                assres.strAssType = "AT002";
                                assres.dRate      = dRate;
                            }
                        }
                        if (assres.strAssType == "AT001")
                        {
                            MessageBox.Show("老卡会员不允许充值,请先将卡内余额消费完!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            return;
                        }
                    }
                    if (assres.dtCreateDate.CompareTo(SysInitial.dtQLTime) < 0 && !assres.setZeroFlag)
                    {
                        chs.iCurIg            = 0;
                        this.txtZeroFlag.Text = "1";
                    }
                    if (chs.iCurIg == -1)
                    {
                        chs.iCurIg = assres.iIgValue;
                    }
                    txtAssID.Text        = assres.strAssID;
                    txtCardID.Text       = assres.strCardID;
                    txtAssName.Text      = assres.strAssName;
                    this.txtAssType.Text = assres.strAssType;
                    txtLinkPhone.Text    = assres.strLinkPhone;
                    txtCharge.Text       = chs.dCurCharge.ToString();
                    this.txtIg.Text      = chs.iCurIg.ToString();
                    txtCardID.ReadOnly   = true;
                    sbtnFill.Enabled     = true;
                    sbtnRead.Enabled     = false;
                    txtFillFee.ReadOnly  = false;
                    txtFillFee.Focus();
                }
                else
                {
                    MessageBox.Show("无此会员,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                }
            }
        }
예제 #7
0
        private void sbtnRead_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋,刷卡失败!vpn掉线了或者网速太慢!,请检查vpn连接!");
                return;
            }

            string strresult = "";

            chs = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult != "")
                {
                    strresult = this.GetColCh(strresult, "ERR");
                }
                MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行积分兑换!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,卡号:" + chs.strCardID + ",请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    if (assres.dtCreateDate.CompareTo(SysInitial.dtQLTime) < 0 && !assres.setZeroFlag)
                    {
                        chs.iCurIg       = 0;
                        chs.needZeroFlag = true;
                    }
                    if (chs.iCurIg <= 0)
                    {
                        MessageBox.Show("当前积分不足,不能兑换!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    txtCardID.Text       = assres.strCardID;
                    txtAssName.Text      = assres.strAssName;
                    txtLinkPhone.Text    = assres.strLinkPhone;
                    txtCharge.Text       = chs.dCurCharge.ToString();
                    txtAssType.Text      = GetColCh(assres.strAssType, "AT");
                    txtAssID.Text        = assres.strAssID;
                    txtIgCur.Text        = chs.iCurIg.ToString();
                    txtGoodsID.ReadOnly  = false;
                    cmbGoodsName.Enabled = true;
                    txtCount.ReadOnly    = false;
                    sbtnRead.Enabled     = false;
                    cmbGoodsName.Focus();
                }
                else
                {
                    MessageBox.Show("无会员资料,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    return;
                }
            }
        }
예제 #8
0
        private void sbtnRead_Click(object sender, System.EventArgs e)
        {
            this.sbtnToSilver.Enabled = false;
            this.sbtnToGold.Enabled   = false;
            this.lblContent.Text      = "";
            string strresult = "";

            chs = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult != "")
                {
                    strresult = this.GetColCh(strresult, "ERR");
                }
                MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            string aaccc = chs.strCardID;

            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行充值!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "0")
                    {
                        MessageBox.Show("该会员已经失效,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    if (assres.dtCreateDate.CompareTo(SysInitial.dtQLTime) < 0 && !assres.setZeroFlag)
                    {
                        chs.iCurIg            = 0;
                        this.txtZeroFlag.Text = "1";
                    }
                    if (chs.iCurIg == -1)
                    {
                        chs.iCurIg = assres.iIgValue;
                    }
                    txtAssID.Text            = assres.strAssID;
                    txtCardID.Text           = assres.strCardID;
                    txtAssName.Text          = assres.strAssName;
                    txtLinkPhone.Text        = assres.strLinkPhone;
                    this.txtIg.Text          = chs.iCurIg.ToString();
                    this.txtAssTypeCode.Text = assres.strAssType;
                    this.txtAssType.Text     = this.GetColCh(assres.strAssType, "AT");
                    if (assres.strAssType == "AT001")
                    {
                        if (chs.iCurIg < 1000)
                        {
                            this.lblContent.Text = "该会员升级积分不足";
                        }
                        else
                        {
                            if (chs.iCurIg >= 1000)
                            {
                                this.lblContent.Text      = "该会员可由普通会员升级至银卡会员";
                                this.sbtnToSilver.Enabled = true;
                            }
                            if (chs.iCurIg >= 2000)
                            {
                                this.lblContent.Text    = "该会员可由普通会员升级至银卡会员或金卡会员";
                                this.sbtnToGold.Enabled = true;
                            }
                        }
                    }
                    if (assres.strAssType == "AT003")
                    {
                        if (chs.iCurIg < 1500)
                        {
                            this.lblContent.Text = "该会员升级积分不足";
                        }
                        else
                        {
                            this.lblContent.Text    = "该会员可由银卡会员升级至金卡会员";
                            this.sbtnToGold.Enabled = true;
                        }
                    }
                }
                else
                {
                    MessageBox.Show("无此会员,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                }
            }
        }
예제 #9
0
        private void btnRead_Click(object sender, System.EventArgs e)
        {
            Ping      ping = new Ping();
            PingReply pr   = ping.Send("10.10.10.203");

            if (pr.Status != IPStatus.Success)
            {
                MessageBox.Show("童鞋,挂失失败!vpn掉线了或者网速太慢!,请检查vpn连接!");
                return;
            }
            string strresult = "";

            CMSMStruct.CardHardStruct chs = cs.ReadCardInfo("", out strresult);
            if (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
            {
                if (strresult == CardCommon.CardDef.ConstMsg.RFAUTHENTICATION_A_ERR)
                {
                    MessageBox.Show("该卡不属于本系统使用的卡,请检查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                if (strresult.Substring(0, 2) == "RF")
                {
                    MessageBox.Show("刷卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("刷卡失败,请重试!\n" + strresult, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
                if (strresult != null)
                {
                    clog.WriteLine(strresult);
                }
                return;
            }
            if (chs.strCardID == "")
            {
                MessageBox.Show("会员卡号不正确,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else if (chs.strCardID.Substring(0, 1) == "F")
            {
                MessageBox.Show("此卡为员工卡,不可进行充值撤消!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                err = null;
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorName(chs.strCardID, out err);
                if (assres != null)
                {
                    DataRow[] drn = SysInitial.dsSys.Tables["AS"].Select("vcCommCode='" + assres.strAssState + "'");
                    if (drn == null || drn.Length == 0)
                    {
                        MessageBox.Show("会员状态参数错误,请检查参数或重新启动系统!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        string strAssState = drn[0]["vcCommName"].ToString();
                        if (assres.strAssState != "0")
                        {
                            MessageBox.Show("该会员已经失效,卡号:" + chs.strCardID + ",现处于“" + strAssState + "”状态,请核查!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            return;
                        }
                    }

                    err = null;
                    DataTable dtFillFee = cs.GetAssFillLast(assres.strCardID, out err);
                    if (dtFillFee == null || err != null)
                    {
                        MessageBox.Show(err.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        txtAssID.Text     = assres.strAssID;
                        txtCurCharge.Text = dtFillFee.Rows[0]["nFeeCur"].ToString();
                        txtCardID.Text    = assres.strCardID;
                        txtAssName.Text   = assres.strAssName;

                        this.txtFillSerial.Text = dtFillFee.Rows[0]["iSerial"].ToString();
                        this.txtFillFee.Text    = dtFillFee.Rows[0]["nFillFee"].ToString();
                        this.txtFillDate.Text   = dtFillFee.Rows[0]["dtFillDate"].ToString();
                        this.txtPromFee.Text    = dtFillFee.Rows[0]["nFillProm"].ToString();
                        strOldDate = dtFillFee.Rows[0]["dtFillDate"].ToString();

                        btnRead.Enabled        = false;
                        this.btnRemove.Enabled = true;
                    }
                }
                else
                {
                    MessageBox.Show("无会员资料,请与管理员联系!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    return;
                }
            }
        }