Пример #1
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 = "注册失败,下次再来!";
            }
        }
Пример #2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     this.Ylblname.Text     = "";
     this.Ylblpassword.Text = "";
     this.Ylblsex.Text      = "";
     this.Ylblbirthday.Text = "";
     this.Ylblshuoshuo.Text = "";
     if (this.txtName.Text == "")
     {
         this.Ylblname.Text = "*昵称不能为空";
         return;
     }
     if (this.txtPassword.Text == "")
     {
         this.Ylblpassword.Text = "*密码不能为空";
         return;
     }
     if (this.cmbSex.Text == "")
     {
         this.Ylblsex.Text = "*性别不能为空";
         return;
     }
     if (this.dtpBirthday.Value >= BLL.NormalOperation.getServerTime())
     {
         this.Ylblbirthday.Text = "*时间输入不正确!";
     }
     if (this.txtShuoshuo.Text == "")
     {
         this.Ylblshuoshuo.Text = "*说说不能为空!";
         return;
     }
     BLL.userInfo   blluser = new BLL.userInfo();
     Model.userInfo m       = new Model.userInfo();
     m.userBirthDay    = this.dtpBirthday.Value;
     m.userDescription = this.txtDescription.Text;
     m.userHeadImage   = Convert.ToString("1");
     m.userName        = this.txtName.Text;
     m.userPWD         = this.txtPassword.Text;
     m.userSex         = this.cmbSex.Text;
     m.userShuoshuo    = this.txtShuoshuo.Text;
     m.userState       = 2;
     blluser.Add(m);
     MessageBox.Show("注册成功!");
     this.Close();
     this._frm.ShowList();
 }