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

            if (this.txtRoleName.Text.Trim().Length == 0)
            {
                strErr += "RoleName不能为空!\\n";
            }
            if (this.txtDescription.Text.Trim().Length == 0)
            {
                strErr += "Description不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtvalidateDate.Text))
            {
                strErr += "validateDate格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   RoleName     = this.txtRoleName.Text;
            string   Description  = this.txtDescription.Text;
            DateTime validateDate = DateTime.Parse(this.txtvalidateDate.Text);

            zs.Model.Sys_Role model = new zs.Model.Sys_Role();
            model.RoleName     = RoleName;
            model.Description  = Description;
            model.validateDate = validateDate;

            zs.BLL.Sys_Role bll = new zs.BLL.Sys_Role();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Exemple #2
0
 private void ShowInfo(int ID)
 {
     zs.BLL.Sys_Role   bll   = new zs.BLL.Sys_Role();
     zs.Model.Sys_Role model = bll.GetModel(ID);
     this.lblID.Text           = model.ID.ToString();
     this.txtRoleName.Text     = model.RoleName;
     this.txtDescription.Text  = model.Description;
     this.txtvalidateDate.Text = model.validateDate.ToString();
 }