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

            if (this.txtDescription.Text.Trim().Length == 0)
            {
                strErr += "Description不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtCategoryID.Text))
            {
                strErr += "CategoryID格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string Description = this.txtDescription.Text;
            int    CategoryID  = int.Parse(this.txtCategoryID.Text);

            KDMYsoft.Model.Nhiber.Accounts_Permissions model = new KDMYsoft.Model.Nhiber.Accounts_Permissions();
            model.Description = Description;
            model.CategoryID  = CategoryID;

            KDMYsoft.BLL.Nhiber.Accounts_Permissions bll = new KDMYsoft.BLL.Nhiber.Accounts_Permissions();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtDescription.Text.Trim().Length==0)
            {
                strErr+="Description不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtCategoryID.Text))
            {
                strErr+="CategoryID格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int PermissionID=int.Parse(this.lblPermissionID.Text);
            string Description=this.txtDescription.Text;
            int CategoryID=int.Parse(this.txtCategoryID.Text);

            KDMYsoft.Model.Nhiber.Accounts_Permissions model=new KDMYsoft.Model.Nhiber.Accounts_Permissions();
            model.PermissionID=PermissionID;
            model.Description=Description;
            model.CategoryID=CategoryID;

            KDMYsoft.BLL.Nhiber.Accounts_Permissions bll=new KDMYsoft.BLL.Nhiber.Accounts_Permissions();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }
示例#3
0
 private void ShowInfo(int PermissionID)
 {
     KDMYsoft.BLL.Nhiber.Accounts_Permissions bll=new KDMYsoft.BLL.Nhiber.Accounts_Permissions();
     KDMYsoft.Model.Nhiber.Accounts_Permissions model=bll.GetModel(PermissionID);
     this.lblPermissionID.Text=model.PermissionID.ToString();
     this.lblDescription.Text=model.Description;
     this.lblCategoryID.Text=model.CategoryID.ToString();
 }
示例#4
0
 private void ShowInfo(int PermissionID)
 {
     KDMYsoft.BLL.Nhiber.Accounts_Permissions   bll   = new KDMYsoft.BLL.Nhiber.Accounts_Permissions();
     KDMYsoft.Model.Nhiber.Accounts_Permissions model = bll.GetModel(PermissionID);
     this.lblPermissionID.Text = model.PermissionID.ToString();
     this.lblDescription.Text  = model.Description;
     this.lblCategoryID.Text   = model.CategoryID.ToString();
 }