Esempio n. 1
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("会员卡号不可为空,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    return;
                }
                CMSMData.CMSMStruct.AssociatorStruct assres = new CMSMData.CMSMStruct.AssociatorStruct();
                assres = cs.GetAssociatorRelease(strCardID, out err);
                if (assres != null)
                {
                    string strAssState = assres.strAssState;
                    if (strAssState != "1")
                    {
                        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;
                    sbtnRelease.Enabled = true;
                }
                else
                {
                    MessageBox.Show("你输入的会员卡有误或者不是正常在用会员!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    if (err != null)
                    {
                        clog.WriteLine(err);
                    }
                    return;
                }
            }
        }