예제 #1
0
 private void ShowInfo(int ID)
 {
     UFB.BLL.AdminManager bll   = new UFB.BLL.AdminManager();
     UFB.Model.Admin      model = bll.GetModel(ID);
     this.lblID.Text            = model.ID.ToString();
     this.txtadminName.Text     = model.adminName;
     this.txtadminPassword.Text = model.adminPassword;
     this.txtdepartment.Text    = model.department;
     this.txtjob.Text           = model.job;
     this.txtpermission.Text    = model.permission;
 }
예제 #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtadminName.Text.Trim().Length == 0)
            {
                strErr += "adminName不能为空!\\n";
            }
            if (this.txtadminPassword.Text.Trim().Length == 0)
            {
                strErr += "adminPassword不能为空!\\n";
            }
            if (this.txtdepartment.Text.Trim().Length == 0)
            {
                strErr += "department不能为空!\\n";
            }
            if (this.txtjob.Text.Trim().Length == 0)
            {
                strErr += "job不能为空!\\n";
            }
            if (this.txtpermission.Text.Trim().Length == 0)
            {
                strErr += "permission不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    ID            = int.Parse(this.lblID.Text);
            string adminName     = this.txtadminName.Text;
            string adminPassword = this.txtadminPassword.Text;
            string department    = this.txtdepartment.Text;
            string job           = this.txtjob.Text;
            string permission    = this.txtpermission.Text;


            UFB.Model.Admin model = new UFB.Model.Admin();
            model.ID            = ID;
            model.adminName     = adminName;
            model.adminPassword = adminPassword;
            model.department    = department;
            model.job           = job;
            model.permission    = permission;

            UFB.BLL.AdminManager bll = new UFB.BLL.AdminManager();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }