protected void btnExport_Click(object sender, EventArgs e) { if (Session[clsEALSession.Applications] != null) { gdExport.AllowPaging = false; gdExport.AllowSorting = true; try { DataSet dsgrd = new DataSet(); dsgrd = (DataSet)(Session[clsEALSession.Applications]); DataSet ds1 = new DataSet(); ds1 = dsgrd.Copy(); DataTable dtExport = new DataTable(); if (iFlag != 1) { ds1.Tables[0].Columns["AppName"].SetOrdinal(0); ds1.Tables[0].Columns["Approvers"].SetOrdinal(1); ds1.Tables[0].Columns["CtrlOwner"].SetOrdinal(2); DataTable dtTest = ds1.Tables[0]; DataColumn dcApplicationName = new DataColumn("Application Name"); DataColumn dcCtrlOwner = new DataColumn("Control Owner"); DataColumn dcApprovers = new DataColumn("Approvers"); dtExport.Columns.Add(dcApplicationName); dtExport.Columns.Add(dcCtrlOwner); dtExport.Columns.Add(dcApprovers); for (int i = 0; i < dtTest.Rows.Count; i++) { DataRow dr; dr = dtExport.NewRow(); dr["Application Name"] = dtTest.Rows[i].ItemArray[0]; dr["Approvers"] = dtTest.Rows[i].ItemArray[1]; dr["Control Owner"] = dtTest.Rows[i].ItemArray[2]; dtExport.Rows.Add(dr); } } gdExport.DataSource = dtExport; Session["ExportTable"] = dtExport; gdExport.DataBind(); SortGridViewOnExport(); PrepareGridViewForExport(gdExport); } 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); } ExportGridView(gdExport); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "aa", "javascript:alert('No records found');", 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 { 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) { 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); } }