protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtUserGroupId.Text)) { strErr += "UserGroupId格式错误!\\n"; } if (!PageValidate.IsNumber(txtRoleId.Text)) { strErr += "RoleId格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int UserGroupId = int.Parse(this.txtUserGroupId.Text); int RoleId = int.Parse(this.txtRoleId.Text); Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role model = new Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role(); model.UserGroupId = UserGroupId; model.RoleId = RoleId; Bsam.Core.Model.Models.BLL.Sys_UserGroup_In_Role bll = new Bsam.Core.Model.Models.BLL.Sys_UserGroup_In_Role(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo() { Bsam.Core.Model.Models.BLL.Sys_UserGroup_In_Role bll = new Bsam.Core.Model.Models.BLL.Sys_UserGroup_In_Role(); Bsam.Core.Model.Models.Model.Sys_UserGroup_In_Role model = bll.GetModel(); this.txtUserGroupId.Text = model.UserGroupId.ToString(); this.txtRoleId.Text = model.RoleId.ToString(); }