protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Ucl_DocMgr ucl = (Ucl_DocMgr)this.Master.FindControl("uclDocSelect");
                if (ucl != null)
                {
                    ucl.BindDocumentSelect("SQM", 2, true, true, "");
                }

                uclSearchBar.PageTitle.Text = lblCRTitle.Text;
                SetupPage();
                // from quality incident entry page
                if ((bool)SessionManager.ReturnStatus)
                {
                    if (SessionManager.ReturnObject.GetType().ToString().ToUpper().Contains("QI_OCCUR"))
                    {
                        QI_OCCUR qiIssue = (QI_OCCUR)SessionManager.ReturnObject;

                        OnNewClick();
                        costReport.CostReport.COST_REPORT_DESC = qiIssue.INCIDENT.DESCRIPTION;
                        costReport.AddIncident(qiIssue.INCIDENT_ID);
                        uclIncidents.BindQualityIssueList(costReport.IncidentList, false);
                        DisplayReport();
                        BindIncident(qiIssue.INCIDENT_ID);
                        isAutoCreated = true;
                    }
                    SessionManager.ClearReturns();
                }
                else
                {
                    if (costReport == null)
                    {
                        OnListClick();
                    }
                }
            }
            else
            {
                // from incident popop selector
                if ((bool)SessionManager.ReturnStatus)
                {
                    if (SessionManager.ReturnObject.GetType().ToString().ToUpper().Contains("INCIDENT"))
                    {
                        List <INCIDENT> incidentList = (List <INCIDENT>)SessionManager.ReturnObject;
                        costReport.AddIncident(incidentList[0].INCIDENT_ID);
                        uclIncidents.BindQualityIssueList(costReport.IncidentList, false);
                        BindIncident(incidentList[0].INCIDENT_ID);
                    }
                    SessionManager.ClearReturns();
                }
            }
        }
Example #2
0
        protected void lnkIssue_Click(decimal issueID)
        {
            QI_OCCUR qiOccur = new QI_OCCUR();

            qiOccur.QIO_ID = Convert.ToDecimal(issueID);
            SessionManager.ReturnObject = qiOccur;
            SessionManager.ReturnStatus = true;

            // close the selector window ...
            System.Threading.Thread.Sleep(250);
            // string javaScript = "<script language=JavaScript>\n" + "window.close(); window.opener.location.reload(true);\n" + "</script>";
            string javaScript = "<script language=JavaScript>\n" + "window.opener.document.forms[0].submit(); window.close();\n" + "</script>";

            RegisterStartupScript("lnkIssue_Click", javaScript);
        }
Example #3
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                HiddenField hfld = (HiddenField)this.Form.Parent.FindControl("form1").FindControl("ContentPlaceHolder1").FindControl("hdCurrentActiveTab");
                hfld.Value = SessionManager.CurrentAdminTab = "lbNCOccur";
                uclSearchBar.PageTitle.Text = lblNCOccurTitle.Text;
                divPageBody.Visible         = false;

                if ((bool)SessionManager.ReturnStatus)
                {
                    string s = SessionManager.ReturnObject.GetType().ToString();
                    if (SessionManager.ReturnObject.GetType().ToString().ToUpper().Contains("QI_OCCUR"))
                    {
                        QI_OCCUR qiOccur = (QI_OCCUR)SessionManager.ReturnObject;
                        qualityIssue = new QualityIssue().Load(qiOccur.QIO_ID);
                        SetupPage();
                        uclSearchBar.SetButtonsEnabled(true, true, true, false, false, false);
                        uclSearchBar.SetButtonsNotClicked();
                    }
                }
            }
            else
            {
                if ((bool)SessionManager.ReturnStatus)
                {
                    string s = SessionManager.ReturnObject.GetType().ToString();
                    if (SessionManager.ReturnObject.GetType().ToString().ToUpper().Contains("PLANTPART"))
                    {
                        vw_CustPlantPart plantPart = (vw_CustPlantPart)SessionManager.ReturnObject;
                        if (qualityIssue != null)
                        {
                            qualityIssue.AddPartInfo(plantPart.PART_ID, plantPart.PART_NUM, plantPart.PART_NAME);
                            qualityIssue.AddSupplierInfo(plantPart.SUPP_COMPANY_ID, plantPart.SUPP_COMPANY_NAME);
                        }
                        SetupPage();
                    }
                }
            }
            SessionManager.ReturnObject = null;
            SessionManager.ReturnStatus = false;
        }
        protected void lnkTask_Click(object sender, EventArgs e)
        {
            string cmd = "";

            if (sender is ImageButton)
            {
                ImageButton btn = (ImageButton)sender;
                cmd = btn.CommandArgument.ToString().Trim();
            }
            else
            {
                LinkButton lnk = (LinkButton)sender;
                cmd = lnk.CommandArgument.ToString().Trim();
            }

            if (OnTaskListClick != null)
            {
                OnTaskListClick(cmd);
            }
            else
            {
                string[]       args     = cmd.Split('|');
                TaskRecordType taskType = (TaskRecordType)Enum.Parse(typeof(TaskRecordType), args[0]);
                switch (taskType)
                {
                case TaskRecordType.QualityIssue:
                    QI_OCCUR qiOccur = new QI_OCCUR();
                    qiOccur.INCIDENT_ID         = Convert.ToDecimal(args[1]);
                    SessionManager.ReturnObject = qiOccur;
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/Quality/Quality_Issue.aspx?c=" + args[2]);
                    break;

                case TaskRecordType.ProblemCase:
                    try
                    {
                        //string[] datas = args[1].Split('~');
                        TASK_STATUS task = new TASK_STATUS();
                        task.RECORD_ID = Convert.ToDecimal(args[1]);
                        task.TASK_STEP = args[2];
                        SessionManager.ReturnObject = task;
                        SessionManager.ReturnStatus = true;
                        SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                        Response.Redirect("/Problem/Problem_Case.aspx");
                    }
                    catch (Exception ex)
                    {
                        //SQMLogger.LogException(ex);
                    }
                    break;

                case TaskRecordType.ProfileInput:
                case TaskRecordType.ProfileInputApproval:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_MetricInput.aspx");
                    break;

                case TaskRecordType.ProfileInputFinalize:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Console.aspx");
                    break;
                    break;

                case TaskRecordType.HealthSafetyIncident:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Incidents.aspx");
                    break;

                case TaskRecordType.PreventativeAction:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Incidents.aspx?mode=prevent");
                    break;

                case TaskRecordType.Audit:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Audits.aspx");
                    break;

                case TaskRecordType.CurrencyInput:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/Admin/Administrate_CurrencyInput.aspx");
                    break;

                default:
                    break;
                }
            }
        }
Example #5
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                uclSearchBar.PageTitle.Text = lblProbCaseTitle.Text;
                CaseCtl().isDirected        = false;

                Ucl_DocMgr ucl = (Ucl_DocMgr)this.Master.FindControl("uclDocSelect");
                if (ucl != null)
                {
                    ucl.BindDocumentSelect(CaseCtl().Context == "EHS" ? CaseCtl().Context : "SQM", 0, true);
                }

                if (ddlPlantSelect.Items.Count < 1)
                {
                    List <PLANT> plantList = SQMModelMgr.SelectPlantList(entities, SQMModelMgr.LookupPrimaryCompany(entities).COMPANY_ID, 0);
                    ddlPlantSelect.Items.Clear();
                    foreach (PLANT plant in plantList)
                    {
                        if (SessionManager.PlantAccess(plant.PLANT_ID))
                        {
                            RadComboBoxItem item = new RadComboBoxItem(plant.PLANT_NAME, plant.PLANT_ID.ToString());
                            item.CssClass = "prompt";
                            item.Checked  = true;
                            ddlPlantSelect.Items.Add(item);
                        }
                    }
                    ddlStatusSelect.SelectedValue = "A";
                }

                // create new case from quality issue
                if ((bool)SessionManager.ReturnStatus)
                {
                    if (SessionManager.ReturnObject is QI_OCCUR)
                    {
                        QI_OCCUR qiIssue = (QI_OCCUR)SessionManager.ReturnObject;
                        CaseCtl().CreateNew("QI", SessionManager.PrimaryCompany().COMPANY_ID, SessionManager.UserContext.Person);
                        CaseCtl().isAutoCreated = true;
                        CaseCtl().problemCase.ProbCase.DESC_LONG = qiIssue.INCIDENT.DESCRIPTION;
                        CaseCtl().problemCase.AddIncident(qiIssue.INCIDENT_ID);
                        uclCaseEdit.BindIncidentList(CaseCtl().problemCase.IncidentList);
                        uclCaseEdit.BindPartIssueItemList(CaseCtl().problemCase.PartIssueItemList);
                    }
                    else if (SessionManager.ReturnObject is TASK_STATUS)
                    {
                        // from inbox
                        CaseCtl().isDirected           = true;
                        uclSearchBar.ReturnButton.Text = lblReturnInbox.Text;
                        TASK_STATUS task = (TASK_STATUS)SessionManager.ReturnObject;
                        uclCaseList_Click(task.RECORD_ID);
                        if (CaseCtl().problemCase.CheckCaseNextStep() >= Convert.ToInt32(task.TASK_STEP))
                        {
                            PageTabClicked("lbTab" + task.TASK_STEP, task.TASK_STEP);
                        }
                        else
                        {
                            PageTabClicked("lbTab0", "0");
                        }
                    }
                    else if (SessionManager.ReturnObject is decimal)
                    {
                        // from console list
                        uclCaseList_Click((decimal)SessionManager.ReturnObject);
                        PageTabClicked("lbTab0", "0");
                    }
                    else if (SessionManager.ReturnObject is INCIDENT)
                    {
                        // Problem case from EHS Incident
                        INCIDENT incident   = (INCIDENT)SessionManager.ReturnObject;
                        decimal  locationId = EHSIncidentMgr.SelectIncidentLocationIdByIncidentId(incident.INCIDENT_ID);
                        CaseCtl().CreateNew("EHS", SessionManager.PrimaryCompany().COMPANY_ID, SessionManager.UserContext.Person);
                        CaseCtl().problemCase.ProbCase.DESC_SHORT    = incident.ISSUE_TYPE;
                        CaseCtl().problemCase.ProbCase.DESC_LONG     = incident.DESCRIPTION;
                        CaseCtl().problemCase.ProbCase.PROBCASE_TYPE = "EHS";
                        CaseCtl().problemCase.AddIncident(incident.INCIDENT_ID);
                        uclCaseEdit.BindIncidentList(CaseCtl().problemCase.IncidentList);
                        if (CaseCtl().problemCase.ProbCase.PROB_DEFINE == null)
                        {
                            CaseCtl().problemCase.CreateProblemDefinition();
                        }
                        CaseCtl().isAutoCreated = true;
                    }
                    else
                    {
                        uclSearchBar_OnSearchClick();
                    }
                }
                else
                {
                    uclSearchBar_OnSearchClick();
                }
            }
            else
            {
                /* add incidents from qi issue popup list */
                if ((bool)SessionManager.ReturnStatus)
                {
                    if (SessionManager.ReturnObject.GetType().ToString().ToUpper().Contains("INCIDENT"))
                    {
                        List <INCIDENT> incidentList = (List <INCIDENT>)SessionManager.ReturnObject;
                        foreach (INCIDENT incident in incidentList)
                        {
                            CaseCtl().problemCase.AddIncident(incident.INCIDENT_ID);
                        }
                        uclCaseEdit.BindIncidentList(CaseCtl().problemCase.IncidentList);
                        uclCaseEdit.BindPartIssueItemList(CaseCtl().problemCase.PartIssueItemList);
                        PageTabClicked("lbTab0", "0");
                    }

                    else if (SessionManager.ReturnObject == "DisplayCases")
                    {
                        uclSearchBar_OnSearchClick();
                        SessionManager.ClearReturns();
                    }
                }
            }
            SessionManager.ClearReturns();

            if (CaseCtl().isAutoCreated)
            {
                CaseCtl().Update();
                SetupPage();
                PageTabClicked("lbTab0", "0");
            }
        }
Example #6
0
        public void rptTaskList_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                try
                {
                    TaskItem         item = (TaskItem)e.Item.DataItem;
                    Ucl_IncidentList ucl;
                    Ucl_EHSList      ecl;
                    LinkButton       lnk;
                    Label            lbl;
                    Image            img;
                    //TaskStatus status;
                    TaskRecordType taskType = (TaskRecordType)item.RecordType;
                    switch (taskType)
                    {
                    case TaskRecordType.QualityIssue:        // quality issue
                        lnk = (LinkButton)e.Item.FindControl("lnkTask");
                        if (!string.IsNullOrEmpty(item.Task.DESCRIPTION))
                        {
                            lnk.Text = item.Title + "<br>(" + item.Task.DESCRIPTION + ")";
                        }
                        else
                        {
                            lnk.Text = item.Title;
                        }

                        INCIDENT incident = (INCIDENT)item.Detail;
                        QI_OCCUR qiIssue  = (QI_OCCUR)item.Reference;
                        lnk.CommandArgument = item.RecordKey;
                        lbl          = (Label)e.Item.FindControl("lblDueDate");
                        lbl.Text     = SQMBasePage.FormatDate((DateTime)item.Task.DUE_DT, "d", false);
                        img          = (Image)e.Item.FindControl("imgTaskStatus");
                        img.ImageUrl = TaskMgr.TaskStatusImage(item.Taskstatus);
                        img.ToolTip  = item.Taskstatus.ToString();
                        QualityIncidentData issue = new QualityIncidentData();
                        issue.Incident         = incident;
                        issue.QIIssue          = qiIssue;
                        issue.Plant            = item.Plant;
                        issue.PlantResponsible = item.PlantResponsible;
                        issue.Person           = item.Person;
                        issue.Part             = item.Part;
                        List <QualityIncidentData> incidentList = new List <QualityIncidentData>();
                        ucl = (Ucl_IncidentList)e.Item.FindControl("uclIssueList");
                        ucl.LinksDisabled = true;
                        ucl.BindQualityIncidentHeader(issue, true);
                        break;

                    case TaskRecordType.ProblemCase:        // 8D problem case
                        lnk      = (LinkButton)e.Item.FindControl("lnkTask");
                        lnk.Text = item.Title;
                        PROB_CASE probCase = (PROB_CASE)item.Detail;
                        lnk.CommandArgument = item.RecordKey;
                        lbl          = (Label)e.Item.FindControl("lblDueDate");
                        lbl.Text     = SQMBasePage.FormatDate((DateTime)item.Task.DUE_DT, "d", false);
                        img          = (Image)e.Item.FindControl("imgTaskStatus");
                        img.ImageUrl = TaskMgr.TaskStatusImage(item.Taskstatus);
                        img.ToolTip  = item.Taskstatus.ToString();
                        ProblemCase theCase = new ProblemCase();
                        theCase.ProbCase = probCase;
                        theCase.SetAliasID();
                        ucl = (Ucl_IncidentList)e.Item.FindControl("uclIssueList");
                        ucl.LinksDisabled = true;
                        ucl.BindProblemCaseHeader(theCase, item);
                        break;

                    case TaskRecordType.ProfileInput:         // Profile inputs
                    case TaskRecordType.ProfileInputApproval: // approval
                    case TaskRecordType.ProfileInputFinalize: // finalize
                        lnk                 = (LinkButton)e.Item.FindControl("lnkTask");
                        lnk.Text            = item.Title;
                        lnk.CommandArgument = item.RecordKey;
                        lbl                 = (Label)e.Item.FindControl("lblDueDate");
                        lbl.Text            = SQMBasePage.FormatDate((DateTime)item.Task.DUE_DT, "d", false);
                        img                 = (Image)e.Item.FindControl("imgTaskStatus");
                        img.ImageUrl        = TaskMgr.TaskStatusImage(item.Taskstatus);
                        img.ToolTip         = item.Taskstatus.ToString();
                        ecl                 = (Ucl_EHSList)e.Item.FindControl("uclEHSPeriod");
                        ecl.BindProfilePeriodHdr(item);
                        break;

                    case TaskRecordType.HealthSafetyIncident:        // Health & safety incidents
                        lnk                 = (LinkButton)e.Item.FindControl("lnkTask");
                        lnk.Text            = item.Title;
                        lnk.CommandArgument = item.RecordKey;
                        lbl                 = (Label)e.Item.FindControl("lblDueDate");
                        lbl.Text            = SQMBasePage.FormatDate((DateTime)item.Task.DUE_DT, "d", false);
                        img                 = (Image)e.Item.FindControl("imgTaskStatus");
                        img.ImageUrl        = TaskMgr.TaskStatusImage(item.Taskstatus);
                        img.ToolTip         = item.Taskstatus.ToString();
                        INCIDENT EHSIncident = (INCIDENT)item.Detail;
                        ucl = (Ucl_IncidentList)e.Item.FindControl("uclIssueList");
                        ucl.LinksDisabled = true;
                        ucl.BindIncidentListHeader(EHSIncident, item);
                        break;

                    case TaskRecordType.PreventativeAction:       // preventative action
                        lnk                 = (LinkButton)e.Item.FindControl("lnkTask");
                        lnk.Text            = item.Title;
                        lnk.CommandArgument = item.RecordKey;
                        lbl                 = (Label)e.Item.FindControl("lblDueDate");
                        lbl.Text            = SQMBasePage.FormatDate((DateTime)item.Task.DUE_DT, "d", false);
                        img                 = (Image)e.Item.FindControl("imgTaskStatus");
                        img.ImageUrl        = TaskMgr.TaskStatusImage(item.Taskstatus);
                        img.ToolTip         = item.Taskstatus.ToString();
                        INCIDENT EHSAction = (INCIDENT)item.Detail;
                        ucl = (Ucl_IncidentList)e.Item.FindControl("uclIssueList");
                        ucl.LinksDisabled = true;
                        ucl.BindIncidentListHeader(EHSAction, item);
                        break;

                    default:
                        break;
                    }

                    if (item.Taskstatus == TaskStatus.EscalationLevel1 || item.Taskstatus == TaskStatus.EscalationLevel2)
                    {
                        if (UserContext.RoleAccess() < AccessMode.Admin)
                        {
                            lnk         = (LinkButton)e.Item.FindControl("lnkTask");
                            lbl         = (Label)e.Item.FindControl("lblTask");
                            lbl.Text    = lnk.Text;
                            lnk.Visible = false;
                            lbl.Visible = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }