protected void SelectActivityType(object sender, EventArgs e) { RadComboBoxItem item = null; switch (ddlIncidentType.SelectedValue) { case "CST": ddlReportedLocation.Items.Clear(); ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.HRLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.HRLocation.Plant.PLANT_NAME, SessionManager.UserContext.HRLocation.Plant.PLANT_ID.ToString())); List <BusinessLocation> custLocations = SQMModelMgr.UserAccessibleLocations(SessionManager.UserContext.Person, SQMModelMgr.SelectBusinessLocationList(0, 0, false, true, true), false, true, ddlIncidentType.SelectedValue); foreach (BusinessLocation loc in custLocations) { ddlReportedLocation.Items.Add(SQMBasePage.SetLocationItem(loc, true)); } break; case "RCV": ddlReportedLocation.Items.Clear(); List <BusinessLocation> locationList = UserContext.FilterPlantAccessList(SQMModelMgr.SelectBusinessLocationList(SessionManager.PrimaryCompany().COMPANY_ID, 0, true)); SQMBasePage.SetLocationList(ddlReportedLocation, locationList, 0); break; default: ddlReportedLocation.Items.Clear(); ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.WorkingLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.WorkingLocation.Plant.PLANT_NAME, SessionManager.UserContext.WorkingLocation.Plant.PLANT_ID.ToString())); if (SessionManager.UserContext.WorkingLocation.Plant.PLANT_ID != SessionManager.UserContext.HRLocation.Plant.PLANT_ID) { ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.HRLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.HRLocation.Plant.PLANT_NAME, SessionManager.UserContext.HRLocation.Plant.PLANT_ID.ToString())); } break; } }
private List <BusinessLocation> LocationList() { List <BusinessLocation> locationList = new List <BusinessLocation>(); locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true).ToList(); locationList = UserContext.FilterPlantAccessList(locationList); return(locationList); }
private void SetupPage() { ddlScheduleScope.Items.Clear(); SysPriv maxPriv = UserContext.GetMaxScopePrivilege(SysScope.busloc); if (maxPriv <= SysPriv.config) // is a plant admin or greater ? { List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { ddlScheduleScope.Visible = false; mnuScheduleScope.Visible = true; SQMBasePage.SetLocationList(mnuScheduleScope, locationList, 0, SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME, "TOP", true); RadMenuItem mi = new RadMenuItem(); mi.Text = (SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME); mi.Value = "0"; mi.ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; mnuScheduleScope.Items[0].Items.Insert(0, mi); } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; SQMBasePage.SetLocationList(ddlScheduleScope, locationList, 0, true); ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } // get tasks - due or escalated respForList = new List <decimal>(); respForList.Add(SessionManager.UserContext.Person.PERSON_ID); respForList.AddRange(SQMModelMgr.SelectPersonListBySupvID(SessionManager.UserContext.Person.EMP_ID).Select(l => l.PERSON_ID).ToList()); respPlantList = new List <decimal>(); SessionManager.UserContext.TaskList.Clear(); SessionManager.UserContext.TaskList = new List <TaskItem>(); DateTime fromDate = DateTime.Now.AddMonths(-3); if (UserContext.CheckUserPrivilege(SysPriv.view, SysScope.inbox)) { SessionManager.UserContext.TaskList.AddRange(TaskMgr.ProfileInputStatus(new DateTime(fromDate.Year, fromDate.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), respForList, respPlantList)); SessionManager.UserContext.TaskList.AddRange(TaskMgr.IncidentTaskStatus(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, respForList, respPlantList, false)); } ++SessionManager.UserContext.InboxReviews; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { uclIssueSearch.BindCSTIssueSearch(true, "CST", new PSsqmEntities()); List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(uclIssueSearch.DDLPlantSelect, UserContext.FilterPlantAccessList(locationList, "SQM", ""), -1); } }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect.SelectedValue = "A"; } divAuditList.Visible = true; dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; // ABW 1/5/16 - use user's default plant local time for search default DateTime localTime = SessionManager.UserContext.LocalTime; dmFromDate.SelectedDate = localTime.AddMonths(-1); dmToDate.SelectedDate = localTime.AddMonths(1); if (Mode == AuditMode.Audit) { lblViewEHSRezTitle.Text = GetLocalResourceObject("lblViewEHSRezTitleResource1.Text").ToString(); lblPageInstructions.Text = GetLocalResourceObject("lblPageInstructionsResource1.Text").ToString(); //lblStatus.Text = "Assessment Status:"; rbNew.Text = GetLocalResourceObject("rbNewResource1.Text").ToString(); lblAuditDate.Visible = true; phAudit.Visible = true; SETTINGS sets = SQMSettings.GetSetting("EHS", "AUDITSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } if (rcbAuditType.Items.Count < 1) { foreach (AUDIT_TYPE ip in EHSAuditMgr.SelectAuditTypeList(SessionManager.PrimaryCompany().COMPANY_ID, false)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.AUDIT_TYPE_ID.ToString()); item.Checked = true; rcbAuditType.Items.Add(item); } } } }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect.SelectedValue = "A"; } divAuditList.Visible = true; dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; dmFromDate.SelectedDate = DateTime.Now.AddMonths(-1); dmToDate.SelectedDate = DateTime.Now.AddMonths(1); if (Mode == AuditMode.Audit) { lblViewEHSRezTitle.Text = "Manage Environmental Health & Safety Audits"; lblPageInstructions.Text = "Add or update EH&S Audits below."; //lblStatus.Text = "Audit Status:"; rbNew.Text = "New Audit"; lblAuditDate.Visible = true; phAudit.Visible = true; SETTINGS sets = SQMSettings.GetSetting("EHS", "AUDITSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = DateTime.Now.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } foreach (AUDIT_TYPE ip in EHSAuditMgr.SelectAuditTypeList(SessionManager.PrimaryCompany().COMPANY_ID, false)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.AUDIT_TYPE_ID.ToString()); item.Checked = true; rcbAuditType.Items.Add(item); } } }
protected void rbNew_Click(object sender, EventArgs e) { List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); SQMBasePage.SetLocationList(ddlIncidentLocation, locationList, 0, true); var incidentTypeList = EHSIncidentMgr.SelectIncidentTypeList(companyId, SessionManager.UserContext.Language.NLS_LANGUAGE); rddlNewIncidentType.DataSource = incidentTypeList; rddlNewIncidentType.DataTextField = "TITLE"; rddlNewIncidentType.DataValueField = "INCIDENT_TYPE_ID"; rddlNewIncidentType.DataBind(); string script = "function f(){OpenNewIncidentWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true); }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect.SelectedValue = "A"; } if (rcbAuditType.Items.Count < 1) { foreach (AUDIT_TYPE ip in EHSAuditMgr.SelectAuditTypeList(SessionManager.PrimaryCompany().COMPANY_ID, false)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.AUDIT_TYPE_ID.ToString()); item.Checked = true; rcbAuditType.Items.Add(item); } } if (rcbScheduleDay.Items.Count < 1) { IDictionary <int, string> days = GetAll <DayOfWeek>(); foreach (var day in days) { RadComboBoxItem item = new RadComboBoxItem(day.Value, day.Key.ToString()); item.Checked = true; rcbScheduleDay.Items.Add(item); } //rcbScheduleDay.DataSource = GetAll<DayOfWeek>(); //rcbScheduleDay.DataTextField = "Value"; //rcbScheduleDay.DataValueField = "Key"; //rcbScheduleDay.DataBind(); } divAuditList.Visible = true; lblViewEHSRezTitle.Text = "Manage Environmental Health & Safety Audit Schedules"; lblPageInstructions.Text = "Add or update EH&S Audit Schedule below."; rbNew.Text = "New Audit Schedule"; phAudit.Visible = true; }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect.SelectedValue = "A"; rcbFindingsSelect.FindItemByValue("A").Checked = true; } divIncidentList.Visible = true; pnlChartSection.Style.Add("display", "none"); lblChartType.Visible = ddlChartType.Visible = false; dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; dmFromDate.SelectedDate = DateTime.Now.AddMonths(-11); dmToDate.SelectedDate = DateTime.Now; if (Mode == IncidentMode.Incident) { lblViewEHSRezTitle.Text = "Manage Environmental Health & Safety Incidents"; lblPageInstructions.Text = "Add or update EH&S Incidents below."; //lblStatus.Text = "Incident Status:"; rbNew.Text = "New Incident"; lblIncidentDate.Visible = true; lblInspectionDate.Visible = false; phPrevent.Visible = false; phIncident.Visible = true; SETTINGS sets = SQMSettings.GetSetting("EHS", "INCIDENTSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = DateTime.Now.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } foreach (INCIDENT_TYPE ip in EHSIncidentMgr.SelectIncidentTypeList(SessionManager.PrimaryCompany().COMPANY_ID)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.INCIDENT_TYPE_ID.ToString()); item.Checked = true; rcbIncidentType.Items.Add(item); } // lookup charts defined for this module & app context PERSPECTIVE_VIEW view = ViewModel.LookupView(entities, "HSIR", "HSIR", 0); if (view != null) { ddlChartType.Items.Clear(); ddlChartType.Items.Add(new RadComboBoxItem("", "")); foreach (PERSPECTIVE_VIEW_ITEM vi in view.PERSPECTIVE_VIEW_ITEM.Where(l => l.STATUS != "I").OrderBy(l => l.ITEM_SEQ).ToList()) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = vi.TITLE; item.Value = vi.ITEM_SEQ.ToString(); item.ImageUrl = ViewModel.GetViewItemImageURL(vi); ddlChartType.Items.Add(item); } } } else if (Mode == IncidentMode.Prevent) { lblViewEHSRezTitle.Text = "Manage Preventative Actions"; lblPageInstructions.Text = "Add or update preventative actions below."; //lblStatus.Text = "Findings Status:"; rbNew.Text = "New Preventative Action"; lblIncidentDate.Visible = false; lblInspectionDate.Visible = true; phPrevent.Visible = true; phIncident.Visible = false; SETTINGS sets = SQMSettings.GetSetting("EHS", "ACTIONSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = DateTime.Now.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } // workaround for persistance mgr not supporting raddate controls if (HSCalcs() != null) { dmFromDate.SelectedDate = HSCalcs().FromDate; dmToDate.SelectedDate = HSCalcs().ToDate; if (HSCalcs().ObjAny != null && HSCalcs().ObjAny is bool) { cbShowImage.Checked = (bool)HSCalcs().ObjAny; } } // lookup charts defined for this module & app context PERSPECTIVE_VIEW view = ViewModel.LookupView(entities, "HSCA", "HSCA", 0); if (view != null) { ddlChartType.Items.Clear(); ddlChartType.Items.Add(new RadComboBoxItem("", "")); foreach (PERSPECTIVE_VIEW_ITEM vi in view.PERSPECTIVE_VIEW_ITEM.Where(l => l.STATUS != "I").OrderBy(l => l.ITEM_SEQ).ToList()) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = vi.TITLE; item.Value = vi.ITEM_SEQ.ToString(); item.ImageUrl = ViewModel.GetViewItemImageURL(vi); ddlChartType.Items.Add(item); } } } if (UserContext.GetMaxScopePrivilege(SysScope.incident) <= SysPriv.action) { uclExport.Visible = true; } else { uclExport.Visible = false; } }
public void LoadProfileSelectHdr(decimal companyID, decimal busOrgID, bool indicateUndefined, bool showExpanded) { ToggleVisible(pnlProfileSelectHdr); List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(companyID, busOrgID, true).Where(l => l.Plant.TRACK_EW_DATA == true).ToList(); locationList = UserContext.FilterPlantAccessList(locationList); int maxdesc = locationList.Select(l => l.Plant.PLANT_NAME.Length).Max(); if (showExpanded && locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && maxdesc < 41) { ddlBusLocSelect.Visible = false; mnuBusLocSelect.Visible = true; SQMBasePage.SetLocationList(mnuBusLocSelect, locationList, 0, "select a location ...", "TOP", false); if (indicateUndefined) { int undefinedCount = 0; List <string> profileList = EHSModel.SelectPlantProfileList(companyID).Select(l => l.PLANT_ID.ToString()).ToList(); RadMenuItem miTop = mnuBusLocSelect.Items[0]; foreach (RadMenuItem miBU in miTop.Items) { foreach (RadMenuItem miLoc in miBU.Items) { if (!profileList.Contains(miLoc.Value)) { ++undefinedCount; // miLoc.ImageUrl = "~/images/defaulticon/16x16/grid-dot.png"; miLoc.CssClass = "rcbItemEmphasis"; } else { miLoc.ImageUrl = "~/images/defaulticon/16x16/document.png"; } } } } } else { ddlBusLocSelect.Visible = true; mnuBusLocSelect.Visible = false; SQMBasePage.SetLocationList(ddlBusLocSelect, locationList, 0); if (indicateUndefined) { int undefinedCount = 0; List <string> profileList = EHSModel.SelectPlantProfileList(companyID).Select(l => l.PLANT_ID.ToString()).ToList(); foreach (RadComboBoxItem item in ddlBusLocSelect.Items) { if (!item.IsSeparator) { if (!profileList.Contains(item.Value)) { ++undefinedCount; item.ImageUrl = "~/images/defaulticon/16x16/blank.png"; item.CssClass = "rcbItemEmphasis"; item.ToolTip = "Metrics not defined"; } else { item.ImageUrl = "~/images/defaulticon/16x16/document.png"; } } } if (undefinedCount > 0) { ddlBusLocSelect.ToolTip += hfBusLocProfileUndefined.Value; } } ddlBusLocSelect.Items.Insert(0, new RadComboBoxItem("", "")); } }
public void LoadProfileInputHdr(bool loadPlants, DateTime dateFrom, DateTime dateTo, decimal defaultPlantID, bool hideUndefined, bool showExpanded) { ToggleVisible(pnlProfileInputHdr); if (loadPlants && ddlPlantSelect.Items.Count == 0) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true).Where(l => l.Plant.TRACK_EW_DATA == true).ToList(); locationList = UserContext.FilterPlantAccessList(locationList); int maxdesc = locationList.Select(l => l.Plant.PLANT_NAME.Length).Max(); if (locationList.Count > 1 && showExpanded && locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && maxdesc < 41) { ddlPlantSelect.Visible = false; tdLocation.Visible = false; mnuPlantSelect.Visible = true; SQMBasePage.SetLocationList(mnuPlantSelect, locationList, 0, "select a location...", "TOP", false); int undefinedCount = 0; List <string> profileList = EHSModel.SelectPlantProfileList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID).Select(l => l.PLANT_ID.ToString()).ToList(); RadMenuItem miTop = mnuPlantSelect.Items[0]; foreach (RadMenuItem miBU in miTop.Items) { foreach (RadMenuItem miLoc in miBU.Items) { if (!profileList.Contains(miLoc.Value)) { ++undefinedCount; miLoc.ImageUrl = "~/images/defaulticon/16x16/grid-dot.png"; miLoc.CssClass = "rcbItemEmphasis"; if (hideUndefined) { miLoc.Visible = false; } } } } if (mnuPlantSelect.FindItemByValue(defaultPlantID.ToString()) != null) { mnuPlantSelect.FindItemByValue(defaultPlantID.ToString()).Selected = true; LocationSelect_Click(mnuPlantSelect, null); } } else { ddlPlantSelect.Visible = true; mnuPlantSelect.Visible = false; SQMBasePage.SetLocationList(ddlPlantSelect, locationList, 0); if (ddlPlantSelect.Items.Count == 1) { tdLocationSelect.Visible = false; tdLocation.Visible = true; lblPlantName_out.Text = ddlPlantSelect.SelectedItem.Text; LocationSelect_Click(ddlPlantSelect, null); } else { List <string> profileList = EHSModel.SelectPlantProfileList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID).Select(l => l.PLANT_ID.ToString()).ToList(); int undefinedCount = 0; foreach (RadComboBoxItem item in ddlPlantSelect.Items) { if (!item.IsSeparator && !profileList.Contains(item.Value)) { ++undefinedCount; //item.ImageUrl = "~/images/defaulticon/16x16/grid-dot.png"; item.CssClass = "rcbItemEmphasis"; item.ToolTip = "Metrics not defined"; if (hideUndefined) { item.Visible = false; } else { item.Enabled = false; } } } if (undefinedCount > 0 && !hideUndefined) { ddlPlantSelect.ToolTip += hfPlantProfileUndefined.Value; } tdLocationSelect.Visible = true; tdLocation.Visible = false; if (ddlPlantSelect.FindItemByValue(defaultPlantID.ToString()) != null) { ddlPlantSelect.SelectedValue = defaultPlantID.ToString(); LocationSelect_Click(ddlPlantSelect, null); } else { LocationSelect_Click(ddlPlantSelect, null); } } } } if (dateFrom > DateTime.MinValue) { radPeriodSelect.Visible = true; // radPeriodSelect.Culture = System.Threading.Thread.CurrentThread.CurrentUICulture; radPeriodSelect.MinDate = dateFrom; radPeriodSelect.MaxDate = dateTo; radPeriodSelect.ShowPopupOnFocus = true; if (dateFrom == dateTo) { radPeriodSelect.SelectedDate = dateFrom; radPeriodSelect.Enabled = false; } else { radPeriodSelect.SelectedDate = DateTime.Now; } radPeriodSelect.Culture = System.Threading.Thread.CurrentThread.CurrentUICulture; tdPeriod.Visible = false; tdPeriodSelect.Visible = true; } }
private void SetupPage() { ddlScheduleScope.Items.Clear(); ddlTaskScope.Items.Clear(); // only show escalations if company is using the supervisor field ? SETTINGS setting = SessionManager.GetUserSetting("COMPANY", "PERSON_ADD_FIELDS"); if (setting != null && setting.VALUE.ToLower().Contains("supv")) { btnEscalateView.Visible = true; } SysPriv maxPriv = UserContext.GetMaxScopePrivilege(SysScope.busloc); List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (maxPriv <= SysPriv.config) // is a plant admin or greater ? { // AW20170105 - move this up so it can be used by both admin and non admin //List<BusinessLocation> locationList = SessionManager.PlantList; //locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { ddlScheduleScope.Visible = false; mnuScheduleScope.Visible = true; SQMBasePage.SetLocationList(mnuScheduleScope, locationList, 0, SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME, "TOP", true); RadMenuItem mi = new RadMenuItem(); mi.Text = (SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME); mi.Value = "0"; mi.ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; mnuScheduleScope.Items[0].Items.Insert(0, mi); ddlTaskScope.Visible = false; mnuTaskScope.Visible = true; SQMBasePage.SetLocationList(mnuTaskScope, locationList, 0, SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME, "TOP", true); mnuTaskScope.Items[0].Items.Insert(0, mi); } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; SQMBasePage.SetLocationList(ddlScheduleScope, locationList, 0, true); ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; ddlTaskScope.Visible = true; mnuTaskScope.Visible = false; SQMBasePage.SetLocationList(ddlTaskScope, locationList, 0, true); ddlTaskScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlTaskScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; // AW20170105 - this is the one on the Calendar page... we are not opening up the list for this one. //SQMBasePage.SetLocationList(ddlScheduleScope, locationList, 0, true); ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; SQMBasePage.SetLocationList(ddlTaskScope, locationList, 0, true); ddlTaskScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlTaskScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; ddlTaskScope.Visible = true; mnuTaskScope.Visible = false; } dmToDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(3); dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(-3); rcbStatusSelect.SelectedValue = "a"; ++SessionManager.UserContext.InboxReviews; }
protected void LoadInformation() { // set up for adding the header info List <PRIVGROUP> pl = SQMModelMgr.SelectPrivGroupList(new SysPriv[1] { SysPriv.originate }, SysScope.audit, ""); // SQMModelMgr.SelectPrivGroupJobcodeList(SysPriv.originate, SysScope.audit); DropDownListItem item = new DropDownListItem(); UpdateAuditTypes(); if (rddlAuditJobcodes.Items.Count == 0) { rddlAuditJobcodes.DataSource = pl; rddlAuditJobcodes.DataTextField = "DESCRIPTION"; rddlAuditJobcodes.DataValueField = "PRIV_GROUP"; rddlAuditJobcodes.DataBind(); item = new DropDownListItem("[Select a Group]", ""); rddlAuditJobcodes.Items.Insert(0, item); } if (rddlDayOfWeek.Items.Count == 0) { rddlDayOfWeek.Items.Clear(); rddlDayOfWeek.DataSource = EHS_Audit_Scheduler.GetAll <DayOfWeek>(); rddlDayOfWeek.DataTextField = "Value"; rddlDayOfWeek.DataValueField = "Key"; rddlDayOfWeek.DataBind(); item = new DropDownListItem("[Select a Day]", ""); rddlDayOfWeek.Items.Insert(0, item); } if (IsEditContext || CurrentStep > 0) { // in edit mode, load the header field values and make all fields display only AUDIT_SCHEDULER scheduler = EHSAuditMgr.SelectAuditSchedulerById(entities, EditAuditScheduleId); BusinessLocation location = new BusinessLocation().Initialize((decimal)scheduler.PLANT_ID); rddlAuditType.SelectedValue = scheduler.AUDIT_TYPE_ID.ToString(); rddlAuditType.Enabled = false; rddlAuditType.Visible = false; lblScheduleAuditType.Visible = true; lblScheduleAuditType.Text = rddlAuditType.SelectedText.ToString(); hdnAuditLocation.Value = location.Plant.PLANT_ID.ToString(); lblAuditLocation.Text = location.Plant.PLANT_NAME + " " + location.BusinessOrg.ORG_NAME; lblAuditLocation.Visible = true; ddlAuditLocation.Visible = false; mnuAuditLocation.Visible = false; rddlDayOfWeek.SelectedValue = scheduler.DAY_OF_WEEK.ToString(); cbInactive.Checked = scheduler.INACTIVE; // build the audit jobcode list PRIVGROUP pv = pl.Where(i => i.PRIV_GROUP.ToString() == scheduler.JOBCODE_CD).FirstOrDefault(); lblAuditJobcode.Text = pv.DESCRIPTION; lblAuditJobcode.Visible = true; rddlAuditJobcodes.SelectedValue = scheduler.JOBCODE_CD.ToString(); rddlAuditJobcodes.Visible = false; } else { if (UserContext.GetMaxScopePrivilege(SysScope.audit) <= SysPriv.config) { List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { if (mnuAuditLocation.Items.Count == 0) { mnuAuditLocation.Items.Clear(); ddlAuditLocation.Visible = false; mnuAuditLocation.Visible = true; mnuAuditLocation.Enabled = true; SQMBasePage.SetLocationList(mnuAuditLocation, locationList, 0, "Select a Location", "", true); } } else { if (ddlAuditLocation.Items.Count == 0) { ddlAuditLocation.Items.Clear(); ddlAuditLocation.Visible = true; ddlAuditLocation.Enabled = true; mnuAuditLocation.Visible = false; SQMBasePage.SetLocationList(ddlAuditLocation, locationList, 0, true); ddlAuditLocation.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } } } // set defaults for add mode rddlAuditType.Enabled = true; rddlAuditType.Visible = true; lblAuditLocation.Visible = false; rddlAuditJobcodes.Enabled = true; rddlAuditJobcodes.Visible = true; lblAuditJobcode.Visible = false; lblScheduleAuditType.Visible = false; } }
public void BindTaskAdd(int recordType, decimal recordID, decimal recordSubID, string taskStep, string taskType, string originalDetail, decimal plantID, string context) { PSsqmEntities ctx = new PSsqmEntities(); if (TaskXLATList == null || TaskXLATList.Count == 0) { TaskXLATList = SQMBasePage.SelectXLATList(new string[5] { "TASK_STATUS", "RECORD_TYPE", "INCIDENT_STATUS", "NOTIFY_SCOPE_TASK", "ACTION_CATEGORY" }); } pnlUpdateTask.Visible = false; pnlAddTask.Visible = true; btnTaskAdd.CommandArgument = recordType.ToString() + "~" + recordID.ToString() + "~" + recordSubID.ToString() + "~" + taskStep + "~" + taskType + "~" + plantID.ToString(); lblTaskTypeValueAdd.Text = TaskXLATList.Where(l => l.XLAT_GROUP == "RECORD_TYPE" && l.XLAT_CODE == recordType.ToString()).FirstOrDefault().DESCRIPTION; switch ((TaskRecordType)recordType) { case TaskRecordType.Audit: if ((recordSubID > 0) || taskStep == "350") { // action required if subid references a specific audit question lblTaskTypeValueAdd.Text += (" - " + TaskXLATList.Where(l => l.XLAT_GROUP == "NOTIFY_SCOPE_TASK" && l.XLAT_CODE == taskStep).FirstOrDefault().DESCRIPTION); } else { lblTaskTypeValueAdd.Text += (" - " + TaskXLATList.Where(l => l.XLAT_GROUP == "NOTIFY_SCOPE_TASK" && l.XLAT_CODE == "300").FirstOrDefault().DESCRIPTION); } break; default: return; break; } lblTaskDetailValueAdd.Text = originalDetail; // cause of the requirement rdpTaskDueDTAdd.SelectedDate = SessionManager.UserContext.LocalTime; // default to today? lblTaskStatusValueAdd.Text = TaskXLATList.Where(l => l.XLAT_GROUP == "TASK_STATUS" && l.XLAT_CODE == (0).ToString()).FirstOrDefault().DESCRIPTION; // default to the "Open" status ddlScheduleScopeAdd.Items.Clear(); mnuScheduleScopeAdd.Items.Clear(); BusinessLocation location = new BusinessLocation().Initialize(plantID); SysPriv maxPriv = UserContext.GetMaxScopePrivilege(SysScope.busloc); List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (maxPriv <= SysPriv.config) // is a plant admin or greater ? { // AW20170105 - move this up so it can be used by both admin and non admin //List<BusinessLocation> locationList = SessionManager.PlantList; //locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { ddlScheduleScopeAdd.Visible = false; mnuScheduleScopeAdd.Visible = true; SQMBasePage.SetLocationList(mnuScheduleScopeAdd, locationList, plantID, location.Plant.PLANT_NAME, "TOP", true); //RadMenuItem mi = new RadMenuItem(); //mi.Text = (location.Plant.PLANT_NAME); //mi.Value = plantID.ToString(); ////mi.ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; //mnuScheduleScopeAdd.Items[0].Items.Insert(0, mi); //mnuScheduleScopeAdd.Attributes.Add("z-index", "9"); } else { ddlScheduleScopeAdd.Visible = true; mnuScheduleScopeAdd.Visible = false; SQMBasePage.SetLocationList(ddlScheduleScopeAdd, locationList, plantID, true); } } else { ddlScheduleScopeAdd.Visible = true; mnuScheduleScopeAdd.Visible = false; //ddlScheduleScopeAdd.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); //ddlScheduleScopeAdd.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; SQMBasePage.SetLocationList(ddlScheduleScopeAdd, locationList, plantID, true); } List <PERSON> personList = SQMModelMgr.SelectPlantPersonList(1, plantID).Where(l => !string.IsNullOrEmpty(l.EMAIL)).OrderBy(l => l.LAST_NAME).ToList(); SQMBasePage.SetPersonList(ddlAssignPersonAdd, personList, "", 0, false, "LF"); List <TaskItem> tasklist = TaskMgr.ExceptionTaskListByRecord(recordType, recordID, recordSubID); rptTaskList.DataSource = tasklist; rptTaskList.DataBind(); if (tasklist.Count > 0) { pnlListTasks.Visible = true; } else { pnlListTasks.Visible = false; } btnTaskAdd.Visible = true; btnTaskUpdate.Visible = false; }
private void SetupPage() { AccessMode accessmode = UserContext.RoleAccess(); ddlScheduleScope.Items.Clear(); if (accessmode >= AccessMode.Plant) { // List<BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.PrimaryCompany().COMPANY_ID, 0, true); List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList, "EHS", ""); locationList = UserContext.FilterPlantAccessList(locationList, "SQM", ""); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { ddlScheduleScope.Visible = false; mnuScheduleScope.Visible = true; SQMBasePage.SetLocationList(mnuScheduleScope, locationList, 0, SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME, "TOP", true); RadMenuItem mi = new RadMenuItem(); mi.Text = (SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME); mi.Value = "0"; mi.ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; mnuScheduleScope.Items[0].Items.Insert(0, mi); } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; SQMBasePage.SetLocationList(ddlScheduleScope, locationList, 0, true); ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } respForList = new List <decimal>(); respForList.Add(SessionManager.UserContext.Person.PERSON_ID); respForList.AddRange(SessionManager.UserContext.DelegateList); SessionManager.UserContext.TaskList.Clear(); SessionManager.UserContext.TaskList = new List <TaskItem>(); DateTime fromDate = DateTime.Now.AddMonths(-6); if (accessmode >= AccessMode.Limited) { SessionManager.UserContext.TaskList.AddRange(TaskMgr.ProfileInputStatus(new DateTime(fromDate.Year, fromDate.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), respForList, SessionManager.UserContext.EscalationAssignments)); SessionManager.UserContext.TaskList.AddRange(TaskMgr.IncidentTaskStatus(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, respForList, SessionManager.UserContext.EscalationAssignments, true)); if (accessmode == AccessMode.Admin && SessionManager.UserContext.EscalationAssignments.Count > 0) { SessionManager.UserContext.TaskList.AddRange(TaskMgr.ProfileFinalizeStatus(new DateTime(fromDate.Year, fromDate.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day), respForList, SessionManager.UserContext.EscalationAssignments, SessionManager.UserContext.Person)); } } ++SessionManager.UserContext.InboxReviews; }
protected void btnTaskAssign_Click(object sender, EventArgs e) { PSsqmEntities ctx = new PSsqmEntities(); Button btn = (Button)sender; if (btn == null || string.IsNullOrEmpty(btn.CommandArgument)) { return; } TaskStatusMgr taskMgr = new TaskStatusMgr().CreateNew(0, 0); TASK_STATUS task = taskMgr.SelectTask(Convert.ToDecimal(btn.CommandArgument)); btnAssignSave.CommandArgument = task.TASK_ID.ToString(); decimal plantID = GetTaskLocation(task); BusinessLocation location = new BusinessLocation().Initialize(plantID); // AW 20161229 - if they get this far, they can assign the task to anyone in a plant that they have access... //SysPriv maxPriv = UserContext.GetMaxScopePrivilege(SysScope.busloc); //if (maxPriv <= SysPriv.config) // is a plant admin or greater ? //{ List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { ddlScheduleScope.Visible = false; mnuScheduleScope.Visible = true; SQMBasePage.SetLocationList(mnuScheduleScope, locationList, location.Plant.PLANT_ID, location.Plant.PLANT_NAME, "TOP", true); //RadMenuItem mi = new RadMenuItem(); //mi.Text = (SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME); //mi.Value = "0"; //mi.ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; //mnuScheduleScope.Items[0].Items.Insert(0, mi); } else { ddlScheduleScope.Visible = true; mnuScheduleScope.Visible = false; SQMBasePage.SetLocationList(ddlScheduleScope, locationList, location.Plant.PLANT_ID, true); } //} //else //{ // ddlScheduleScope.Visible = true; // mnuScheduleScope.Visible = false; // //ddlScheduleScope.Items.Insert(0, new RadComboBoxItem((SessionManager.UserContext.Person.FIRST_NAME + " " + SessionManager.UserContext.Person.LAST_NAME), "0")); // //ddlScheduleScope.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; //} List <PERSON> personList = SQMModelMgr.SelectPlantPersonList(1, plantID).Where(l => !string.IsNullOrEmpty(l.EMAIL)).OrderBy(l => l.LAST_NAME).ToList(); SQMBasePage.SetPersonList(ddlAssignPerson, personList, "", 0, false, "LF"); tbAssignComment.Text = task.COMMENTS; string script = "function f(){OpenAssignTaskWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true); }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); List <XLAT> xlatList = SQMBasePage.SelectXLATList(new string[5] { "INJURY_PART", "INJURY_TYPE", "MEDIA_VIDEO_SOURCE", "MEDIA_VIDEO_STATUS", "MEDIA_VIDEO_TYPE" }, 1); rcbVideoSource = SQMBasePage.SetComboBoxItemsFromXLAT(rcbVideoSource, xlatList.Where(l => l.XLAT_GROUP == "MEDIA_VIDEO_SOURCE" && l.STATUS == "A").OrderBy(h => h.SORT_ORDER).ToList(), "SHORT"); rcbVideoSource.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "")); rcbVideoSource.SelectedIndex = 0; rcbVideoStatusSelect = SQMBasePage.SetComboBoxItemsFromXLAT(rcbVideoStatusSelect, xlatList.Where(l => l.XLAT_GROUP == "MEDIA_VIDEO_STATUS" && l.STATUS == "A").OrderBy(h => h.SORT_ORDER).ToList(), "SHORT"); rcbVideoStatusSelect.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "")); rcbVideoStatusSelect.SelectedIndex = 0; rcbVideoType = SQMBasePage.SetComboBoxItemsFromXLAT(rcbVideoType, xlatList.Where(l => l.XLAT_GROUP == "MEDIA_VIDEO_TYPE" && l.STATUS == "A").OrderBy(h => h.SORT_ORDER).ToList(), "SHORT"); //rcbVideoStatusSelect.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "")); //rcbVideoStatusSelect.SelectedIndex = 0; rcbInjuryType = SQMBasePage.SetComboBoxItemsFromXLAT(rcbInjuryType, xlatList.Where(l => l.XLAT_GROUP == "INJURY_TYPE" && l.STATUS == "A").OrderBy(h => h.SORT_ORDER).ToList(), "SHORT"); rcbInjuryType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "")); rcbInjuryType.SelectedIndex = 0; rcbBodyPart = SQMBasePage.SetComboBoxItemsFromXLAT(rcbBodyPart, xlatList.Where(l => l.XLAT_GROUP == "INJURY_PART" && l.STATUS == "A").OrderBy(h => h.SORT_ORDER).ToList(), "SHORT"); rcbBodyPart.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "")); rcbBodyPart.SelectedIndex = 0; } divVideoList.Visible = true; rbNew.Visible = true; dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; // ABW 1/5/16 - use user's default plant local time for search default DateTime localTime = SessionManager.UserContext.LocalTime; dmFromDate.SelectedDate = localTime.AddMonths(-1); dmToDate.SelectedDate = localTime.AddMonths(1); //lblStatus.Text = "Assessment Status:"; lblVideoDate.Visible = true; phVideo.Visible = true; //SETTINGS sets = SQMSettings.GetSetting("EHS", "AUDITSEARCHFROM"); //if (sets != null) //{ // try // { // string[] args = sets.VALUE.Split('-'); // if (args.Length > 1) // { // dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); // } // else // { // dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(Convert.ToInt32(args[0]) * -1); // } // } // catch { } //} }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect.SelectedValue = "A"; } divAuditList.Visible = true; dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; // we want the start date to be the previous week Monday // ABW 1/5/16 - use user's default plant local time for search default DateTime localTime = SessionManager.UserContext.LocalTime; int dayofweek = (int)localTime.DayOfWeek; DateTime fromDate = localTime.AddDays(-7); while ((int)(fromDate.DayOfWeek) > 1) { fromDate = fromDate.AddDays(-1); } // we want the end date to be the next week Monday (so we can see audits in progress) DateTime toDate = localTime; while ((int)(toDate.DayOfWeek) > 1) { toDate = toDate.AddDays(1); } dmFromDate.SelectedDate = fromDate; dmToDate.SelectedDate = toDate; if (Mode == AuditMode.Audit) { //lblViewEHSRezTitle.Text = "Environmental Health & Safety Assessment Exceptions"; //lblPageInstructions.Text = "Review and update EH&S Assessment Exceptions below."; //lblStatus.Text = "Assessment Status:"; lblAuditDate.Visible = true; phAudit.Visible = true; SETTINGS sets = SQMSettings.GetSetting("EHS", "AUDITEXCEPTIONSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } if (rcbAuditType.Items.Count < 1) { foreach (AUDIT_TYPE ip in EHSAuditMgr.SelectAuditTypeList(SessionManager.PrimaryCompany().COMPANY_ID, false)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.AUDIT_TYPE_ID.ToString()); item.Checked = true; rcbAuditType.Items.Add(item); } } } }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <XLAT> xlatList = SQMBasePage.SelectXLATList(new string[2] { "STATUS_SELECT", "INCIDENT_SEVERITY" }, 1); List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); rcbStatusSelect = SQMBasePage.SetComboBoxItemsFromXLAT(rcbStatusSelect, xlatList.Where(l => l.XLAT_GROUP == "STATUS_SELECT" && new string[3] { "", "A", "C" }.Contains(l.XLAT_CODE)).ToList(), "SHORT"); rcbStatusSelect.SelectedValue = "A"; rcbSeverity = SQMBasePage.SetComboBoxItemsFromXLAT(rcbSeverity, xlatList.Where(l => l.XLAT_GROUP == "INCIDENT_SEVERITY").OrderBy(l => l.SORT_ORDER).ToList(), "SHORT"); } divIncidentList.Visible = true; pnlChartSection.Style.Add("display", "none"); lblChartType.Visible = ddlChartType.Visible = false; //Bind data with severity level dropdown. var severityList = EHSIncidentMgr.PopulateSeverityLevel(); rcbSeverityLevel = SQMBasePage.SetComboBoxItemsFromXLAT(rcbSeverityLevel, severityList, "SHORT"); SQMBasePage.SetRadDateCulture(dmFromDate, ""); SQMBasePage.SetRadDateCulture(dmToDate, ""); dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(-11); dmToDate.SelectedDate = SessionManager.UserContext.LocalTime; lblViewEHSRezTitle.Text = GetLocalResourceObject("lblViewEHSRezTitleResource1.Text").ToString(); lblPageInstructions.Text = GetLocalResourceObject("lblPageInstructionsResource1.Text").ToString(); //lblStatus.Text = "Incident Status:"; rbNew.Text = GetLocalResourceObject("rbNewResource1.Text").ToString(); lblIncidentDate.Visible = true; lblInspectionDate.Visible = false; phIncident.Visible = true; SETTINGS sets = SQMSettings.GetSetting("EHS", "INCIDENTSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } foreach (INCIDENT_TYPE ip in EHSIncidentMgr.SelectIncidentTypeList(SessionManager.PrimaryCompany().COMPANY_ID, SessionManager.UserContext.Language.NLS_LANGUAGE)) { RadComboBoxItem item = new RadComboBoxItem(ip.TITLE, ip.INCIDENT_TYPE_ID.ToString()); item.Checked = true; rcbIncidentType.Items.Add(item); } // lookup charts defined for this module & app context PERSPECTIVE_VIEW view = ViewModel.LookupView(entities, "HSIR", "HSIR", 0, SessionManager.UserContext.Language.NLS_LANGUAGE); if (view != null) { ddlChartType.Items.Clear(); ddlChartType.Items.Add(new RadComboBoxItem("", "")); foreach (PERSPECTIVE_VIEW_ITEM vi in view.PERSPECTIVE_VIEW_ITEM.Where(l => l.STATUS != "I").OrderBy(l => l.ITEM_SEQ).ToList()) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = vi.TITLE; item.Value = vi.ITEM_SEQ.ToString(); item.ImageUrl = ViewModel.GetViewItemImageURL(vi); ddlChartType.Items.Add(item); } } if (UserContext.GetMaxScopePrivilege(SysScope.incident) <= SysPriv.action) { uclExport.Visible = true; } else { uclExport.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { decimal issueID = 0; if (!Page.IsPostBack) { //string appContext; if (!string.IsNullOrEmpty(Request.QueryString["c"])) { appContext = Request.QueryString["c"]; } else { appContext = "RCV"; } if (!string.IsNullOrEmpty(Request.QueryString["i"])) { try { issueID = Convert.ToDecimal(EncryptionManager.Decrypt(Request.QueryString["i"])); } catch { } } SetIssueCtl(new QualityIssueCtl().Initialize(null, appContext)); if (SessionManager.EffLocation.BusinessOrg == null) { SessionManager.EffLocation = SessionManager.UserContext.WorkingLocation; } if (uclIssueSearch.DDLPlantSelect.Items.Count == 0) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(uclIssueSearch.DDLPlantSelect, UserContext.FilterPlantAccessList(locationList), -1); } PERSPECTIVE_VIEW view = ViewModel.LookupView(entities, appContext, appContext, 0); if (view != null) { ddlChartType.Items.Clear(); ddlChartType.Items.Add(new RadComboBoxItem("", "")); foreach (PERSPECTIVE_VIEW_ITEM vi in view.PERSPECTIVE_VIEW_ITEM.Where(l => l.STATUS != "I").OrderBy(l => l.ITEM_SEQ).ToList()) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = vi.TITLE; item.Value = vi.ITEM_SEQ.ToString(); item.ImageUrl = ViewModel.GetViewItemImageURL(vi); ddlChartType.Items.Add(item); } } pnlChartSection.Style.Add("display", "none"); lblChartType.Visible = ddlChartType.Visible = false; uclSearchBar_OnListClick(); // display list options upon page entry } switch (IssueCtl().Context) { case "CST": uclSearchBar1.PageTitle.Text = lblQICSTTitle.Text; uclSearchBar1.NewButton.ToolTip = "Create a new " + lblQICSTTitle.Text; foreach (RadComboBoxItem ci in ddlChartType.Items) { if (ci.Value.Contains("RCV")) { ci.Visible = false; } } break; case "RCV": uclSearchBar1.PageTitle.Text = lblQIRCVTitle.Text; uclSearchBar1.NewButton.ToolTip = "Create a new " + lblQIRCVTitle.Text; foreach (RadComboBoxItem ci in ddlChartType.Items) { if (ci.Value.Contains("CST")) { ci.Visible = false; } } break; default: uclSearchBar1.PageTitle.Text = lblQIPRQTitle.Text; break; } if (issueID > 0) { OnIssue_Click(issueID); } }
private void SetupPage() { if (ddlPlantSelect.Items.Count < 1) { List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.UserContext.HRLocation.Company.COMPANY_ID, 0, true); SQMBasePage.SetLocationList(ddlPlantSelect, UserContext.FilterPlantAccessList(locationList), 0); List <XLAT> xlatList = SQMBasePage.SelectXLATList(new string[4] { "IQ_81", "IQ_82", "IQ_83", "STATUS_SELECT" }, 1); rcbInspectionType = SQMBasePage.SetComboBoxItemsFromXLAT(rcbInspectionType, xlatList.Where(l => l.XLAT_GROUP == "IQ_81" && l.STATUS == "A").ToList(), "SHORT"); rcbRecommendType = SQMBasePage.SetComboBoxItemsFromXLAT(rcbRecommendType, xlatList.Where(l => l.XLAT_GROUP == "IQ_83").ToList(), "SHORT"); rcbStatusSelect = SQMBasePage.SetComboBoxItemsFromXLAT(rcbStatusSelect, xlatList.Where(l => l.XLAT_GROUP == "STATUS_SELECT").Where(l => new string[] { "A", "C", "P", "U" }.Contains(l.XLAT_CODE)).ToList(), "SHORT"); rcbStatusSelect.SelectedValue = "A"; // work-around for problem w/ radwindow combobox not retaining items created/set from a basepage method ? SQMBasePage.SetLocationList(ddlActionLocation, locationList, 0, true); rddlNewActionType.DataSource = xlatList.Where(l => l.XLAT_GROUP == "IQ_81" && l.STATUS == "A").ToList(); rddlNewActionType.DataTextField = "DESCRIPTION_SHORT"; rddlNewActionType.DataValueField = "XLAT_CODE"; rddlNewActionType.DataBind(); } divIncidentList.Visible = true; pnlChartSection.Style.Add("display", "none"); lblChartType.Visible = ddlChartType.Visible = false; SQMBasePage.SetRadDateCulture(dmFromDate, ""); SQMBasePage.SetRadDateCulture(dmToDate, ""); dmFromDate.ShowPopupOnFocus = dmToDate.ShowPopupOnFocus = true; dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(-11); dmToDate.SelectedDate = SessionManager.UserContext.LocalTime; //lblViewEHSRezTitle.Text = GetLocalResourceObject("lblViewEHSRezTitleResource1.Text").ToString(); //lblPageInstructions.Text = GetLocalResourceObject("lblPageInstructionsResource1.Text").ToString(); //lblStatus.Text = "Incident Status:"; //rbNew.Text = GetLocalResourceObject("rbNewResource1.Text").ToString(); lblIncidentDate.Visible = true; lblInspectionDate.Visible = false; SETTINGS sets = SQMSettings.GetSetting("EHS", "INCIDENTSEARCHFROM"); if (sets != null) { try { string[] args = sets.VALUE.Split('-'); if (args.Length > 1) { dmFromDate.SelectedDate = new DateTime(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); } else { dmFromDate.SelectedDate = SessionManager.UserContext.LocalTime.AddMonths(Convert.ToInt32(args[0]) * -1); } } catch { } } // lookup charts defined for this module & app context PERSPECTIVE_VIEW view = ViewModel.LookupView(entities, "HSCA", "HSCA", 0, SessionManager.UserContext.Language.NLS_LANGUAGE); if (view != null) { ddlChartType.Items.Clear(); ddlChartType.Items.Add(new RadComboBoxItem("", "")); foreach (PERSPECTIVE_VIEW_ITEM vi in view.PERSPECTIVE_VIEW_ITEM.Where(l => l.STATUS != "I").OrderBy(l => l.ITEM_SEQ).ToList()) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = vi.TITLE; item.Value = vi.ITEM_SEQ.ToString(); item.ImageUrl = ViewModel.GetViewItemImageURL(vi); ddlChartType.Items.Add(item); } } if (UserContext.GetMaxScopePrivilege(SysScope.prevent) <= SysPriv.action) { uclExport.Visible = true; } else { uclExport.Visible = false; } }