示例#1
0
        private void bttmoney_Click(object sender, EventArgs e)
        {
            //如果未检测到可用卡,则提示信息
            if (string.IsNullOrEmpty(txtxiaofeiID.Text))
            {
                MessageBox.Show("未检测到可用账户!");
                return;
            }
            else if (UserInfoManage.GetSelectUserinfoByID(txtxiaofeiID.Text) == null)
            {
                MessageBox.Show("此卡还未开通,请开卡或换卡!");
                return;
            }
            else if (string.IsNullOrEmpty(txtxiaofeiMoney.Text))
            {
                MessageBox.Show("请先输入充值金额!");
                return;
            }
            else if (int.Parse(this.txtxiaofeiMoney.Text) <= 0)
            {
                MessageBox.Show("请输入有效的充值金额!");
                return;
            }
            Userinfo userinfo = new Userinfo();

            userinfo.UsercardID = this.txtxiaofeiID.Text;
            userinfo.UserName   = this.txtxiaofeiName.Text;
            userinfo.UserMoney  = decimal.Parse(this.txtxiaofeiMoney.Text);
            if (UserInfoManage.UpdateUserinfo(userinfo))
            {
                MessageBox.Show("充值成功!");
            }
        }