private void ShowInfo() { OLBookstore.BLL.UserRolesManager bll = new OLBookstore.BLL.UserRolesManager(); OLBookstore.Model.UserRoles model = bll.GetModel(); this.lblId.Text = model.Id.ToString(); this.lblName.Text = model.Name; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtId.Text)) { strErr += "Id格式错误!\\n"; } if (this.txtName.Text.Trim().Length == 0) { strErr += "Name不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.txtId.Text); string Name = this.txtName.Text; OLBookstore.Model.UserRoles model = new OLBookstore.Model.UserRoles(); model.Id = Id; model.Name = Name; OLBookstore.BLL.UserRolesManager bll = new OLBookstore.BLL.UserRolesManager(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }