コード例 #1
0
        private void uclSearchBar_OnSearchClick()
        {
            decimal caseID = 0;

            pnlSearchList.Visible = true;
            divPageBody.Visible   = divNavArea.Visible = false;

            if (CaseCtl().Context == "EHS")
            {
                uclCaseList.LinksDisabled = UserContext.CheckAccess("EHS", "321") < AccessMode.Update ? true : false;
            }
            else
            {
                uclCaseList.LinksDisabled      = UserContext.CheckAccess("SQM", "221") < AccessMode.Update ? true : false;
                uclSearchBar.NewButton.Visible = true;
            }

            string[]  plantArray = ddlPlantSelect.Items.Where(i => i.Checked == true).Select(i => i.Value).ToArray();
            decimal[] plantIDS   = Array.ConvertAll(plantArray, new Converter <string, decimal>(decimal.Parse));

            CaseCtl().CaseList = ProblemCase.SelectProblemCaseList(SessionManager.PrimaryCompany().COMPANY_ID, CaseCtl().Context, ddlStatusSelect.SelectedValue);
            uclCaseList.BindProblemCaseListRepeater(ProblemCase.QualifyCaseList(CaseCtl().CaseList, plantIDS).OrderByDescending(l => l.ProbCase.CREATE_DT).ToList(), CaseCtl().Context);

            uclSearchBar.ReturnButton.Visible = false;
        }
コード例 #2
0
        // Needed to move javascript to parent page - problem with ajax panel?
        //protected override void OnPreRender(EventArgs e)
        //{
        //	//Page.ClientScript.RegisterClientScriptInclude("PreventionLocation", this.ResolveClientUrl("~/scripts/prevention_location.js"));
        //	base.OnPreRender(e);
        //}


        public void BuildCaseComboBox()
        {
            PSsqmEntities entities = new PSsqmEntities();

            if (rcbCases.Items.Count == 0)
            {
                List <PROB_CASE> caseList     = ProblemCase.SelectProblemCaseList(SessionManager.PrimaryCompany().COMPANY_ID, "EHS", "A");
                List <PROB_CASE> userCaseList = ProblemCase.SelectUserCaseList(caseList);

                var userCaseListSorted = userCaseList.OrderByDescending(x => x.PROBCASE_ID);

                rcbCases.Items.Clear();
                rcbCases.Items.Add(new Telerik.Web.UI.RadComboBoxItem("[Select a Problem Case]", ""));
                foreach (PROB_CASE c in userCaseListSorted)
                {
                    var    incidentId = (from po in entities.PROB_OCCUR where po.PROBCASE_ID == c.PROBCASE_ID select po.INCIDENT_ID).FirstOrDefault();
                    string descriptor = string.Format("{0:000000} - {1} ({2})", incidentId, c.DESC_SHORT, ((DateTime)c.CREATE_DT).ToShortDateString());
                    rcbCases.Items.Add(new Telerik.Web.UI.RadComboBoxItem(descriptor, c.PROBCASE_ID.ToString()));
                }
            }
        }