Ejemplo n.º 1
0
        private void definir_ciclo(object sender, EventArgs e)
        {
            if (GlobalVar.Compania == 110)
            {
                if (Mscycle == "" && NPScycle == "" && Opencycle1 == "" && Opencycle2 == "")
                {
                    txtciclo.Text = "Check";
                }
                else
                {
                    if (Mscycle.Contains("JHD") == true && ester == "JACKSON        ")
                    {
                        txtciclo.Text = "JHD";
                    }

                    else if (Opencycle1.Contains("ELP") == true && ester == "STERIGENICS    ")
                    {
                        txtciclo.Text = "65";
                    }

                    else if (Mscycle.Substring(0, 2) == "MR" || Opencycle1.Contains("MR") == true || Opencycle2.Contains("MR") == true)
                    {
                        txtciclo.Text = "LR";
                    }
                    else if (Mscycle.Contains("THD") == true || Opencycle1.Contains("THD") == true || Opencycle2.Contains("THD") == true)
                    {
                        txtciclo.Text = "THD";
                    }
                    else if (Mscycle.Contains("LHM") == true || Opencycle1.Contains("LHM") == true || Opencycle2.Contains("LHM") == true)
                    {
                        txtciclo.Text = "LHM";
                    }
                    else
                    {
                        txtciclo.Text = "Check";
                    }
                }
            }
            else if (GlobalVar.Compania == 686)
            {
                if (Mscycle == "" && Opencycle1 == "")
                {
                    txtciclo.Text = "Check";
                }
                else
                {
                    if (Mscycle.Substring(0, 2) == "MR" && Opencycle1.Substring(3, 2) == "65")
                    {
                        txtciclo.Text = "65";
                    }

                    else if (Mscycle.Substring(0, 2) == "MR" && Opencycle1.Substring(0, 2) == "54")
                    {
                        txtciclo.Text = "54";
                    }
                    else if (Mscycle.Substring(0, 2) == "MR" && Opencycle1.Substring(10, 2) == "65")
                    {
                        txtciclo.Text = "65";
                    }
                    else if (Mscycle.Substring(0, 2) == "MR" || Opencycle1.Contains("54") == true && Opencycle1.Contains("65") == true)
                    {
                        txtciclo.Text = "65";
                    }
                    else
                    {
                        txtciclo.Text = "Check";
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void destino_esteril(object sender, EventArgs e)
        {
            // mimic same R38 criterias
            Double OHqty;

            OHqty = qtypartoh - unmps;

            double RevMIOH;

            // Getting RevMIOH according to R38 criterias
            if (forecast > 0 && family != "CMP")
            {
                RevMIOH = (wosm14 + OHqty) / forecast;
            }
            else if ((fgstatus == "3" && book6 != 0) || (fgstatus == "3" && book5 != 0) || (fgstatus == "3" && book4 != 0))
            {
                RevMIOH = OHqty / ((book6 + book5 + book4) / 3);
            }
            else
            {
                RevMIOH = fgmioh;
            }

            // Calculating destination R38 Formulas taken from DB

            string MidwestCycle = Mscycle;

            if (MidwestCycle == null || MidwestCycle == "")
            {
                MidwestCycle = "";
            }
            else
            {
                MidwestCycle = Mscycle.Substring(0, 2);
            }

            if (GlobalVar.Compania == 110)
            {
                if ((family != "CMP" && RevMIOH <= 0.8 && abc != "N" && MidwestCycle == "MR") || (family == "CMP" && mioh2 <= 1.25 && abc != "N" && MidwestCycle == "MR") || (MidwestCycle == "MR" && abc == "N" && wt.TrimEnd() == "1") || (MidwestCycle == "MR" && main_division == "20" && wt.TrimEnd() == "1"))
                {
                    printmessage = "LAREDO-HOT!";
                }
                else if (Opencycle1.Contains("ELP") == true && ester == "STERIGENICS    ")
                {
                    printmessage = "STERIGENICS";
                }

                else if (family != "CMP" && fgstatus == "3" && RevMIOH <= 0.8 && MidwestCycle == "MR")
                {
                    printmessage = "LAREDO-HOT!";
                }
                else if ((ester.TrimEnd() == "JACKSON" && RevMIOH <= 1.00 && abc != "N" && family != "CMP") || (ester.TrimEnd() == "NPS LRD" && RevMIOH <= 1.25 && abc != "N" && family != "CMP") || (ester.TrimEnd() == "SYNERGY" && RevMIOH <= 1.25 && abc != "N" && family != "CMP") || (wt.Trim() == "1" && MidwestCycle != ""))
                {
                    printmessage = "LAREDO";
                }
                else if (main_division == "20" && (producto == "DYNDBARD1" || producto == "DYNDBARD3" || producto == "DYNDBARD6" || producto == "DYNDBARD7" || producto == "DYNDBARD8" || producto == "DYNDBARD9" || producto == "DYNDBARD10" || producto == "DYNDBARD11" || producto == "DYNDBARD12" || producto == "DYNDBARD13" || producto == "DYNDBARD14" || producto == "DYNDBARD15" || producto == "DYNDBARD16" || producto == "DYNDBARD17" || producto == "DYNDCORAM1" || producto == "DYNDCORAM2" || producto == "DYNDCORAM3" || producto == "DYNDCORAM4" || producto == "DC5090LF" || producto == "DC5040LF" || producto == "DC5030LF"))
                {
                    printmessage = "LAREDO";
                }
                else if ((ester.TrimEnd() == "NPS WKG" && RevMIOH <= 0.8 && MidwestCycle == "MR" && family != "CMP") || (ester.TrimEnd() == "NPS WKG" && MidwestCycle == "MR" && family != "CMP" && wt.TrimEnd() == "1" && RevMIOH <= 0.8))
                {
                    printmessage = "LAREDO-HOT!";
                }
                else if ((ester.TrimEnd() == "NPS WKG" && family == "CMP") || (ester.TrimEnd() == "NPS WKG" && family != "CMP" && RevMIOH <= 1.25))
                {
                    printmessage = "LAREDO";
                }
                else if (ester.TrimEnd() == "NPS WKG" && family != "CMP" && RevMIOH > 1.25)
                {
                    printmessage = "NPS";
                }
                else if (fgstatus != "3" && forecast <= 5 && abc != "N")
                {
                    printmessage = "LAREDO";
                }
                else if (ester.TrimEnd() == "NPS LRD")
                {
                    printmessage = "NPS";
                }
                else if (Mscycle == "" && Opencycle1 == "" && Opencycle2 == "" && NPScycle == "")
                {
                    printmessage = "CHECK";
                }
                else
                {
                    printmessage = ester.TrimEnd();
                }
            }

            else if (GlobalVar.Compania == 686)
            {
                if ((family != "CMP" && RevMIOH <= 0.8 && abc != "N" && MidwestCycle == "MR") || (family == "CMP" && mioh2 <= 1.25 && abc != "N" && MidwestCycle == "MR") || (MidwestCycle == "MR" && abc == "N" && wt.TrimEnd() == "1") || (MidwestCycle == "MR" && main_division == "20" && wt.TrimEnd() == "1"))
                {
                    printmessage = "STERIGENICS ONTARIO";
                }
                else if (ester.TrimEnd() == "STERIGENICS ONTARIO" && MidwestCycle == "MR")
                {
                    printmessage = "STERIGENICS ONTARIO";
                }
                else if (Mscycle == "" && Opencycle1 == "")
                {
                    printmessage = "CHECK";
                }
                else
                {
                    printmessage = ester.TrimEnd();
                }
            }

            definir_ciclo((object)sender, (EventArgs)e);
        }