protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsNumber(txtRoleID.Text)) { strErr+="RoleID格式错误!\\n"; } if(!PageValidate.IsNumber(txtPermissionID.Text)) { strErr+="PermissionID格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int RoleID=int.Parse(this.txtRoleID.Text); int PermissionID=int.Parse(this.txtPermissionID.Text); KDMYsoft.Model.Nhiber.Accounts_RolePermissions model=new KDMYsoft.Model.Nhiber.Accounts_RolePermissions(); model.RoleID=RoleID; model.PermissionID=PermissionID; KDMYsoft.BLL.Nhiber.Accounts_RolePermissions bll=new KDMYsoft.BLL.Nhiber.Accounts_RolePermissions(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }
private void ShowInfo() { KDMYsoft.BLL.Nhiber.Accounts_RolePermissions bll = new KDMYsoft.BLL.Nhiber.Accounts_RolePermissions(); KDMYsoft.Model.Nhiber.Accounts_RolePermissions model = bll.GetModel(); this.lblRoleID.Text = model.RoleID.ToString(); this.lblPermissionID.Text = model.PermissionID.ToString(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtRoleID.Text)) { strErr += "RoleID格式错误!\\n"; } if (!PageValidate.IsNumber(txtPermissionID.Text)) { strErr += "PermissionID格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int RoleID = int.Parse(this.txtRoleID.Text); int PermissionID = int.Parse(this.txtPermissionID.Text); KDMYsoft.Model.Nhiber.Accounts_RolePermissions model = new KDMYsoft.Model.Nhiber.Accounts_RolePermissions(); model.RoleID = RoleID; model.PermissionID = PermissionID; KDMYsoft.BLL.Nhiber.Accounts_RolePermissions bll = new KDMYsoft.BLL.Nhiber.Accounts_RolePermissions(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }