示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtusername.Text.Trim().Length == 0)
            {
                strErr += "username不能为空!\\n";
            }
            if (this.txtuserpass.Text.Trim().Length == 0)
            {
                strErr += "userpass不能为空!\\n";
            }
            if (this.txtemail.Text.Trim().Length == 0)
            {
                strErr += "email不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string username = this.txtusername.Text;
            string userpass = this.txtuserpass.Text;
            string email    = this.txtemail.Text;

            Auction.Model.auction_user model = new Auction.Model.auction_user();
            model.username = username;
            model.userpass = userpass;
            model.email    = email;

            Auction.BLL.auction_user bll = new Auction.BLL.auction_user();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
示例#2
0
 private void ShowInfo(int user_id)
 {
     Auction.BLL.auction_user   bll   = new Auction.BLL.auction_user();
     Auction.Model.auction_user model = bll.GetModel(user_id);
     this.lbluser_id.Text  = model.user_id.ToString();
     this.lblusername.Text = model.username;
     this.lbluserpass.Text = model.userpass;
     this.lblemail.Text    = model.email;
 }