private void GetLoggedInuser() { LoggedInUser = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["ADIDTemp"]); if (LoggedInUser != null) { if (LoggedInUser.Length < 1) { LoggedInUser = HttpContext.Current.User.Identity.Name; } } else { LoggedInUser = HttpContext.Current.User.Identity.Name; } clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALLoggedInUser = objclsBALCommon.FetchUserDetailsFromAD(LoggedInUser); Session[clsEALSession.CurrentUser] = objclsEALLoggedInUser; }
public void BindDropDown() { try { objBI_Common = new clsBALCommon(); ddlRole.DataSource = objBI_Common.GetCommonFields("UserRole"); ddlRole.DataBind(); } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
public void BindListbox() { try { objBI_Common = new clsBALCommon(); lstBoxApproverDelete.DataSource = objBI_Common.GetRoleWiseUser(Int32.Parse(ddlRole.SelectedItem.Value.ToString())); Session["dtrolewiseuser"] = objBI_Common.GetRoleWiseUser(Int32.Parse(ddlRole.SelectedItem.Value.ToString())); lstBoxApproverDelete.DataBind(); } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void gvRole_RowDeleting(object sender, GridViewDeleteEventArgs e) { lblError.Text = ""; lblSuccess.Text = ""; gvRole.EditIndex = -1; try { Label lblUserADID = (Label)gvRole.Rows[e.RowIndex].FindControl("lblUserADID"); Label lblUserName = (Label)gvRole.Rows[e.RowIndex].FindControl("lblUserName"); Label lblUserID = (Label)gvRole.Rows[e.RowIndex].FindControl("lblUserID"); string strUserADID = lblUserADID.Text.ToString(); objclsBALCommon = new clsBALCommon(); clsEALUser objclsEALUser = new clsEALUser(); objclsEALUser = objclsBALCommon.FetchUserDetailsFromAD(strUserADID); if (objclsEALUser != null) { SortGridViewOnEditDelete(); DeleteUserRole(objclsEALUser); //objclsBALUsers.DeleteUser(objclsEALUser); lblSuccess.Text = "User role deleted successfully."; PopulateGrid(); } else { lblError.Text = "User Not Found."; } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void ddlReportType_SelectedIndexChanged(object sender, EventArgs e) { if (userRole == "Compliance Administrator") { if ((ddlReportType.SelectedIndex != 0)) { lblApprover.Visible = true; ddlApprover.Visible = true; reportType = ddlReportType.SelectedValue; clsBALCommon objclsBALCommon = new clsBALCommon(); DataTable dt = objclsBALCommon.GetAllApprovers(reportType); ddlApprover.DataSource = dt; ddlApprover.DataTextField = "signoffbyaprovername"; ddlApprover.DataBind(); ddlApprover.Items.Insert(0, new ListItem("-- Select --", "0")); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Please select report type');", true); return; } } }
public void deleteUserNotExisting() { objclsBALUsers = new clsBALUsers(); DataSet ds = objclsBALUsers.GetUserDetails(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string strUSERADID = ds.Tables[0].Rows[i][4].ToString(); clsEALUser objclsEALUser = new clsEALUser(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALUser = objclsBALCommon.FetchUserDetailsFromAD(strUSERADID); if (objclsEALUser == null) { objclsBALUsers.DeleteUserFromDb(strUSERADID); } } } } }
public void PopulateGrid() { clsBALCommon objclsBALComm = new clsBALCommon(); string strLatestQuarter = objclsBALComm.GetLatestQuarter(); clsBALReports objclsBALReport = new clsBALReports(); DataSet ds = objclsBALReport.GetAllRecievedReports(strLatestQuarter); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i]["ReportName"] != null) { ds.Tables[0].Rows[i]["ReportName"] = Server.HtmlEncode(ds.Tables[0].Rows[i]["ReportName"].ToString()); } if (ds.Tables[0].Rows[i]["ApplicationName"] != null) { ds.Tables[0].Rows[i]["ApplicationName"] = Server.HtmlEncode(ds.Tables[0].Rows[i]["ApplicationName"].ToString()); } } gvRecievedReports.DataSource = ds; gvRecievedReports.DataBind(); Session[clsEALSession.ReportData] = ds; }
protected void btnSave_Click(object sender, EventArgs e) { lblError.Text = ""; lblSuccess.Text = ""; try { TextBox txtbxDispName = (TextBox)ADU.FindControl("txtbxDispName"); HiddenField hdnfldADID = (HiddenField)ADU.FindControl("hdnfldADID"); if (txtbxDispName.Text != "") { if (ddlRole.SelectedIndex != 0) { if (hdnfldADID.Value != "") { clsBALCommon objclsBALCommon = new clsBALCommon(); clsEALUser objclsEALUser = new clsEALUser(); objclsEALUser = objclsBALCommon.FetchUserDetailsFromAD(hdnfldADID.Value); if (objclsEALUser != null) { bool flag = CheckUserRoles(objclsEALUser); if (!flag) { string userRole = ddlRole.SelectedItem.Value; //bool blnRoleExists = CheckRole(userRole); //if (!blnRoleExists) //{ objclsBALUsers = new clsBALUsers(); bool blnSave = objclsBALUsers.SaveUserRole(objclsEALUser, userRole, objclsEALLoggedInUser.StrUserADID); lblSuccess.Text = "User has been assigned with the role successfully."; hdnfldADID.Value = ""; txtbxDispName.Text = ""; ddlRole.SelectedIndex = 0; PopulateGrid(); //} //else //{ // lblError.Text = "RoleGroup has already been assigned to other user."; //} } } } } else { lblError.Text = "Select role to assign."; } } else { lblError.Text = "Please select a user."; } txtbxDispName.Text = ""; hdnfldADID.Value = ""; ddlRole.SelectedIndex = 0; } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void gvSchedule_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { clsBALUsers objBI_User = new clsBALUsers(); PPLPicker.ADUserControl adu = (PPLPicker.ADUserControl)gvSchedule.Rows[e.RowIndex].FindControl("ADUSerControl1"); TextBox txtbxDispName = (TextBox)adu.FindControl("txtbxDispName"); TextBox txtDateGrid = (TextBox)gvSchedule.Rows[e.RowIndex].FindControl("txtDateGrid"); TextBox txtSubjectGrid = (TextBox)gvSchedule.Rows[e.RowIndex].FindControl("txtSubjectGrid"); Label lblBody = (Label)gvSchedule.Rows[e.RowIndex].FindControl("lblBody"); Label lblRoleID = (Label)gvSchedule.Rows[e.RowIndex].FindControl("lblRoleID"); Label lblGroupID = (Label)gvSchedule.Rows[e.RowIndex].FindControl("lblGroupID"); Label lblUsers1 = (Label)gvSchedule.Rows[e.RowIndex].FindControl("lblUsers1"); string groupID = lblGroupID.Text.ToString(); string[] strApprovers = null; if (Convert.ToDateTime(txtDateGrid.Text.ToString()) <= DateTime.Today) { //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Please select date greater than today.');", true); DateTime Date = System.DateTime.Now.Date; if (Convert.ToDateTime(txtDateGrid.Text.ToString()).Date == Date) { int intTime = System.DateTime.Now.TimeOfDay.Hours; if (intTime >= 9) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Mail cannot be scheduled today after 9 AM.');", true); } else { objBI_User.UpdateScheduleMail(groupID, DateTime.Parse(txtDateGrid.Text.ToString()).Date, txtSubjectGrid.Text.ToString(), lblBody.Text.ToString(), "UpdateSchedule_Mail"); if (txtbxDispName.Text.ToString() != "") { strApprovers = (txtbxDispName.Text.ToString().ToLower()).Split(";".ToCharArray()); for (int i = 0; i < strApprovers.Length; i++) { string strApp = strApprovers[i]; if (strApp != "") { //if (!strFetchedApprovers.Contains<string>(strApp)) //{ clsEALUser objclsEALApp = new clsEALUser(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALApp = objclsBALCommon.FetchUserDetailsFromAD(strApp); string mailid = objclsEALApp.StrUserEmailID; string adID = objclsEALApp.StrUserADID; string selectedUser = lblUsers1.Text; //string[] selectedUserarr = selectedUser.Split(";".ToCharArray()); if (!selectedUser.Contains(objclsEALApp.StrUserName)) { objBI_User.InsertDeleteScheduleMail(Int32.Parse(lblRoleID.Text.ToString()), groupID, objclsEALApp.StrUserName, objclsEALApp.StrUserADID, objclsEALApp.StrUserEmailID, "Insert", DateTime.Parse(txtDateGrid.Text.ToString()).Date, txtSubjectGrid.Text.ToString(), lblBody.Text.ToString()); } //} } } } gvSchedule.EditIndex = -1; BindScheduleGrid(); } } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Past date not allowed.');", true); } } else { objBI_User.UpdateScheduleMail(groupID, DateTime.Parse(txtDateGrid.Text.ToString()).Date, txtSubjectGrid.Text.ToString(), lblBody.Text.ToString(), "UpdateSchedule_Mail"); if (txtbxDispName.Text.ToString() != "") { strApprovers = (txtbxDispName.Text.ToString().ToLower()).Split(";".ToCharArray()); for (int i = 0; i < strApprovers.Length; i++) { string strApp = strApprovers[i]; if (strApp != "") { //if (!strFetchedApprovers.Contains<string>(strApp)) //{ clsEALUser objclsEALApp = new clsEALUser(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALApp = objclsBALCommon.FetchUserDetailsFromAD(strApp); string mailid = objclsEALApp.StrUserEmailID; string adID = objclsEALApp.StrUserADID; string selectedUser = lblUsers1.Text; //string[] selectedUserarr = selectedUser.Split(";".ToCharArray()); if (!selectedUser.Contains(objclsEALApp.StrUserName)) { objBI_User.InsertDeleteScheduleMail(Int32.Parse(lblRoleID.Text.ToString()), groupID, objclsEALApp.StrUserName, objclsEALApp.StrUserADID, objclsEALApp.StrUserEmailID, "Insert", DateTime.Parse(txtDateGrid.Text.ToString()).Date, txtSubjectGrid.Text.ToString(), lblBody.Text.ToString()); } //} } } } gvSchedule.EditIndex = -1; BindScheduleGrid(); } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void btnScheduleMail_Click(object sender, EventArgs e) { try { if (Convert.ToDateTime(txtDate.Text.ToString()) <= DateTime.Today) { DateTime Date = System.DateTime.Now.Date; if (Convert.ToDateTime(txtDate.Text.ToString()).Date == Date) { int intTime = System.DateTime.Now.TimeOfDay.Hours; if (intTime >= 9) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Mail cannot be scheduled today after 9 AM.');", true); } else { clsBALUsers objBI_User = new clsBALUsers(); DataTable dt = (DataTable)Session["dtrolewiseuser"]; if (dt.Rows.Count > 0) { string groupID = Guid.NewGuid().ToString(); foreach (DataRow da in dt.Rows) { string username = da["UserName"].ToString(); string UserADID = da["UserADID"].ToString(); string UserEmail = da["UserEmail"].ToString(); clsBALCommon objclsBALCommon = new clsBALCommon(); objBI_User.InsertDeleteScheduleMail(Int32.Parse(ddlRole.SelectedItem.Value.ToString()), groupID, username, UserADID, UserEmail, "Insert", DateTime.Parse(txtDate.Text.ToString()), txtSubject.Text.ToString(), Editor1.Content.ToString()); } BindScheduleGrid(); BindListbox(); TextBox txtbxDispName = (TextBox)ADU.FindControl("txtbxDispName"); txtbxDispName.Text = ""; txtSubject.Text = ""; txtDate.Text = ""; Editor1.Content = ""; panelMail.Visible = false; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('New mail schedule saved.');", true); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('There is no user to schedule mail.');", true); } } } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Past date not allowed.');", true); } } else { clsBALUsers objBI_User = new clsBALUsers(); DataTable dt = (DataTable)Session["dtrolewiseuser"]; if (dt.Rows.Count > 0) { string groupID = Guid.NewGuid().ToString(); foreach (DataRow da in dt.Rows) { string username = da["UserName"].ToString(); string UserADID = da["UserADID"].ToString(); string UserEmail = da["UserEmail"].ToString(); clsBALCommon objclsBALCommon = new clsBALCommon(); objBI_User.InsertDeleteScheduleMail(Int32.Parse(ddlRole.SelectedItem.Value.ToString()), groupID, username, UserADID, UserEmail, "Insert", DateTime.Parse(txtDate.Text.ToString()), txtSubject.Text.ToString(), Editor1.Content.ToString()); } BindScheduleGrid(); BindListbox(); TextBox txtbxDispName = (TextBox)ADU.FindControl("txtbxDispName"); txtbxDispName.Text = ""; txtSubject.Text = ""; txtDate.Text = ""; Editor1.Content = ""; panelMail.Visible = false; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('New mail schedule saved.');", true); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('There is no user to schedule mail.');", true); } } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void btnAdd_Click(object sender, EventArgs e) { try { clsBALUsers objBI_User = new clsBALUsers(); TextBox txtbxDispName = (TextBox)ADU.FindControl("txtbxDispName"); //HiddenField hdn = (HiddenField)adu.FindControl("hdnfldADID"); string[] strApprovers = null; if (txtbxDispName.Text.ToString() != "") { DataTable dtrolewiseusertemp = (DataTable)Session["dtrolewiseuser"]; strApprovers = (txtbxDispName.Text.ToString().ToLower()).Split(";".ToCharArray()); for (int i = 0; i < strApprovers.Length; i++) { string strApp = strApprovers[i]; if (strApp != "") { clsEALUser objclsEALApp = new clsEALUser(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALApp = objclsBALCommon.FetchUserDetailsFromAD(strApp); if (lstBoxApproverDelete.Items.Count > 0) { foreach (ListItem thisItem in lstBoxApproverDelete.Items) { string strtemp = thisItem.Text.Trim(); if (thisItem.Text.Trim() == objclsEALApp.StrUserName) { lblError.Text = "User " + objclsEALApp.StrUserName + " already exists"; // strtest = strtest + strtemp; goto Outer; } } } string mailid = objclsEALApp.StrUserEmailID; string adID = objclsEALApp.StrUserADID; DataRow dr; dr = dtrolewiseusertemp.NewRow(); dr["UserName"] = objclsEALApp.StrUserName; dr["RoleMappingId"] = objclsEALApp.StrUserSID; dr["UserADID"] = objclsEALApp.StrUserADID; dr["UserEmail"] = objclsEALApp.StrUserEmailID; dtrolewiseusertemp.Rows.Add(dr); // objBI_User.InsertDelete_RoleWiseUser(Int32.Parse(ddlRole.SelectedItem.Value.ToString()), objclsEALApp.StrUserName, objclsEALApp.StrUserADID, objclsEALApp.StrUserEmailID, "Insert"); lblSuccess.Text = "User added successfully"; Outer: continue; } } txtbxDispName.Text = ""; //BindListbox(); Session["dtrolewiseuser"] = dtrolewiseusertemp; lstBoxApproverDelete.DataSource = (DataTable)Session["dtrolewiseuser"]; lstBoxApproverDelete.DataBind(); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('Please select user to Add');", true); } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["LoggedInUserID"] == null) { Response.Redirect("wfrmSessionTimeOut.aspx", true); } if (this.Request.Url.AbsolutePath.ToString() == "/ReviewAccounts.aspx") { objclsEALLoggedInUser = (clsEALUser)Session[clsEALSession.CurrentUser]; strUserName = objclsEALLoggedInUser.StrUserName; strUserSID = objclsEALLoggedInUser.StrUserSID; } else { GetLoggedInUserName(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALLoggedInUser = objclsBALCommon.FetchUserDetailsFromAD(LoggedInUser); Session[clsEALSession.CurrentUser] = objclsEALLoggedInUser; strUserName = objclsEALLoggedInUser.StrUserName; strUserSID = objclsEALLoggedInUser.StrUserSID; } if (Session["RoleSelected"] != null) { role = (string[])Session["RoleSelected"]; //PopulateMenu(); } else { GetCurrentUserRole(); } if (!IsPostBack) { try { // objclsBALUsers = new clsBALUsers(); // DataSet ds = objclsBALUsers.GetLockOut(); // if (Session["lockout"] != null) //{ // Session["lockout"] = ds.Tables[0].Rows[0][0].ToString(); string str = Session["lockout"].ToString(); //str = "True"; if (str == "True") { if (role != null) { if (role.Contains <string>(clsEALRoles.ComplianceAdmin) || role.Contains <string>(clsEALRoles.ComplianceTester) || role.Contains <string>(clsEALRoles.ComplianceAuditor)) { PopulateMenu(); } } } else if (str == "False") { PopulateMenu(); } // } //else //{ // Response.Redirect("wfrmSessionTimeOut.aspx", true); //} //PopulateMenu(); } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); // Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } } } //} catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception excep) { if (excep.Message.Equals("SESSION")) { System.Web.HttpContext.Current.Response.Redirect("wfrmSessionTimeOut.aspx", true); } } }
protected void Page_Load(object sender, EventArgs e) { //Session.Abandon(); Session[clsEALSession.ValuePath] = "Home"; GetLoggedInUserName(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALLoggedInUser = objclsBALCommon.FetchUserDetailsFromAD(LoggedInUser); strUserName = objclsEALLoggedInUser.StrUserName; strUserSID = objclsEALLoggedInUser.StrUserSID; Session[clsEALSession.CurrentUser] = strUserName; btnSave.Visible = false; //GetCurrentUserRole(); if (Session["RoleSelected"] != null) { role = (string[])Session["RoleSelected"]; } else { GetCurrentUserRole(); } if (role != null) { if (role.Contains <string>(clsEALRoles.GlobalApprover)) { objclsBALUsers = new clsBALUsers(); bool IsCo = objclsBALUsers.CheckIfCo(objclsEALLoggedInUser.StrUserSID); if (IsCo) { pnlRole.Visible = true; } } } LockOut(); if (!IsPostBack) { try { AdminHomeFun(); GetHomePageText(); } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } } if (role != null) { if (role.Contains <string>(clsEALRoles.GlobalApprover) && role.Contains <string>(clsEALRoles.ControlOwner)) { if (Session["lockout"] != null) { //Session["lockout"] = ds.Tables[0].Rows[0][0].ToString(); string str = Session["lockout"].ToString(); if (str == "True") { pnlRole.Visible = false; } else { pnlRole.Visible = true; } } } } }
protected void Page_Load(object sender, EventArgs e) { try { //clsADGroupMembers objclsADGroupMembers = new clsADGroupMembers(); //objclsADGroupMembers.GetMembershipWithPath(); //Session.Abandon(); Session[clsEALSession.ValuePath] = "Home"; GetLoggedInUserName(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALLoggedInUser = objclsBALCommon.FetchUserDetailsFromAD(LoggedInUser); //Session["LoggedInUser"] = objclsEALLoggedInUser; if (objclsEALLoggedInUser != null) { strUserName = objclsEALLoggedInUser.StrUserName; strUserSID = objclsEALLoggedInUser.StrUserSID; Session[clsEALSession.CurrentUser] = strUserName; btnSave.Visible = false; if (Session["RoleSelected"] != null) { role = (string[])Session["RoleSelected"]; pnlRole.Visible = true; rdCO.Visible = true; rdGA.Visible = true; btnGo.Visible = true; lblRole.Visible = true; } else { GetCurrentUserRole(); } LockOut(); if (!IsPostBack) { AdminHomeFun(); GetHomePageText(); } if (role != null) { if (role.Contains <string>(clsEALRoles.GlobalApprover) && role.Contains <string>(clsEALRoles.ControlOwner)) { if (Session["lockout"] != null) { //Session["lockout"] = ds.Tables[0].Rows[0][0].ToString(); string str = Session["lockout"].ToString(); if (str == "True") { pnlRole.Visible = false; } else { pnlRole.Visible = true; } } } } } else { Response.Redirect("wfrmUnauthorized.aspx", false); } if (role != null && Convert.ToString(role[0]).Trim() == "") { Response.Redirect("wfrmUnauthorized.aspx", false); } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", true); } }