Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = "";//清空文本框
            groupBox1.Text    = "查询结果";
            string pid = textBox1.Text;

            BLL.cardinfo bll = new BLL.cardinfo();
            DataSet      ds  = bll.search(pid);//调用查询方法
            string       s   = "";

            if (ds.Tables[0].Rows.Count == 0)
            {
                richTextBox1.AppendText("不是本行客户!");
                return;
            }

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string cardID       = ds.Tables[0].Rows[i][0].ToString();//数字顺序,要参照dal里的sql语句字段顺序写
                string curType      = ds.Tables[0].Rows[i][1].ToString();
                string savingType   = ds.Tables[0].Rows[i][2].ToString();
                string openDate     = ds.Tables[0].Rows[i][3].ToString();
                string balance      = ds.Tables[0].Rows[i][4].ToString();
                string IsReportLoss = ds.Tables[0].Rows[i][5].ToString();
                IsReportLoss = ((IsReportLoss == "True") ? "已挂失" : "正常");
                string customerName = ds.Tables[0].Rows[i][6].ToString();//客户名

                groupBox1.Text = customerName + "的银行卡查询结果";

                s  = "----------银行卡" + (i + 1) + "---------\r\n卡号:" + cardID + "\r\n货币种类:" + curType + "\r\n账户类型:" + savingType;
                s += "\r\n开户日期:" + openDate + "\r\n余额:" + balance + "\r\n账户状态:" + IsReportLoss + "\r\n";

                richTextBox1.AppendText(s);//文本框追加内容
            }
        }
Пример #2
0
 private void Show_Load(object sender, EventArgs e)
 {
     BLL.cardinfo   bll   = new BLL.cardinfo();
     Model.cardinfo model = bll.GetModel(CardID);
     label1.Text = "账号:" + model.cardID + "\r\n货币类型:" + model.curType + "\r\n存款类型:" + model.savingType;
     label2.Text = "开户日期:" + model.openDate + "\r\n账户状态:" + (model.IsReportLoss?"已挂失":"正常") + "\r\n账户余额:" + model.balance;
 }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            label9.Text = "";

            string  acctype  = comboBox1.Text;
            decimal opennnum = numericUpDown1.Value;
            string  pwd      = textBox5.Text;

            Model.cardinfo model = new Model.cardinfo();
            model.cardID       = "";
            model.curType      = "RMB";
            model.customerID   = CustomerID;
            model.IsReportLoss = false;
            model.savingType   = acctype;
            model.openDate     = DateTime.Now;
            model.openMoney    = opennnum;
            model.balance      = opennnum;
            model.pass         = pwd;
            bool openOK;

            if (CustomerID != 0)//身份证已注册
            {
                BLL.cardinfo bll = new BLL.cardinfo();
                openOK = bll.Add(model, out CardID);
            }
            else
            {
                string         name   = textBox2.Text;
                string         pid    = textBox1.Text;
                string         tel    = textBox3.Text;
                string         add    = textBox4.Text;
                Model.userInfo modelU = new Model.userInfo();
                modelU.customerID   = 0;
                modelU.customerName = name;
                modelU.pID          = pid;
                modelU.telephone    = tel;
                modelU.address      = add;
                BLL.userInfo bllU = new BLL.userInfo();
                CustomerID = bllU.Add(modelU);

                model.customerID = CustomerID;
                BLL.cardinfo bll = new BLL.cardinfo();
                openOK = bll.Add(model, out CardID);
            }
            if (openOK)
            {
                label9.Text = "注册成功,卡号是:" + CardID + ",请前去登录!";
                Clipboard.SetText(CardID);//剪贴板
            }
            else
            {
                label9.Text = "注册失败,下次再来!";
            }
        }
Пример #4
0
        private void Lost_Load(object sender, EventArgs e)
        {
            BLL.cardinfo bll    = new BLL.cardinfo();
            bool         IsLost = bll.getState(CardID);

            if (IsLost)
            {
                button1.Text = "取消挂失";
            }
            else
            {
                button1.Text = "挂失";
            }
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            decimal num = numericUpDown1.Value;

            BLL.cardinfo bll  = new BLL.cardinfo();
            bool         isOk = bll.UpdateBalance(CardID, num, textBox1.Text);

            if (isOk)
            {
                label2.Text = "存款成功!";
            }
            else
            {
                label2.Text = "存款失败!";
            }
        }
Пример #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            label3.Text = "";
            string name = textBox1.Text;
            string pwd  = textBox2.Text;

            BLL.cardinfo bll = new BLL.cardinfo();   //创建bll层对象
            if (bll.Exists(name, pwd))               //调用方法
            {
                CardID            = textBox1.Text;   //保存卡号到字段
                this.DialogResult = DialogResult.OK; //表示登陆成功
            }
            else
            {
                label3.Text = "用户名密码错误!请重试";
            }                               //显示错误信息
        }
Пример #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            decimal num      = numericUpDown1.Value;
            string  toCardID = textBox1.Text;

            BLL.cardinfo bll  = new BLL.cardinfo();
            bool         isOk = bll.ZhuanZhang(CardID, toCardID, num);

            if (isOk)
            {
                label2.Text = "转账成功!";
            }
            else
            {
                label2.Text = "转账失败!";
            }
        }
Пример #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            BLL.cardinfo bll  = new BLL.cardinfo();
            bool         isOK = bll.ChangeState(CardID);

            if (isOK)
            {
                if (button1.Text == "挂失")
                {
                    label1.Text = "挂失操作成功"; button1.Text = "取消挂失";
                }
                else
                {
                    label1.Text = "取消挂失操作成功"; button1.Text = "挂失";
                }
            }
            else
            {
                label1.Text = "操作失败";
            }
        }
Пример #9
0
 private void button1_Click(object sender, EventArgs e)
 {
     label4.Text = "";
     if (textBox2.Text != textBox3.Text)
     {
         label4.Text = "两次新密码不一致,请重输!";
     }
     else
     {
         BLL.cardinfo bll  = new BLL.cardinfo();
         bool         isOK = bll.changePwd(CardID, textBox1.Text, textBox3.Text);
         if (isOK)
         {
             MessageBox.Show("密码修改成功,请重新登录!", "成功");
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             label4.Text = "密码修改失败,请重试!";
         }
     }
 }