Example #1
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 (this.txtremark.Text.Trim().Length == 0)
            {
                strErr += "remark不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    adminID       = int.Parse(this.lbladminID.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;
            string remark        = this.txtremark.Text;


            UserFB.Model.Admin model = new UserFB.Model.Admin();
            model.adminID       = adminID;
            model.adminName     = adminName;
            model.adminPassword = adminPassword;
            model.department    = department;
            model.job           = job;
            model.permission    = permission;
            model.remark        = remark;

            UserFB.BLL.AdminManager bll = new UserFB.BLL.AdminManager();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Example #2
0
 private void ShowInfo(int adminID)
 {
     UserFB.BLL.AdminManager bll   = new UserFB.BLL.AdminManager();
     UserFB.Model.Admin      model = bll.GetModel(adminID);
     this.lbladminID.Text       = model.adminID.ToString();
     this.lbladminName.Text     = model.adminName;
     this.lbladminPassword.Text = model.adminPassword;
     this.lbldepartment.Text    = model.department;
     this.lbljob.Text           = model.job;
     this.lblpermission.Text    = model.permission;
     this.lblremark.Text        = model.remark;
 }