private void ShowInfo(int Id) { Bsam.Core.Model.Models.BLL.Permission bll = new Bsam.Core.Model.Models.BLL.Permission(); Bsam.Core.Model.Models.Model.Permission model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.txtCode.Text = model.Code; this.txtName.Text = model.Name; this.chkIsButton.Checked = model.IsButton; this.chkIsHide.Checked = model.IsHide; this.txtFunc.Text = model.Func; this.txtPid.Text = model.Pid.ToString(); this.txtMid.Text = model.Mid.ToString(); this.txtOrderSort.Text = model.OrderSort.ToString(); this.txtIcon.Text = model.Icon; this.txtDescription.Text = model.Description; this.chkEnabled.Checked = model.Enabled; this.txtCreateId.Text = model.CreateId.ToString(); this.txtCreateBy.Text = model.CreateBy; this.txtCreateTime.Text = model.CreateTime.ToString(); this.txtModifyId.Text = model.ModifyId.ToString(); this.txtModifyBy.Text = model.ModifyBy; this.txtModifyTime.Text = model.ModifyTime.ToString(); this.chkIsDeleted.Checked = model.IsDeleted; }
private void ShowInfo(int Id) { Bsam.Core.Model.Models.BLL.Permission bll = new Bsam.Core.Model.Models.BLL.Permission(); Bsam.Core.Model.Models.Model.Permission model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblCode.Text = model.Code; this.lblName.Text = model.Name; this.lblIsButton.Text = model.IsButton?"是":"否"; this.lblIsHide.Text = model.IsHide?"是":"否"; this.lblFunc.Text = model.Func; this.lblPid.Text = model.Pid.ToString(); this.lblMid.Text = model.Mid.ToString(); this.lblOrderSort.Text = model.OrderSort.ToString(); this.lblIcon.Text = model.Icon; this.lblDescription.Text = model.Description; this.lblEnabled.Text = model.Enabled?"是":"否"; this.lblCreateId.Text = model.CreateId.ToString(); this.lblCreateBy.Text = model.CreateBy; this.lblCreateTime.Text = model.CreateTime.ToString(); this.lblModifyId.Text = model.ModifyId.ToString(); this.lblModifyBy.Text = model.ModifyBy; this.lblModifyTime.Text = model.ModifyTime.ToString(); this.lblIsDeleted.Text = model.IsDeleted?"是":"否"; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCode.Text.Trim().Length == 0) { strErr += "Code不能为空!\\n"; } if (this.txtName.Text.Trim().Length == 0) { strErr += "Name不能为空!\\n"; } if (this.txtFunc.Text.Trim().Length == 0) { strErr += "Func不能为空!\\n"; } if (!PageValidate.IsNumber(txtPid.Text)) { strErr += "Pid格式错误!\\n"; } if (!PageValidate.IsNumber(txtMid.Text)) { strErr += "Mid格式错误!\\n"; } if (!PageValidate.IsNumber(txtOrderSort.Text)) { strErr += "OrderSort格式错误!\\n"; } if (this.txtIcon.Text.Trim().Length == 0) { strErr += "Icon不能为空!\\n"; } if (this.txtDescription.Text.Trim().Length == 0) { strErr += "Description不能为空!\\n"; } if (!PageValidate.IsNumber(txtCreateId.Text)) { strErr += "CreateId格式错误!\\n"; } if (this.txtCreateBy.Text.Trim().Length == 0) { strErr += "CreateBy不能为空!\\n"; } if (!PageValidate.IsDateTime(txtCreateTime.Text)) { strErr += "CreateTime格式错误!\\n"; } if (!PageValidate.IsNumber(txtModifyId.Text)) { strErr += "ModifyId格式错误!\\n"; } if (this.txtModifyBy.Text.Trim().Length == 0) { strErr += "ModifyBy不能为空!\\n"; } if (!PageValidate.IsDateTime(txtModifyTime.Text)) { strErr += "ModifyTime格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.lblId.Text); string Code = this.txtCode.Text; string Name = this.txtName.Text; bool IsButton = this.chkIsButton.Checked; bool IsHide = this.chkIsHide.Checked; string Func = this.txtFunc.Text; int Pid = int.Parse(this.txtPid.Text); int Mid = int.Parse(this.txtMid.Text); int OrderSort = int.Parse(this.txtOrderSort.Text); string Icon = this.txtIcon.Text; string Description = this.txtDescription.Text; bool Enabled = this.chkEnabled.Checked; int CreateId = int.Parse(this.txtCreateId.Text); string CreateBy = this.txtCreateBy.Text; DateTime CreateTime = DateTime.Parse(this.txtCreateTime.Text); int ModifyId = int.Parse(this.txtModifyId.Text); string ModifyBy = this.txtModifyBy.Text; DateTime ModifyTime = DateTime.Parse(this.txtModifyTime.Text); bool IsDeleted = this.chkIsDeleted.Checked; Bsam.Core.Model.Models.Model.Permission model = new Bsam.Core.Model.Models.Model.Permission(); model.Id = Id; model.Code = Code; model.Name = Name; model.IsButton = IsButton; model.IsHide = IsHide; model.Func = Func; model.Pid = Pid; model.Mid = Mid; model.OrderSort = OrderSort; model.Icon = Icon; model.Description = Description; model.Enabled = Enabled; model.CreateId = CreateId; model.CreateBy = CreateBy; model.CreateTime = CreateTime; model.ModifyId = ModifyId; model.ModifyBy = ModifyBy; model.ModifyTime = ModifyTime; model.IsDeleted = IsDeleted; Bsam.Core.Model.Models.BLL.Permission bll = new Bsam.Core.Model.Models.BLL.Permission(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }