Example #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtuserName.Text.Trim().Length == 0)
            {
                strErr += "userName不能为空!\\n";
            }
            if (this.txtuserPsw.Text.Trim().Length == 0)
            {
                strErr += "userPsw不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    id       = int.Parse(this.lblid.Text);
            string userName = this.txtuserName.Text;
            string userPsw  = this.txtuserPsw.Text;


            zs.Model.Tbl_User model = new zs.Model.Tbl_User();
            model.id       = id;
            model.userName = userName;
            model.userPsw  = userPsw;

            zs.BLL.Tbl_User bll = new zs.BLL.Tbl_User();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #2
0
 private void ShowInfo(int id)
 {
     zs.BLL.Tbl_User   bll   = new zs.BLL.Tbl_User();
     zs.Model.Tbl_User model = bll.GetModel(id);
     this.lblid.Text       = model.id.ToString();
     this.txtuserName.Text = model.userName;
     this.txtuserPsw.Text  = model.userPsw;
 }