protected void ddlQuarter_SelectedIndexChanged(object sender, EventArgs e) { try { strQuarterSelected = ddlQuarter.SelectedItem.Value.ToString(); Session[clsEALSession.SelectedQuarter] = strQuarterSelected; BindAppGrid(); if (ddlQuarter.SelectedIndex == -1 || ddlQuarter.SelectedIndex == 0) { gvApplications.Visible = false; lblMsg.Visible = false; } else { gvApplications.Visible = true; lblMsg.Visible = true; } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { //LogHelper.LogError(ex); HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
public void GetLoggedInUserName() { try { 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; } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { // LogHelper.LogError(ex); HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void gvSchedule_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { clsBALUsers objBI_User = new clsBALUsers(); Label lblGroupID = (Label)gvSchedule.Rows[e.RowIndex].FindControl("lblGroupID"); string groupID = lblGroupID.Text.ToString(); objBI_User.DeleteScheduleMail(groupID, "Delete_Schedule"); 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 btnSave_Click(object sender, EventArgs e) { try { if (Editor1.Content.ToString() != "") { SubmitAnnouncement(); } GetHomePageText(); Editor1.Visible = false; btnEdit.Visible = 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 gvRole_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataSet ds = new DataSet(); gvRole.EditIndex = -1; try { if (objCustomPager2 == null) { no_Rows = Convert.ToInt32(ddlShowResult.SelectedValue); objCustomPager2 = new clsCustomPager(gvRole, no_Rows, "Page", "of"); } objCustomPager2.PageGroupChanged(gvRole.TopPagerRow, e.NewPageIndex); objCustomPager2.PageGroupChanged(gvRole.BottomPagerRow, e.NewPageIndex); gvRole.PageSize = Convert.ToInt32(ddlShowResult.SelectedValue); if (Session[clsEALSession.UserDetails] != null) { ds = Session[clsEALSession.UserDetails] as DataSet; } string sortexpression = string.Empty; string sortdirection = string.Empty; if (ViewState["SortExpression"] != null) { sortexpression = Convert.ToString(ViewState["SortExpression"]); } if (ViewState["sortDirection"] != null) { sortdirection = Convert.ToString(ViewState["sortDirection"]); } gvRole.PageIndex = e.NewPageIndex; if (sortexpression == string.Empty) { gvRole.DataSource = ds; gvRole.DataBind(); } else if (sortdirection == ASCENDING) { SortGridView(sortexpression, ASCENDING); } else { SortGridView(sortexpression, DESCENDING); } } 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 gvReports_Sort(object sender, GridViewSortEventArgs e) { try { string sortExpression = e.SortExpression; string sortdirection = DESCENDING; if (sortdirection == DESCENDING) { SortGridView(sortExpression, GetSortDirection(sortExpression)); } else { SortGridView(sortExpression, DESCENDING); } } 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_RowCreated(object sender, GridViewRowEventArgs e) { int sortColumnIndex = 0; try { if (e.Row.RowType == DataControlRowType.Header) { sortColumnIndex = GetSortColumnIndex(); if (sortColumnIndex != -1) { AddSortImage(sortColumnIndex, e.Row); } } } 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 btnExport_Click(object sender, EventArgs e) { try { gdExport.AllowPaging = false; gdExport.AllowSorting = true; DataSet dsgrd = new DataSet(); dsgrd = (DataSet)(Session[clsEALSession.ReportData]); DataTable dtExport = dsgrd.Tables[0]; if (iFlag != 1) { DataColumn dcReportName = new DataColumn("Report Name"); DataColumn dcType = new DataColumn("Type"); DataColumn dcRecieved = new DataColumn("Received"); DataColumn dcOnline = new DataColumn("Online"); } dtExport.Columns["Recieved"].ColumnName = "Recieved"; gdExport.DataSource = 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); }
protected void lnkBody_Click(object sender, EventArgs e) { try { // get the gridviewrow from the sender so we can get the datakey we need LinkButton lnkbody = sender as LinkButton; GridViewRow row = (GridViewRow)lnkbody.NamingContainer; Session["linkbtn"] = lnkbody; Session["Sender"] = sender; Label lblGroupID = (Label)row.FindControl("lblGroupID"); ViewState["lblGroupID"] = lblGroupID.Text; Label lblBody = (Label)row.FindControl("lblBody"); //ViewState["lblBody"] = lblBody.Text; modalbody.Show(); CommentEditor.Content = lblBody.Text; } 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 gvDatabase_RowDeleting(object sender, GridViewDeleteEventArgs e) { lblSuccess.Text = ""; lblError.Text = ""; gvDatabase.EditIndex = -1; try { //Label lblAppID = (Label)gvDatabase.Rows[e.RowIndex].FindControl("lblAppID"); //int appid = Convert.ToInt16(lblAppID.Text.ToString()); Label lblDatabaseMappingID = (Label)gvDatabase.Rows[e.RowIndex].FindControl("lblDBId"); int DatabaseMappingID = Convert.ToInt16(lblDatabaseMappingID.Text.ToString()); //SortGridViewOnEditDelete(); //SortGridViewOnEditDelete(); //bool del_GrdValues= objclsBALMasterData = new clsBALMasterData(); objclsBALMasterData.DeleteDBMapping(DatabaseMappingID, objclsEALLoggedInUser.StrUserADID); //DeleteMapping(appid, DatabaseMappingID); //DeleteShare(ShareID); lblSuccess.Text = "Database deleted sucessfully."; PopulateGrid(); } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { lblError.Text = ""; lblSuccess.Text = ""; Session[clsEALSession.ValuePath] = "Mappings/Mail Schedule"; txtDate.Attributes.Add("readonly", "true"); btnDeleteAll.Attributes.Add("onclick", "javascript:return Delete('" + hdnName.ClientID + "','" + hdnEmailid.ClientID + "','" + lstGridUsers.ClientID + "')"); // Session[clsEALSession.ValuePath] = "Mappings/Approver's Mapping"; if (!IsPostBack) { gvSchedule.AllowPaging = true; gvSchedule.PageSize = 10; BindDropDown(); BindListbox(); 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 gvServer_Sorting(object sender, GridViewSortEventArgs e) { try { gvServer.EditIndex = -1; string sortExpression = e.SortExpression; ViewState["expression"] = e.SortExpression; string sortdirection = DESCENDING; if (sortdirection == DESCENDING) { SortGridView(sortExpression, GetSortDirection(sortExpression)); } else { SortGridView(sortExpression, DESCENDING); } } 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 gvServer_RowDeleting(object sender, GridViewDeleteEventArgs e) { lblSuccess.Text = ""; lblError.Text = ""; gvServer.EditIndex = -1; try { Label lblServerID = (Label)gvServer.Rows[e.RowIndex].FindControl("lblServerID"); int ServerID = Convert.ToInt16(lblServerID.Text.ToString()); SortGridViewOnEditDelete(); DeleteServer(ServerID); PopulateGrid(); } 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 gvServer_RowUpdating(object sender, GridViewUpdateEventArgs e) //{ // try // { // Label lblServerID = (Label)gvServer.Rows[e.RowIndex].FindControl("lblServerID"); // int ServerID = Convert.ToInt16(lblServerID.Text.ToString()); // TextBox txtServerName = (TextBox)gvServer.Rows[e.RowIndex].FindControl("txtServerName"); // string strServerName = txtServerName.Text.ToString(); // if (strServerName != "") // { // bool flag = CheckIFDBServerExists(strServerName); // if (flag == false) // { // objclsBALApplication = new clsBALApplication(); // objclsBALApplication.UpdateDBServer(ServerID, strServerName); // gvServer.EditIndex = -1; // PopulateGrid(); // if (ViewState["SortExpression"] != null && ViewState["sortDirection"] != null) // { // SortGridView(ViewState["SortExpression"].ToString(), ViewState["sortDirection"].ToString()); // } // lblSuccess.Text = "Database server updated successfully."; // } // else // { // if (Session["serverName"].ToString() == strServerName) // { // lblError.Text = "There is no change in server name."; // // gvServer.EditIndex = -1; // } // else // { // lblError.Text = "Database server already exists."; // // gvServer.EditIndex = -1; // } // } // } // else // { // lblError.Text = "Please fill database server name."; // } // } // 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 gvServer_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { Label lblServerID = (Label)gvServer.Rows[e.RowIndex].FindControl("lblServerID"); int ServerID = Convert.ToInt16(lblServerID.Text.ToString()); TextBox txtServerName = (TextBox)gvServer.Rows[e.RowIndex].FindControl("txtServerName"); string strServerName = txtServerName.Text.ToString(); DropDownList ddlDBServerType = (DropDownList)gvServer.Rows[e.RowIndex].FindControl("ddlGridServerType"); if (ddlDBServerType.SelectedValue.ToString().Trim() != "0") { int ServerType_ID = int.Parse(ddlDBServerType.SelectedValue.ToString()); if (strServerName != "") { //bool flag = CheckIFDBServerExists(strServerName); bool flag = false; if (flag == false) { objclsBALApplication = new clsBALApplication(); objclsBALApplication.UpdateDBServer(ServerID, strServerName, ServerType_ID); gvServer.EditIndex = -1; PopulateGrid(); if (ViewState["SortExpression"] != null && ViewState["sortDirection"] != null) { SortGridView(ViewState["SortExpression"].ToString(), ViewState["sortDirection"].ToString()); } lblSuccess.Text = "Database server updated successfully."; } else { if (Session["serverName"].ToString() == strServerName) { lblError.Text = "There is no change in server name."; // gvServer.EditIndex = -1; } else { lblError.Text = "Database server already exists."; // gvServer.EditIndex = -1; } } } else { lblError.Text = "Please fill database server name."; } } } 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 Page_Load(object sender, EventArgs e) { if (Session["AllAccounts"] != null) { Session["AllAccounts"] = null; } gvApplication1.AllowPaging = true; GetLoggedInuser(); strUserSID = objclsEALLoggedInUser.StrUserSID; GetCurrentUserRole(); if (!IsPostBack) { try { PopuateApplications(); } 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 Page_Load(object sender, EventArgs e) { lblError.Text = ""; lblSuccess.Text = ""; GetLoggedInuser(); GetCurrentUserRole(); ExpirePageCache(); lblError.Text = ""; lblSuccess.Text = ""; //btnCloseWindow.Attributes.Add("onclick", "window.close();opener.location.href='ShareList.aspx';"); if (Request.QueryString["Nav"] != null) { btnCloseWindow.Attributes.Add("onclick", "window.close();opener.location.href='DatabaseMappings.aspx';"); } else { btnCloseWindow.Attributes.Add("onclick", "window.close();opener.location.href='ShareList.aspx';"); } //string strscript = "<script language=javascript>window.top.close();</script>"; //if (!Page.IsStartupScriptRegistered("clientScript")) //{ // Page.RegisterStartupScript("clientScript", strscript); //} if (Request.QueryString["server"] != null) { btnCloseWindow.Visible = true; Menu menu = (Menu)this.Master.FindControl("MnuTopNav"); menu.Enabled = false; LinkButton lnkLogOut = (LinkButton)this.Master.FindControl("lnkLogOut"); lnkLogOut.Enabled = false; } if (!IsPostBack) { try { PopulateGrid(); PopulateServerType(); MasterPage master = new MasterPage(); Menu menu = (Menu)this.Master.FindControl("MnuTopNav"); menu.Visible = false; //top menu invisible } 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 Page_Load(object sender, EventArgs e) { try { string strReportType = ddlReportType.SelectedValue.ToString(); MultiView1.ActiveViewIndex = Int32.Parse(strReportType); if (!IsPostBack) { //QuarterDropDown(); PopulateAppDropDown(); } } 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 Page_Load(object sender, EventArgs e) { Session[clsEALSession.ValuePath] = "Reports"; Session[clsEALSession.Display] = "All Reports"; GetLoggedInUserName(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALLoggedInUser = objclsBALCommon.FetchUserDetailsFromAD(LoggedInUser); strUserName = objclsEALLoggedInUser.StrUserName; strUserSID = objclsEALLoggedInUser.StrUserSID; Session[clsEALSession.UserSID] = strUserSID; Session[clsEALSession.CurrentUser] = strUserName; lblError.Text = ""; lblSuccess.Text = ""; GetCurrentUserRole(); if (!IsPostBack) { try { if (role != null) { if (role.Contains <string>(clsEALRoles.ComplianceAdmin) || role.Contains <string>(clsEALRoles.ComplianceAuditor) || role.Contains <string>(clsEALRoles.ComplianceTester) || role.Contains <string>(clsEALRoles.ControlOwner) || role.Contains <string>(clsEALRoles.GlobalApprover) || role.Contains <string>(clsEALRoles.Approver)) { lblPeriod.Visible = true; ddlQuarter.Visible = true; lblMsg.Visible = false; QuarterDropDown(); //if (ddlQuarter.SelectedIndex != 0) //{ // BindAppGrid(); //} //else //{ // lblError.Text = "Please select quarter."; //} } else { strQuarterSelected = ""; Session[clsEALSession.SelectedQuarter] = strQuarterSelected; BindAppGrid(); } } } 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) { lblError.Text = ""; lblSuccess.Text = ""; //gvInitiative.EditIndex = -1; if (!IsPostBack) { try { GetLoggedInuser(); GetCurrentUserRole(); PopulateGrid(); } 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); } } }
public static void LogError(Exception exc) { HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(exc, Context); HttpContext.Current.Server.Transfer("wfrmErrorPage.aspx", false); }
protected void gv_UnmappedSecGrp_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { DataSet ds = new DataSet(); if (Session[clsEALSession.ReportData] != null) { ds = Session[clsEALSession.ReportData] as DataSet; } string sortexpression = string.Empty; string sortdirection = string.Empty; if (ViewState["SortExpression"] != null) { sortexpression = Convert.ToString(ViewState["SortExpression"]); } if (ViewState["sortDirection"] != null) { sortdirection = Convert.ToString(ViewState["sortDirection"]); } if (objCustomPager2 == null) { objCustomPager2 = new clsCustomPager(gv_UnmappedSecGrp, no_Rows, "Page", "of"); } objCustomPager2.PageGroupChanged(gv_UnmappedSecGrp.TopPagerRow, e.NewPageIndex); objCustomPager2.PageGroupChanged(gv_UnmappedSecGrp.BottomPagerRow, e.NewPageIndex); if (sortexpression == string.Empty) { gv_UnmappedSecGrp.DataSource = ds; gv_UnmappedSecGrp.DataBind(); } else if (sortdirection == ASCENDING) { SortGridView(sortexpression, ASCENDING); } else { SortGridView(sortexpression, DESCENDING); } } 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) { lblError.Text = ""; lblSuccess.Text = ""; try { if (txtServer.Text.ToString().Trim() != "") { objclsBALApplication = new clsBALApplication(); string strServerName = txtServer.Text.ToString(); int servertypeID = Convert.ToInt32(ddlDBServerType.SelectedValue); bool flag = CheckIFDBServerExists(strServerName, servertypeID); if (flag == true) { bool flag1 = CheckIFDBServerExists1(strServerName, servertypeID); if (flag1 == true) { bool bln = objclsBALApplication.UpdateDBServerStatus(strServerName, servertypeID); lblError.Text = "Database server saved successfully"; PopulateGrid(); } else { lblError.Text = "Database server already exist"; } } else { bool bln = objclsBALApplication.SaveDBServer(strServerName, servertypeID); lblSuccess.Text = "Database server saved successfully"; txtServer.Text = ""; PopulateGrid(); } } else { lblError.Text = "Please fill server name."; } } 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 gvApplications_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { DataSet ds = new DataSet(); if (Session[clsEALSession.Applications] != null) { ds = Session[clsEALSession.Applications] as DataSet; } string sortexpression = string.Empty; string sortdirection = string.Empty; if (ViewState["SortExpression"] != null) { sortexpression = Convert.ToString(ViewState["SortExpression"]); } if (ViewState["sortDirection"] != null) { sortdirection = Convert.ToString(ViewState["sortDirection"]); } gvApplications.PageIndex = e.NewPageIndex; if (sortexpression == string.Empty) { gvApplications.DataSource = ds; gvApplications.DataBind(); } else if (sortdirection == ASCENDING) { SortGridView(sortexpression, ASCENDING); } else { SortGridView(sortexpression, DESCENDING); } } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { // LogHelper.LogError(ex); HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } }
protected void gvInitiative_RowEditing(object sender, GridViewEditEventArgs e) { gvInitiative.EditIndex = e.NewEditIndex; //Button btn = (Button).Rows[0].FindControl("lbtnDelete"); //btn.Enabled = false; btnAdd.Enabled = false; try { SortGridViewOnEditDelete(); RadioButton rbtnUpdateTrue = (RadioButton)gvInitiative.Rows[e.NewEditIndex].FindControl("rbtnUpdateTrue"); RadioButton rbtnUpdateFalse = (RadioButton)gvInitiative.Rows[e.NewEditIndex].FindControl("rbtnUpdateFalse"); Label lblGridUpdateHdn = (Label)gvInitiative.Rows[e.NewEditIndex].FindControl("lblGridUpdateHdn"); RadioButton rbtnVisibleTrue = (RadioButton)gvInitiative.Rows[e.NewEditIndex].FindControl("rbtnVisibleTrue"); RadioButton rbtnVisibleFalse = (RadioButton)gvInitiative.Rows[e.NewEditIndex].FindControl("rbtnVisibleFalse"); Label lblGridVisibleHdn = (Label)gvInitiative.Rows[e.NewEditIndex].FindControl("lblGridVisibleHdn"); if (lblGridUpdateHdn.Text.ToString().Trim().ToUpper() == "YES") { rbtnUpdateTrue.Checked = true;; } else { rbtnUpdateFalse.Checked = true; } if (lblGridVisibleHdn.Text.ToString().Trim().ToUpper() == "YES") { rbtnVisibleTrue.Checked = true; } else { rbtnVisibleFalse.Checked = true; } } 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 gvDatabase_RowEditing(object sender, GridViewEditEventArgs e) { try { btnAddServer.Enabled = false; btnAddApp.Enabled = false; btnAdd.Enabled = false; lblError.Text = ""; lblSuccess.Text = ""; gvDatabase.EditIndex = e.NewEditIndex; SortGridViewOnEditDelete(); TextBox txtGridDatabaseName = (TextBox)gvDatabase.Rows[e.NewEditIndex].FindControl("txtGridDatabaseName"); Label lblGridServerNameHdn = (Label)gvDatabase.Rows[e.NewEditIndex].FindControl("lblGridServerName"); DropDownList ddlGridServerName = (DropDownList)gvDatabase.Rows[e.NewEditIndex].FindControl("ddlGridServerName"); PopulateServerDropDown(ddlGridServerName); Label lblGridAppNameHdn = (Label)gvDatabase.Rows[e.NewEditIndex].FindControl("lblGridAppNameHdn"); DropDownList ddlGridAppName = (DropDownList)gvDatabase.Rows[e.NewEditIndex].FindControl("ddlGridAppName"); PopulateAppDropDown(ddlGridAppName); foreach (ListItem lsItem in ddlGridServerName.Items) { if (lsItem.Text.Trim() == lblGridServerNameHdn.Text.ToString().Trim()) { lsItem.Selected = true; break; } } foreach (ListItem lsItem in ddlGridAppName.Items) { if (lsItem.Text.Trim() == lblGridAppNameHdn.Text.ToString().Trim()) { lsItem.Selected = true; break; } } string strServer = ddlGridServerName.SelectedItem.Value; string strApp = ddlGridAppName.SelectedItem.Value; Label lblGridDatabaseHdn = (Label)gvDatabase.Rows[e.NewEditIndex].FindControl("lblGridDatabaseHdn"); string strDatabase = lblGridDatabaseHdn.Text.Trim(); } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", false); } }
protected void gvInitiative_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dt = new DataTable(); try { if (Session[clsEALSession.Initiatives] != null) { dt = Session[clsEALSession.Initiatives] as DataTable; } string sortexpression = string.Empty; string sortdirection = string.Empty; if (ViewState["SortExpression"] != null) { sortexpression = Convert.ToString(ViewState["SortExpression"]); } if (ViewState["sortDirection"] != null) { sortdirection = Convert.ToString(ViewState["sortDirection"]); } gvInitiative.PageIndex = e.NewPageIndex; if (sortexpression == string.Empty) { gvInitiative.DataSource = dt; gvInitiative.DataBind(); } else if (sortdirection == ASCENDING) { SortGridView(sortexpression, ASCENDING); } else { SortGridView(sortexpression, DESCENDING); } } 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 gvDatabase_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataSet ds = new DataSet(); gvDatabase.EditIndex = -1; btnAddServer.Enabled = true; btnAddApp.Enabled = true; btnAdd.Enabled = true; try { if (Session[clsEALSession.DatabaseMapping] != null) { ds = Session[clsEALSession.DatabaseMapping] as DataSet; } string sortexpression = string.Empty; string sortdirection = string.Empty; if (ViewState["SortExpression"] != null) { sortexpression = Convert.ToString(ViewState["SortExpression"]); } if (ViewState["sortDirection"] != null) { sortdirection = Convert.ToString(ViewState["sortDirection"]); } gvDatabase.PageIndex = e.NewPageIndex; if (sortexpression == string.Empty) { gvDatabase.DataSource = ds; gvDatabase.DataBind(); } else if (sortdirection == ASCENDING) { SortGridView(sortexpression, ASCENDING); } else { SortGridView(sortexpression, DESCENDING); } } catch (Exception ex) { HttpContext context = HttpContext.Current; LogException objclsLogException = new LogException(); objclsLogException.LogErrorInDataBase(ex, context); Response.Redirect("wfrmErrorPage.aspx", false); } }
protected void gvRole_RowUpdating(object sender, GridViewUpdateEventArgs e) { lblError.Text = ""; lblSuccess.Text = ""; try { Label lblUserADID = (Label)gvRole.Rows[e.RowIndex].FindControl("lblUserADID"); string strUsersADID = lblUserADID.Text.ToString(); DropDownList ddlGridRole = (DropDownList)gvRole.Rows[e.RowIndex].FindControl("ddlGridRole"); clsEALUser objclsEALuser = new clsEALUser(); objclsBALCommon = new clsBALCommon(); objclsEALuser = objclsBALCommon.FetchUserDetailsFromAD(strUsersADID); string strUserRole = ddlGridRole.SelectedItem.Value; if (objclsEALuser != null) { if (ddlGridRole.SelectedIndex != 0) { objclsBALUsers = new clsBALUsers(); objclsBALUsers.UpdateUser(objclsEALuser, strUserRole, objclsEALLoggedInUser.StrUserADID); lblSuccess.Text = "User's role updated successfully."; gvRole.EditIndex = -1; PopulateGrid(); if (ViewState["SortExpression"] != null && ViewState["sortDirection"] != null) { SortGridView(ViewState["SortExpression"].ToString(), ViewState["sortDirection"].ToString()); } } else { lblError.Text = "select role for user."; } } 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 btnAdd_Click(object sender, EventArgs e) { lblError.Text = ""; lblSuccess.Text = ""; try { if (txtIntitiative.Text.ToString().Trim() != "") { objclsBALApplication = new clsBALApplication(); string strInitiativeNm = txtIntitiative.Text.ToString(); bool blnUpdate = false; bool blnVisible = false; if (chkUpdate.Checked) { blnUpdate = true; } if (chkVisible.Checked) { blnVisible = true; } bool blnExists = objclsBALApplication.SaveInitiative(strInitiativeNm, blnUpdate, blnVisible); if (!blnExists) { lblSuccess.Text = "Initiative saved successfully."; PopulateGrid(); } else { lblError.Text = "Initiatives already exists."; } } else { lblError.Text = "Please fill Initiative Name."; } } 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 gvApplications_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandArgument.ToString() == "Application") { if (ddlQuarter.SelectedIndex != 0) { string report = string.Empty; try { LinkButton lnkApp_Name = (LinkButton)e.CommandSource; GridViewRow gvrRow = (GridViewRow)lnkApp_Name.Parent.Parent; Label lblAppName = (Label)gvrRow.FindControl("lblAppID"); Session[clsEALSession.SelectedAppplication] = lnkApp_Name.Text; Session[clsEALSession.ApplicationID] = lblAppName.Text; report = lnkApp_Name.Text; } catch (NullReferenceException) { Response.Redirect("wfrmErrorPage.aspx", true); } catch (Exception ex) { //LogHelper.LogError(ex); HttpContext Context = HttpContext.Current; LogException objLogException = new LogException(); objLogException.LogErrorInDataBase(ex, Context); Response.Redirect("wfrmErrorPage.aspx", true); } if (report.Equals("Online databases")) { Session[clsEALSession.Display] = "All Accounts (servers/shares and Online Databases–all users, Oracle and SQL Databases- DBAs and System Administrators Only)"; Response.Redirect("AllAccounts.aspx"); } else { Response.Redirect("AllReports.aspx"); } } else { lblError.Text = "Please select quarter to continue."; } } }