private void bindata() { int id = Convert.ToInt32(Request["RoleId"]); ZwBLL.MyRoleBLL roleBLL = new ZwBLL.MyRoleBLL(); ZwEntity.MyRoleEntity roleEntity = roleBLL.list(id); txtRoleName.Text = roleEntity.RoleName; txtRemark.Text = roleEntity.RoleRemark; }
private void bindata() { ZwBLL.MyRoleBLL myRole = new ZwBLL.MyRoleBLL(); ddlRole.DataTextField = "RoleName"; ddlRole.DataValueField = "RoleId"; ddlRole.DataSource = myRole.list(); ddlRole.DataBind(); ddlRole.Items.Insert(0, new ListItem("--请选择--", "0")); }
protected void btAdd_Click(object sender, EventArgs e) { ZwBLL.MyRoleBLL roleBLL = new ZwBLL.MyRoleBLL(); ZwEntity.MyRoleEntity roleEntity = new ZwEntity.MyRoleEntity(); roleEntity.RoleName = txtRoleName.Text; roleEntity.RoleRemark = txtRemark.Text; if (roleBLL.Add(roleEntity) == 1) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加成功');window.parent.location.reload();</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('未知错误!')</script>"); } }
protected void btUpdate_Click(object sender, EventArgs e) { int id = Convert.ToInt32(Request["RoleId"]); ZwBLL.MyRoleBLL roleBLL = new ZwBLL.MyRoleBLL(); ZwEntity.MyRoleEntity roleEntity = roleBLL.list(id); roleEntity.RoleName = txtRoleName.Text; roleEntity.RoleRemark = txtRemark.Text; if (roleBLL.Update(roleEntity) == 1) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改成功');window.parent.location.reload();</script>"); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('未知错误!')</script>"); } }
protected void btUpdatePower_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(Request["RoleId"])) { return; } int id = Convert.ToInt32(Request["RoleId"]); ZwBLL.MyRoleBLL roleBLL = new ZwBLL.MyRoleBLL(); if (roleBLL.Powerup(HiddenField1.Value, id) == 1) { bindata(); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('未知错误')</script>"); } }
private void bindata() { if (string.IsNullOrWhiteSpace(Request["RoleId"])) { return; } int id = Convert.ToInt32(Request["RoleId"]); ZwBLL.MyRoleBLL roleBLL = new ZwBLL.MyRoleBLL(); ZwEntity.MyRoleEntity roleEntity = roleBLL.list(id); ViewState["RolePowerList"] = roleEntity.RolePowerList; Label1.Text = roleEntity.RoleName; ZwBLL.MyPowerBLL powerBLL = new ZwBLL.MyPowerBLL(); string str = "___"; Repeater1.DataSource = powerBLL.list(str); Repeater1.DataBind(); }
private void bindata() { ZwBLL.MyRoleBLL myRole = new ZwBLL.MyRoleBLL(); ddlRole.DataTextField = "RoleName"; ddlRole.DataValueField = "RoleId"; ddlRole.DataSource = myRole.list(); ddlRole.DataBind(); ddlRole.Items.Insert(0, new ListItem("--请选择--", "0")); ZwBLL.MyUserBLL myUser = new ZwBLL.MyUserBLL(); int id = int.Parse(Request["UserId"]); ZwEntity.MyUserEntity userEntity = new ZwEntity.MyUserEntity(); userEntity = myUser.list(id); ddlRole.SelectedValue = userEntity.RoleId.ToString(); txtAccount.Text = userEntity.UserAccount; txtRealName.Text = userEntity.UserRealName; txtPhone.Text = userEntity.UserPhone; }