📄 newrole.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Services;
public partial class UserManage_NewRole : System.Web.UI.Page
{HtmlLink link = new HtmlLink();
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["ThemeCss"] == null)
link.Href = "../styles/VistaBlue.css";
else
link.Href = "../styles/" + Request.Cookies["ThemeCss"].Value;
link.Attributes["rel"] = "stylesheet";
link.Attributes["type"] = "text/css";
Page.Header.Controls.Add(link);
}
protected void Button2_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
if (labError.Text.ToString() == "")
{
BLL.BCropRole bCropRole = new BLL.BCropRole();
Entities.CorpRole corpRole = new Entities.CorpRole();
corpRole.RoleName = this.txtname.Text.ToString().Trim();
corpRole.IsValid = cbkIsValid.Checked;
if (bCropRole.Insert(corpRole) > -1)
{
this.labError.Text = "添加成功";
}
Response.Write("<script>window.returnValue='';window.close();</script>");
}
}
}
[WebMethod]
public static bool VerifyUser(string userName)
{
if (userName != null || userName != string.Empty)
{
Search.CorpRoleSearcher search = new Search.CorpRoleSearcher();
search.RoleName = userName;
search.RoleNameIsValid = true;
ArrayList list = new BLL.BCropRole().Select(search);
if (list != null && list.Count > 0)
{
return true;
}
else
{
return false;
}
}
else
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -