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 Coeno.BLL.Entity.Forms;
using Coeno.BLL.Model.Forms;
public partial class Modules_GSDevChk_IM_FormEmc11_Edit:System.Web.UI.Page
{
private string empID;
string[] roleID = new string[]{
"GSDevChk_ADM", "GSDevChk_Chk"};
private string systemID = ConfigurationManager.AppSettings["SystemID"].ToString();
//一、本地加载
protected void Page_Load(object sender, EventArgs e)
{
empID = txtCurrentEmPID.Text;
PageForm_StopService();//是否停止服务
if(!IsPostBack)
{
PageForm_IsAuth();//验证表单页面的登录用户身份
PageForm_Permission(system,empID,roleID);//是否有权限
PageForm_InitData();//表单页面上控件值的初始化
}
}
#region 1#页面加载时基本处理过程
/*验证登录用户信息:是否绑定域账户+是否HR在职人员*/
protected void PageForm_IsAuth()
{
//开启用户认证
if(!User.Identity.IsAuthenticated)
{
Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["urlPermissionDenied"].ToString());
return;
}
string v_domain = string.Empty;
string v_domainaccount = string.Empty;
string v_empID = string.Empty;
string v_AuthType = string.Empty;
v_AuthType = Page.User.Identity.AuthenticationType.ToString();
if(v_AuthType == "Negotiate" || v_AuthType == "NTLM")
{
if(Page.User.Identity,Name.IndexOf('\\')<1)
{
Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["urlMappingErrorPage"]ToString(),true;
return;
}
v_domain = Page.User.Identity.Name.Split('\\')[0].ToString();
v_domainaccount = Page.User.Identity.Name.Split('\\')[1].ToString();
//通过域账户查询绑定的工号
v_empID = Coeno.BLL.Entity.Account.Users.GetUserEmpID(v_domain.ToUpper(),v_domainaccount.ToUpper());
if(v_empID == "")
{
lblMsg.Text = "無法識別您的賬號,無法辨識您的正確工號!!!";
lblMsg.ForeColor = System.Drawing.Color.Red;
}
}
else
{
v_empID = Page.User.Identity.Name;
}
//如果域賬戶與工號沒有進行綁定
if(v_empID == "")
{
Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["urlMappingErrorPage"].ToString(),true);
return;
}
//從HR系統中判斷員工是否在職
int i
c#点检系统后端.cs
最新推荐文章于 2023-07-31 16:39:18 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)