Ejemplo n.º 1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

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

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    Id       = int.Parse(this.lblId.Text);
            string username = this.txtusername.Text;
            string password = this.txtpassword.Text;


            ManagePhones.Model.users model = new ManagePhones.Model.users();
            model.Id       = Id;
            model.username = username;
            model.password = password;

            ManagePhones.BLL.users bll = new ManagePhones.BLL.users();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Ejemplo n.º 2
0
 private void ShowInfo(int Id)
 {
     ManagePhones.BLL.users   bll   = new ManagePhones.BLL.users();
     ManagePhones.Model.users model = bll.GetModel(Id);
     this.lblId.Text       = model.Id.ToString();
     this.lblusername.Text = model.username;
     this.lblpassword.Text = model.password;
 }