Web/Admin/MasterUser/Roles.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Maticsoft.Web.Admin.MasterUser
{
public partial class Roles : System.Web.UI.Page
{
BLL.UserRoles b_u = new BLL.UserRoles();
protected void Page_Load(object sender, EventArgs e)
{
Model.MasterUser adminmod = (Model.MasterUser)Session["User"];
if (adminmod == null)
{
Response.Redirect("/Admin/Login.aspx");
return;
}
}
protected void lbtnSave_Click(object sender, EventArgs e)
{
if (b_u.Exists1(0, tbName.Value.Trim()))
{
ClientScript.RegisterStartupScript(this.GetType(), "", "parent.Dialog.alert('重名,添加失败!');", true);
return;
}
Model.UserRoles mdljiese = new Model.UserRoles();
mdljiese.UrName = tbName.Value.Trim();
mdljiese.UrDescription = taDescription.Value;
string module = "1";
string function = "1";
module = module.PadLeft(50, '1');
function = function.PadLeft(399, '1');
mdljiese.UrFunctions = module + "|" + function;
if (b_u.Add(mdljiese) > 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "", "parent.Dialog.alert('添加成功!');this.location.href='Roles_list.aspx';", true);
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "", "parent.Dialog.alert('添加失败!');", true);
}
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
