private void ShowInfo() { Bsam.Core.Model.Models.BLL.Sys_Role bll = new Bsam.Core.Model.Models.BLL.Sys_Role(); Bsam.Core.Model.Models.Model.Sys_Role model = bll.GetModel(); this.lblId.Text = model.Id.ToString(); this.lblRoleName.Text = model.RoleName; this.lblRoleDesc.Text = model.RoleDesc; this.lblDateTimeCreated.Text = model.DateTimeCreated.ToString(); this.lblUserCreator.Text = model.UserCreator; this.lblDateTimeModified.Text = model.DateTimeModified.ToString(); this.lblUserModified.Text = model.UserModified; this.lblState.Text = model.State?"是":"否"; this.lblOrgId.Text = model.OrgId; }
private void ShowInfo() { Bsam.Core.Model.Models.BLL.Sys_Role bll = new Bsam.Core.Model.Models.BLL.Sys_Role(); Bsam.Core.Model.Models.Model.Sys_Role model = bll.GetModel(); this.txtId.Text = model.Id.ToString(); this.txtRoleName.Text = model.RoleName; this.txtRoleDesc.Text = model.RoleDesc; this.txtDateTimeCreated.Text = model.DateTimeCreated.ToString(); this.txtUserCreator.Text = model.UserCreator; this.txtDateTimeModified.Text = model.DateTimeModified.ToString(); this.txtUserModified.Text = model.UserModified; this.chkState.Checked = model.State; this.txtOrgId.Text = model.OrgId; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtId.Text)) { strErr += "Id格式错误!\\n"; } if (this.txtRoleName.Text.Trim().Length == 0) { strErr += "RoleName不能为空!\\n"; } if (this.txtRoleDesc.Text.Trim().Length == 0) { strErr += "RoleDesc不能为空!\\n"; } if (!PageValidate.IsDateTime(txtDateTimeCreated.Text)) { strErr += "DateTimeCreated格式错误!\\n"; } if (this.txtUserCreator.Text.Trim().Length == 0) { strErr += "UserCreator不能为空!\\n"; } if (!PageValidate.IsDateTime(txtDateTimeModified.Text)) { strErr += "DateTimeModified格式错误!\\n"; } if (this.txtUserModified.Text.Trim().Length == 0) { strErr += "UserModified不能为空!\\n"; } if (this.txtOrgId.Text.Trim().Length == 0) { strErr += "OrgId不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.txtId.Text); string RoleName = this.txtRoleName.Text; string RoleDesc = this.txtRoleDesc.Text; DateTime DateTimeCreated = DateTime.Parse(this.txtDateTimeCreated.Text); string UserCreator = this.txtUserCreator.Text; DateTime DateTimeModified = DateTime.Parse(this.txtDateTimeModified.Text); string UserModified = this.txtUserModified.Text; bool State = this.chkState.Checked; string OrgId = this.txtOrgId.Text; Bsam.Core.Model.Models.Model.Sys_Role model = new Bsam.Core.Model.Models.Model.Sys_Role(); model.Id = Id; model.RoleName = RoleName; model.RoleDesc = RoleDesc; model.DateTimeCreated = DateTimeCreated; model.UserCreator = UserCreator; model.DateTimeModified = DateTimeModified; model.UserModified = UserModified; model.State = State; model.OrgId = OrgId; Bsam.Core.Model.Models.BLL.Sys_Role bll = new Bsam.Core.Model.Models.BLL.Sys_Role(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }