private void ChangeValue(string DataValue_Old, string DataValue, int ID_Value, string TxtBxNameValue) { InsiteUser IU = Functions.GetUser(); if (Session["update"].ToString() == ViewState["update"].ToString()) { try { using (SqlService _SP_UpdtRcrd = new SqlService()) { _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_Rec_ID", ID_Value)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_DataValue_Old", DataValue_Old)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_DataValue", DataValue)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_TxtBxNameValue", TxtBxNameValue)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_UserNameValue", IU.UserName)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_FiscalYrValue", DrpDwnLst_FsclYR.SelectedValue)); _SP_UpdtRcrd.AddParameter(new System.Data.SqlClient.SqlParameter("@_ChptrIDValue", DrpDwnLst_Chptr2.SelectedValue)); _SP_UpdtRcrd.ExecuteSP("sp_Insite3_ChapterSelfReportedImpressions_MonthlyValues_UpdtRcrd"); } BindGridAfterUpdate(true); Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); } catch (Exception ex) { Lbl_Error.Text = ex.Message; } } else { BindGridAfterUpdate(false); } }
private void Accessibility(string LockedOut, string RegionAdmin) { bool HasAccess = false; InsiteUser IU = Functions.GetUser(); IU.ChapterID.ToString(); if (Functions.CheckGroup("Chapter Self Reported Impressions Super Admin")) //Active Directory { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallSuperAdminFunction", "SuperAdmin();", true); } else //Database Driven { string[] users = RegionAdmin.Split(','); foreach (string user in users) { if (IU.UserName.ToUpper().Trim() == user.ToUpper().Trim()) { HasAccess = true; break; } } if (HasAccess == true && LockedOut == "No") { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallChapterAdminFunction", "ChapterAdmin();", true); } } }
private void LoadData() { InsiteUser IU = Functions.GetUser(); string UserChptrID = IU.ChapterID.ToString(); string Year = DateTime.Parse(DateTime.Now.ToString()).AddYears(1).Year.ToString(); if (UserChptrID == "999") { BindGrid("423", Year); BindHistoryGrid("423", Year); BindPrintGrid("423", Year); } else { BindGrid(UserChptrID, Year); BindHistoryGrid(UserChptrID, Year); BindPrintGrid(UserChptrID, Year); } //if (_DT_PageLoadUserChptrID.Rows.Count > 0) //{ using (SqlService _S = new SqlService()) { DataTable _DT_DrpDwnLst_Chptr2 = _S.ExecuteSqlDataSet("SELECT ChapterID AS ChptrID,ParentID,Name AS ChptrName FROM Insite3_ChapterSelfReportedImpressionsChapters WHERE ChapterID <> 999 ORDER BY Name").Tables[0]; for (int i = 0; i < _DT_DrpDwnLst_Chptr2.Rows.Count; i++) { ListItem _LI = new ListItem(); _LI.Value = _DT_DrpDwnLst_Chptr2.Rows[i]["ChptrID"].ToString(); _LI.Text = _DT_DrpDwnLst_Chptr2.Rows[i]["ChptrName"].ToString(); DrpDwnLst_Chptr2.Items.Add(_LI); //DrpDwnLst_Chptr2.SelectedValue = _DT_PageLoadUserChptrID.Rows[0]["ChptrID"].ToString(); } if (UserChptrID == "999") { DrpDwnLst_Chptr2.SelectedValue = "423"; } else { DrpDwnLst_Chptr2.SelectedValue = UserChptrID; } DataTable _DTYear = _S.ExecuteSqlDataSet("SELECT DISTINCT (FiscalYear) FROM [ALZ].[dbo].[Insite3_ChapterSelfReportedImpressions] WHERE FiscalYear < 2022 ORDER BY FiscalYear").Tables[0]; for (int i = 0; i < _DTYear.Rows.Count; i++) { ListItem _LI = new ListItem(); _LI.Value = _DTYear.Rows[i]["FiscalYear"].ToString(); _LI.Text = "FY" + _DTYear.Rows[i]["FiscalYear"].ToString().Substring(2, 2); DrpDwnLst_FsclYR.Items.Add(_LI); //DrpDwnLst_FsclYR.SelectedValue = _DT_PageLoadUserChptrID.Rows[0]["FiscalYear"].ToString(); } DrpDwnLst_FsclYR.SelectedValue = Year; } //} }
private void Accessibility(string LockedOut, string RegionAdmin) { InsiteUser IU = Functions.GetUser(); IU.ChapterID.ToString(); if (Functions.CheckGroup("Chapter Self Reported Impressions National Super Admin")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallChptrAdminFunction", "SuperAdmin();", true); } if (Functions.CheckGroup("Chapter Self Reported Impressions Super Admin")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallSuperAdminFunction", "ChptrAdmin();", true); } if (IU.UserName == RegionAdmin && LockedOut == "No") { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallRegionAdminFunction", "RegionAdmin();", true); } }