Beispiel #1
0
        public static void berechnen()
        {
            Warehousestock          w   = Warehousestock.Class;
            Waitinglistworkstations wlw = Waitinglistworkstations.Class;
            Ordersinwork            oiw = Ordersinwork.Class;

            ValueStore vs = ValueStore.Instance;

            #region Verbindliche Aufträge
            // Kinderfahrrad
            p1 = vs.prognose3P1 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;

            e26K = p1 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e51  = p1 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;

            e16K = e51 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e17K = e51 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e50  = e51 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;

            e4  = e50 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e10 = e50 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e49 = e50 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;

            e7  = e49 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e13 = e49 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;
            e18 = e49 + vs.sb_Prognose3P1 - vs.sb_Prognose2P1;

            // Damenfahrrad
            p2 = vs.prognose3P2 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;

            e26D = p2 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e56  = p2 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;

            e16D = e56 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e17D = e56 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e55  = e56 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;

            e5  = e55 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e11 = e55 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e54 = e55 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;

            e8  = e54 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e14 = e54 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;
            e19 = e54 + vs.sb_Prognose3P2 - vs.sb_Prognose2P2;

            // Herrenfahrrad
            p3 = vs.prognose3P3 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;

            e26H = p3 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e31  = p3 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;

            e16H = e31 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e17H = e31 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e30  = e31 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;

            e6  = e30 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e12 = e30 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e29 = e30 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;

            e9  = e29 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e15 = e29 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;
            e20 = e29 + vs.sb_Prognose3P3 - vs.sb_Prognose2P3;

            #endregion

            #region Kaufteile

            k21 = p1;
            k22 = p2;
            k23 = p3;
            k24 = p3 + e31 + e16H + e16D + e16K + 2 * e30 + 2 * e29 + p1 + e51 + 2 * e50 + 2 * e49 + p2 + e56 + 2 * e55 + 2 * e54;
            k25 = 2 * e50 + 2 * e49 + 2 * e55 + 2 * e54 + 2 * e30 + 2 * e29;
            k27 = p1 + e51 + p2 + e56 + p3 + e31;
            k28 = e16D + e16H + e16K + 3 * e18 + 4 * e19 + 5 * e20;
            k32 = e10 + e13 + e18 + e11 + e14 + e19 + e12 + e15 + e20;
            k33 = e6 + e9;
            k34 = 36 * e6 + 36 * e9;
            k35 = 2 * e4 + 2 * e7 + 2 * e5 + 2 * e8 + 2 * e6 + 2 * e9;
            k36 = e4 + e5 + e6;
            k37 = e7 + e8 + e9;
            k38 = e7 + e8 + e9;
            k39 = e10 + e13 + e11 + e14 + e12 + e15;
            k40 = e16K + e16H + e16D;
            k41 = e16K + e16H + e16D;
            k42 = 2 * e16K + 2 * e16H + 2 * e16D;
            k43 = e17K + e17H + e17D;
            k44 = 2 * e26K + 2 * e26H + 2 * e26D + e17K + e17H + e17D;
            k45 = e17K + e17H + e17D;
            k46 = e17K + e17H + e17D;
            k47 = e26K + e26H + e26D;
            k48 = 2 * e26K + 2 * e26H + 2 * e26D;
            k52 = e4 + e7;
            k53 = 36 * e4 + 36 * e7;
            k57 = e5 + e8;
            k58 = 36 * e5 + 36 * e8;
            k59 = 2 * e18 + 2 * e19 + 2 * e20;

            #endregion
        }
Beispiel #2
0
        public Arbeitsplatz(int arbeitsplatzID, List <Arbeitsplatzauftrag> liste)
        {
            this.id = arbeitsplatzID;
            this.fertigungsListe = liste;
            foreach (Arbeitsplatzauftrag apa in this.fertigungsListe)
            {
                this.kapazitaetsbedarf += apa.kapabedarfProTeil;
            }
            foreach (Arbeitsplatzauftrag apa in this.fertigungsListe)
            {
                this.ruestzeit += apa.ruestzeit;
            }
            this.ruestzeit = this.ruestzeit * 1.5;

            Waitinglistworkstations wlw = Waitinglistworkstations.Class;
            var item = wlw.GetWorkplaceByID(arbeitsplatzID);

            if (item == null)
            {
                this.kapabeadarfrueckstand = 0;
            }
            else
            {
                this.kapabeadarfrueckstand = item.Timeneed;
            }

            //this.ruestzeitrueckstand =
            var WorkplaceWithID = wlw.GetWorkplaceByID(arbeitsplatzID);

            if (WorkplaceWithID != null && WorkplaceWithID.GetAllWaitinglistItem != null)
            {
                foreach (Waitinglist wl in wlw.GetWorkplaceByID(arbeitsplatzID).GetAllWaitinglistItem)
                {
                    foreach (Arbeitsplatzauftrag apa in this.fertigungsListe)
                    {
                        if (wl.Item == apa.artikelID)
                        {
                            this.ruestzeitrueckstand += apa.ruestzeit;
                        }
                    }
                }
            }
            if (arbeitsplatzID == 7 || arbeitsplatzID == 8 || arbeitsplatzID == 9 || arbeitsplatzID == 15)
            {
                this.ruestzeitrueckstand = this.ruestzeitrueckstand * 3.0;
            }
            this.ruestzeitrueckstand = this.ruestzeitrueckstand * 1.5;

            this.gesamtzeitbedarf = this.kapazitaetsbedarf + this.ruestzeit + this.kapabeadarfrueckstand + this.ruestzeitrueckstand;

            double zeitBedarfProPeriode = this.gesamtzeitbedarf;

            if (zeitBedarfProPeriode <= 3600)
            {
                this.schichten         = 1;
                this.ueberstundenInMin = Math.Ceiling((zeitBedarfProPeriode - 2400) / 10) * 10;
            }
            else if (zeitBedarfProPeriode <= 6000)
            {
                this.schichten         = 2;
                this.ueberstundenInMin = Math.Ceiling((zeitBedarfProPeriode - 4800) / 10) * 10;
            }
            else if (zeitBedarfProPeriode <= 7200)
            {
                this.schichten         = 3;
                this.ueberstundenInMin = 0;
            }
            else
            {
                this.schichten         = 3;
                this.gesamtzeitbedarf  = 7200;
                this.ueberstundenInMin = 0;
            }
            if (ueberstundenInMin < 0)
            {
                this.ueberstundenInMin = 0;
            }
        }
Beispiel #3
0
        public void kapazitaetsrueckstandAufNachfolgendeArbeitsplaetzeVerrechnen()
        {
            Waitinglistworkstations wlw        = Waitinglistworkstations.Class;
            List <Workplace>        workplaces = wlw.getAllWorkplaces();

            foreach (Workplace w in workplaces)
            {
                foreach (Waitinglist wl in w.GetAllWaitinglistItem)
                {
                    // E13-15
                    if (wl.Item == 13)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 1;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 1;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 14)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 15)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }



                    //E18-20
                    else if (wl.Item == 18)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 20;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 19)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 25;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 20)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 20;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }


                    //E7-9
                    else if (wl.Item == 7)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 8)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 9)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }


                    //E4-6
                    else if (wl.Item == 4)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 10;
                        }
                    }
                    else if (wl.Item == 5)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 10;
                        }
                    }
                    else if (wl.Item == 6)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }


                    //E10-12
                    if (wl.Item == 10)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 1;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 1;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 11)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 12)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }

                    //E16
                    else if (wl.Item == 16)
                    {
                        if (w.ID == 6)
                        {
                            a14.kapabeadarfrueckstand += wl.Amount * 3;
                        }
                    }


                    //E26
                    else if (wl.Item == 26)
                    {
                        if (w.ID == 7)
                        {
                            a15.kapabeadarfrueckstand += wl.Amount * 3;
                            a15.ruestzeitrueckstand   += 15;
                        }
                    }
                }
            }
            var oiw = Waitinglistworkstations.Class;
            List <Workplace> oWorkplaces = oiw.getAllWorkplaces();

            foreach (Workplace w in oWorkplaces)
            {
                foreach (Waitinglist wl in w.GetAllWaitinglistItem)
                {
                    // E13-15
                    if (wl.Item == 13)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 1;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 1;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 14)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 15)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }



                    //E18-20
                    else if (wl.Item == 18)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 20;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 19)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 25;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 20)
                    {
                        if (w.ID == 6)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.ruestzeitrueckstand   += 20;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 2;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }


                    //E7-9
                    else if (wl.Item == 7)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 8)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }
                    else if (wl.Item == 9)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }


                    //E4-6
                    else if (wl.Item == 4)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 10;
                        }
                    }
                    else if (wl.Item == 5)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 10;
                        }
                    }
                    else if (wl.Item == 6)
                    {
                        if (w.ID == 10)
                        {
                            a11.kapabeadarfrueckstand += wl.Amount * 3;
                            a11.ruestzeitrueckstand   += 20;
                        }
                    }


                    //E10-12
                    if (wl.Item == 10)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 1;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 1;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 11)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }
                    else if (wl.Item == 12)
                    {
                        if (w.ID == 13)
                        {
                            a12.kapabeadarfrueckstand += wl.Amount * 3;
                            a8.kapabeadarfrueckstand  += wl.Amount * 2;
                            a8.ruestzeitrueckstand    += 15;
                            a7.kapabeadarfrueckstand  += wl.Amount * 2;
                            a7.ruestzeitrueckstand    += 20;
                            a9.kapabeadarfrueckstand  += wl.Amount * 3;
                            a9.ruestzeitrueckstand    += 15;
                        }
                        else if (w.ID == 12)
                        {
                            a8.kapabeadarfrueckstand += wl.Amount * 2;
                            a8.ruestzeitrueckstand   += 15;
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 8)
                        {
                            a7.kapabeadarfrueckstand += wl.Amount * 2;
                            a7.ruestzeitrueckstand   += 20;
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                        else if (w.ID == 7)
                        {
                            a9.kapabeadarfrueckstand += wl.Amount * 3;
                            a9.ruestzeitrueckstand   += 15;
                        }
                    }

                    //E16
                    else if (wl.Item == 16)
                    {
                        if (w.ID == 6)
                        {
                            a14.kapabeadarfrueckstand += wl.Amount * 3;
                        }
                    }


                    //E26
                    else if (wl.Item == 26)
                    {
                        if (w.ID == 7)
                        {
                            a15.kapabeadarfrueckstand += wl.Amount * 3;
                            a15.ruestzeitrueckstand   += 15;
                        }
                    }
                }
            }
        }
Beispiel #4
0
        public static void berechnen()
        {
            ValueStore vs = ValueStore.Instance;

            Warehousestock          w   = Warehousestock.Class;
            Waitinglistworkstations wlw = Waitinglistworkstations.Class;
            Ordersinwork            oiw = Ordersinwork.Class;


            #region Verbindliche Aufträge
            // Kinderfahrrad
            p1 = vs.vertriebswunschP1 + vs.sicherheitsbestandP1 - w.GetArticleByID(1).Amount - wlw.GetArticleAmountByID(1) - oiw.GetArticleAmountByID(1);
            p1 = p1 + ((10 - (p1 % 10)) % 10);
            if (p1 < 0)
            {
                p1 = 0;
            }

            e26K = p1 + wlw.GetArticleAmountByID(1) + vs.sicherheitsbestandP1e26 - (w.GetArticleByID(26).Amount / 3 + wlw.GetArticleAmountByID(26) / 3 + oiw.GetArticleAmountByID(26) / 3);
            e26K = e26K + ((10 - (e26K % 10)) % 10);
            if (e26K < 0)
            {
                e26K = 0;
            }
            e51 = p1 + wlw.GetArticleAmountByID(1) + vs.sicherheitsbestandP1e51 - (w.GetArticleByID(51).Amount + wlw.GetArticleAmountByID(51) + oiw.GetArticleAmountByID(51));
            e51 = e51 + ((10 - (e51 % 10)) % 10);
            if (e51 < 0)
            {
                e51 = 0;
            }

            e16K = e51 + wlw.GetArticleAmountByID(51) + vs.sicherheitsbestandP1e16 - (w.GetArticleByID(16).Amount / 3 + wlw.GetArticleAmountByID(16) / 3 + oiw.GetArticleAmountByID(16) / 3);
            e16K = e16K + ((10 - (e16K % 10)) % 10);
            if (e16K < 0)
            {
                e16K = 0;
            }
            e17K = e51 + wlw.GetArticleAmountByID(51) + vs.sicherheitsbestandP1e17 - (w.GetArticleByID(17).Amount / 3 + wlw.GetArticleAmountByID(17) / 3 + oiw.GetArticleAmountByID(17) / 3);
            e17K = e17K + ((10 - (e17K % 10)) % 10);
            if (e17K < 0)
            {
                e17K = 0;
            }
            e50 = e51 + wlw.GetArticleAmountByID(51) + vs.sicherheitsbestandP1e50 - (w.GetArticleByID(50).Amount + wlw.GetArticleAmountByID(50) + oiw.GetArticleAmountByID(50));
            e50 = e50 + ((10 - (e50 % 10)) % 10);
            if (e50 < 0)
            {
                e50 = 0;
            }

            e4 = e50 + wlw.GetArticleAmountByID(50) + vs.sicherheitsbestandP1e4 - (w.GetArticleByID(4).Amount + wlw.GetArticleAmountByID(4) + oiw.GetArticleAmountByID(4));
            e4 = e4 + ((10 - (e4 % 10)) % 10);
            if (e4 < 0)
            {
                e4 = 0;
            }
            e10 = e50 + wlw.GetArticleAmountByID(50) + vs.sicherheitsbestandP1e10 - (w.GetArticleByID(10).Amount + wlw.GetArticleAmountByID(10) + oiw.GetArticleAmountByID(10));
            e10 = e10 + ((10 - (e10 % 10)) % 10);
            if (e10 < 0)
            {
                e10 = 0;
            }
            e49 = e50 + wlw.GetArticleAmountByID(50) + vs.sicherheitsbestandP1e49 - (w.GetArticleByID(49).Amount + wlw.GetArticleAmountByID(49) + oiw.GetArticleAmountByID(49));
            e49 = e49 + ((10 - (e49 % 10)) % 10);
            if (e49 < 0)
            {
                e49 = 0;
            }

            e7 = e49 + wlw.GetArticleAmountByID(49) + vs.sicherheitsbestandP1e7 - (w.GetArticleByID(7).Amount + wlw.GetArticleAmountByID(7) + oiw.GetArticleAmountByID(7));
            e7 = e7 + ((10 - (e7 % 10)) % 10);
            if (e7 < 0)
            {
                e7 = 0;
            }
            e13 = e49 + wlw.GetArticleAmountByID(49) + vs.sicherheitsbestandP1e13 - (w.GetArticleByID(13).Amount + wlw.GetArticleAmountByID(13) + oiw.GetArticleAmountByID(13));
            e13 = e13 + ((10 - (e13 % 10)) % 10);
            if (e13 < 0)
            {
                e13 = 0;
            }
            e18 = e49 + wlw.GetArticleAmountByID(49) + vs.sicherheitsbestandP1e18 - (w.GetArticleByID(18).Amount + wlw.GetArticleAmountByID(18) + oiw.GetArticleAmountByID(18));
            e18 = e18 + ((10 - (e18 % 10)) % 10);
            if (e18 < 0)
            {
                e18 = 0;
            }

            // Damenfahrrad
            p2 = vs.vertriebswunschP2 + vs.sicherheitsbestandP2 - w.GetArticleByID(2).Amount - wlw.GetArticleAmountByID(2) - oiw.GetArticleAmountByID(2);
            p2 = p2 + ((10 - (p2 % 10)) % 10);
            if (p2 < 0)
            {
                p2 = 0;
            }

            e26D = p2 + wlw.GetArticleAmountByID(2) + vs.sicherheitsbestandP2e26 - (w.GetArticleByID(26).Amount / 3 + wlw.GetArticleAmountByID(26) / 3 + oiw.GetArticleAmountByID(26) / 3);
            e26D = e26D + ((10 - (e26D % 10)) % 10);
            if (e26D < 0)
            {
                e26D = 0;
            }
            e56 = p2 + wlw.GetArticleAmountByID(2) + vs.sicherheitsbestandP2e56 - (w.GetArticleByID(56).Amount + wlw.GetArticleAmountByID(56) + oiw.GetArticleAmountByID(56));
            e56 = e56 + ((10 - (e56 % 10)) % 10);
            if (e56 < 0)
            {
                e56 = 0;
            }

            e16D = e56 + wlw.GetArticleAmountByID(56) + vs.sicherheitsbestandP2e16 - (w.GetArticleByID(16).Amount / 3 + wlw.GetArticleAmountByID(16) / 3 + oiw.GetArticleAmountByID(16) / 3);
            e16D = e16D + ((10 - (e16D % 10)) % 10);
            if (e16D < 0)
            {
                e16D = 0;
            }
            e17D = e56 + wlw.GetArticleAmountByID(56) + vs.sicherheitsbestandP2e17 - (w.GetArticleByID(17).Amount / 3 + wlw.GetArticleAmountByID(17) / 3 + oiw.GetArticleAmountByID(17) / 3);
            e17D = e17D + ((10 - (e17D % 10)) % 10);
            if (e17D < 0)
            {
                e17D = 0;
            }
            e55 = e56 + wlw.GetArticleAmountByID(56) + vs.sicherheitsbestandP2e55 - (w.GetArticleByID(55).Amount + wlw.GetArticleAmountByID(55) + oiw.GetArticleAmountByID(55));
            e55 = e55 + ((10 - (e55 % 10)) % 10);
            if (e55 < 0)
            {
                e55 = 0;
            }

            e5 = e55 + wlw.GetArticleAmountByID(55) + vs.sicherheitsbestandP2e5 - (w.GetArticleByID(5).Amount + wlw.GetArticleAmountByID(5) + oiw.GetArticleAmountByID(5));
            e5 = e5 + ((10 - (e5 % 10)) % 10);
            if (e5 < 0)
            {
                e5 = 0;
            }
            e11 = e55 + wlw.GetArticleAmountByID(55) + vs.sicherheitsbestandP2e11 - (w.GetArticleByID(11).Amount + wlw.GetArticleAmountByID(11) + oiw.GetArticleAmountByID(11));
            e11 = e11 + ((10 - (e11 % 10)) % 10);
            if (e11 < 0)
            {
                e11 = 0;
            }
            e54 = e55 + wlw.GetArticleAmountByID(55) + vs.sicherheitsbestandP2e54 - (w.GetArticleByID(54).Amount + wlw.GetArticleAmountByID(54) + oiw.GetArticleAmountByID(54));
            e54 = e54 + ((10 - (e54 % 10)) % 10);
            if (e54 < 0)
            {
                e54 = 0;
            }

            e8 = e54 + wlw.GetArticleAmountByID(54) + vs.sicherheitsbestandP2e8 - (w.GetArticleByID(8).Amount + wlw.GetArticleAmountByID(8) + oiw.GetArticleAmountByID(8));
            e8 = e8 + ((10 - (e8 % 10)) % 10);
            if (e8 < 0)
            {
                e8 = 0;
            }
            e14 = e54 + wlw.GetArticleAmountByID(54) + vs.sicherheitsbestandP2e14 - (w.GetArticleByID(14).Amount + wlw.GetArticleAmountByID(14) + oiw.GetArticleAmountByID(14));
            e14 = e14 + ((10 - (e14 % 10)) % 10);
            if (e14 < 0)
            {
                e14 = 0;
            }
            e19 = e54 + wlw.GetArticleAmountByID(54) + vs.sicherheitsbestandP2e19 - (w.GetArticleByID(19).Amount + wlw.GetArticleAmountByID(19) + oiw.GetArticleAmountByID(19));
            e19 = e19 + ((10 - (e19 % 10)) % 10);
            if (e19 < 0)
            {
                e19 = 0;
            }

            // Herrenfahrrad
            p3 = vs.vertriebswunschP3 + vs.sicherheitsbestandP3 - w.GetArticleByID(3).Amount - wlw.GetArticleAmountByID(3) - oiw.GetArticleAmountByID(3);
            p3 = p3 + ((10 - (p3 % 10)) % 10);
            if (p3 < 0)
            {
                p3 = 0;
            }

            e26H = p3 + wlw.GetArticleAmountByID(3) + vs.sicherheitsbestandP3e26 - (w.GetArticleByID(26).Amount / 3 + wlw.GetArticleAmountByID(26) / 3 + oiw.GetArticleAmountByID(26) / 3);
            e26H = e26H + ((10 - (e26H % 10)) % 10);
            if (e26H < 0)
            {
                e26H = 0;
            }
            e31 = p3 + wlw.GetArticleAmountByID(3) + vs.sicherheitsbestandP3e31 - (w.GetArticleByID(31).Amount + wlw.GetArticleAmountByID(31) + oiw.GetArticleAmountByID(31));
            e31 = e31 + ((10 - (e31 % 10)) % 10);
            if (e31 < 0)
            {
                e31 = 0;
            }

            e16H = e31 + wlw.GetArticleAmountByID(31) + vs.sicherheitsbestandP3e16 - (w.GetArticleByID(16).Amount / 3 + wlw.GetArticleAmountByID(16) / 3 + oiw.GetArticleAmountByID(16) / 3);
            e16H = e16H + ((10 - (e16H % 10)) % 10);
            if (e16H < 0)
            {
                e16H = 0;
            }
            //System.Windows.MessageBox.Show(e31 + " + " + wlw.GetArticleAmountByID(31) + " + " + vs.sicherheitsbestandP3 + " - (" + (w.GetArticleByID(17).Amount / 3 + " + "  + wlw.GetArticleAmountByID(17) / 3 + " + " + oiw.GetArticleAmountByID(17) / 3) + ")");
            e17H = e31 + wlw.GetArticleAmountByID(31) + vs.sicherheitsbestandP3e17 - (w.GetArticleByID(17).Amount / 3 + wlw.GetArticleAmountByID(17) / 3 + oiw.GetArticleAmountByID(17) / 3);
            e17H = e17H + ((10 - (e17H % 10)) % 10);
            if (e17H < 0)
            {
                e17H = 0;
            }
            e30 = e31 + wlw.GetArticleAmountByID(31) + vs.sicherheitsbestandP3e30 - (w.GetArticleByID(30).Amount + wlw.GetArticleAmountByID(30) + oiw.GetArticleAmountByID(30));
            e30 = e30 + ((10 - (e30 % 10)) % 10);
            if (e30 < 0)
            {
                e30 = 0;
            }

            e6 = e30 + wlw.GetArticleAmountByID(30) + vs.sicherheitsbestandP3e6 - (w.GetArticleByID(6).Amount + wlw.GetArticleAmountByID(6) + oiw.GetArticleAmountByID(6));
            e6 = e6 + ((10 - (e6 % 10)) % 10);
            if (e6 < 0)
            {
                e6 = 0;
            }
            e12 = e30 + wlw.GetArticleAmountByID(30) + vs.sicherheitsbestandP3e12 - (w.GetArticleByID(12).Amount + wlw.GetArticleAmountByID(12) + oiw.GetArticleAmountByID(12));
            e12 = e12 + ((10 - (e12 % 10)) % 10);
            if (e12 < 0)
            {
                e12 = 0;
            }
            e29 = e30 + wlw.GetArticleAmountByID(30) + vs.sicherheitsbestandP3e29 - (w.GetArticleByID(29).Amount + wlw.GetArticleAmountByID(29) + oiw.GetArticleAmountByID(29));
            e29 = e29 + ((10 - (e29 % 10)) % 10);
            if (e29 < 0)
            {
                e29 = 0;
            }

            e9 = e29 + wlw.GetArticleAmountByID(29) + vs.sicherheitsbestandP3e9 - (w.GetArticleByID(9).Amount + wlw.GetArticleAmountByID(9) + oiw.GetArticleAmountByID(9));
            e9 = e9 + ((10 - (e9 % 10)) % 10);
            if (e9 < 0)
            {
                e9 = 0;
            }
            e15 = e29 + wlw.GetArticleAmountByID(29) + vs.sicherheitsbestandP3e15 - (w.GetArticleByID(15).Amount + wlw.GetArticleAmountByID(15) + oiw.GetArticleAmountByID(15));
            e15 = e15 + ((10 - (e15 % 10)) % 10);
            if (e15 < 0)
            {
                e15 = 0;
            }
            e20 = e29 + wlw.GetArticleAmountByID(29) + vs.sicherheitsbestandP3e20 - (w.GetArticleByID(20).Amount + wlw.GetArticleAmountByID(20) + oiw.GetArticleAmountByID(20));
            e20 = e20 + ((10 - (e20 % 10)) % 10);
            if (e20 < 0)
            {
                e20 = 0;
            }

            #endregion

            #region Kaufteile

            k21 = p1;
            k22 = p2;
            k23 = p3;
            k24 = p3 + e31 + e16H + e16D + e16K + 2 * e30 + 2 * e29 + p1 + e51 + 2 * e50 + 2 * e49 + p2 + e56 + 2 * e55 + 2 * e54;
            k25 = 2 * e50 + 2 * e49 + 2 * e55 + 2 * e54 + 2 * e30 + 2 * e29;
            k27 = p1 + e51 + p2 + e56 + p3 + e31;
            k28 = e16D + e16H + e16K + 3 * e18 + 4 * e19 + 5 * e20;
            k32 = e10 + e13 + e18 + e11 + e14 + e19 + e12 + e15 + e20;
            k33 = e6 + e9;
            k34 = 36 * e6 + 36 * e9;
            k35 = 2 * e4 + 2 * e7 + 2 * e5 + 2 * e8 + 2 * e6 + 2 * e9;
            k36 = e4 + e5 + e6;
            k37 = e7 + e8 + e9;
            k38 = e7 + e8 + e9;
            k39 = e10 + e13 + e11 + e14 + e12 + e15;
            k40 = e16K + e16H + e16D;
            k41 = e16K + e16H + e16D;
            k42 = 2 * e16K + 2 * e16H + 2 * e16D;
            k43 = e17K + e17H + e17D;
            k44 = 2 * e26K + 2 * e26H + 2 * e26D + e17K + e17H + e17D;
            k45 = e17K + e17H + e17D;
            k46 = e17K + e17H + e17D;
            k47 = e26K + e26H + e26D;
            k48 = 2 * e26K + 2 * e26H + 2 * e26D;
            k52 = e4 + e7;
            k53 = 36 * e4 + 36 * e7;
            k57 = e5 + e8;
            k58 = 36 * e5 + 36 * e8;
            k59 = 2 * e18 + 2 * e19 + 2 * e20;

            #endregion
        }
Beispiel #5
0
        public bool ParseXML(string XMLinput)
        {
            try {
                if (String.IsNullOrEmpty(XMLinput))
                {
                    throw new ArgumentNullException();
                }

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XMLinput);

                Static.Static.ClearInputClasses();

                Static.Static.game       = Convert.ToInt32(doc.DocumentElement.Attributes["game"].InnerText);
                Static.Static.group      = Convert.ToInt32(doc.DocumentElement.Attributes["group"].InnerText);
                Static.Static.lastperiod = Convert.ToInt32(doc.DocumentElement.Attributes["period"].InnerText);

                foreach (XmlNode Results in doc.DocumentElement.ChildNodes)
                {
                    foreach (XmlNode node in Results)
                    {
                        if (Results.Name == "warehousestock")
                        {
                            Warehousestock w = Warehousestock.Class;
                            if (node.Name == "article")
                            {
                                w.AddArticle(new Warehousestock.Article(Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["amount"].InnerText), Convert.ToInt32(node.Attributes["startamount"].InnerText), Convert.ToDouble(node.Attributes["pct"].InnerText), Convert.ToDouble(node.Attributes["price"].InnerText), Convert.ToDouble(node.Attributes["stockvalue"].InnerText)));
                            }
                        }
                        else if (Results.Name == "inwardstockmovement")
                        {
                            Inwardstockmovement iwsm = Inwardstockmovement.Class;
                            iwsm.AddOrder(new Inwardstockmovement.Order(Convert.ToInt32(node.Attributes["orderperiod"].InnerText), Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["mode"].InnerText), Convert.ToInt32(node.Attributes["article"].InnerText), Convert.ToInt32(node.Attributes["amount"].InnerText), Convert.ToInt32(node.Attributes["time"].InnerText), Convert.ToDouble(node.Attributes["materialcosts"].InnerText), Convert.ToDouble(node.Attributes["ordercosts"].InnerText), Convert.ToDouble(node.Attributes["entirecosts"].InnerText), Convert.ToDouble(node.Attributes["piececosts"].InnerText)));
                        }
                        else if (Results.Name == "futureinwardstockmovement")
                        {
                            Futureinwardstockmovement fiwsm = Futureinwardstockmovement.Class;
                            fiwsm.AddOrder(new Futureinwardstockmovement.Order(Convert.ToInt32(node.Attributes["orderperiod"].InnerText), Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["mode"].InnerText), Convert.ToInt32(node.Attributes["article"].InnerText), Convert.ToInt32(node.Attributes["amount"].InnerText)));
                        }
                        else if (Results.Name == "idletimecosts")
                        {
                            Idletimecosts itc = Idletimecosts.Class;
                            if (node.Name == "workplace")
                            {
                                itc.AddWorkplace(new Idletimecosts.Workplace(Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["setupevents"].InnerText), Convert.ToInt32(node.Attributes["idletime"].InnerText), Convert.ToDouble(node.Attributes["wageidletimecosts"].InnerText), Convert.ToDouble(node.Attributes["wagecosts"].InnerText), Convert.ToDouble(node.Attributes["machineidletimecosts"].InnerText)));
                            }
                        }
                        else if (Results.Name == "waitinglistworkstations")
                        {
                            Waitinglistworkstations           wlws = Waitinglistworkstations.Class;
                            Waitinglistworkstations.Workplace wp   = new Waitinglistworkstations.Workplace(Convert.ToInt32(node.Attributes["id"].InnerText));
                            foreach (XmlNode waitinglist in node)
                            {
                                wp.Add(new Waitinglistworkstations.Workplace.Waitinglist(Convert.ToInt32(waitinglist.Attributes["period"].InnerText), Convert.ToInt32(waitinglist.Attributes["order"].InnerText), Convert.ToInt32(waitinglist.Attributes["firstbatch"].InnerText), Convert.ToInt32(waitinglist.Attributes["lastbatch"].InnerText), Convert.ToInt32(waitinglist.Attributes["item"].InnerText), Convert.ToInt32(waitinglist.Attributes["amount"].InnerText), Convert.ToInt32(waitinglist.Attributes["timeneed"].InnerText)));
                            }
                            wlws.Add(wp);
                        }
                        else if (Results.Name == "waitingliststock")
                        {
                            Waitingliststock             wls = Waitingliststock.Class;
                            Waitingliststock.Missingpart mp  = new Waitingliststock.Missingpart(Convert.ToInt32(node.Attributes["id"].InnerText));
                            foreach (XmlNode waitinglist in node)
                            {
                                mp.Add(new Waitingliststock.Missingpart.Waitinglist(Convert.ToInt32(waitinglist.Attributes["period"].InnerText), Convert.ToInt32(waitinglist.Attributes["order"].InnerText), Convert.ToInt32(waitinglist.Attributes["firstbatch"].InnerText), Convert.ToInt32(waitinglist.Attributes["lastbatch"].InnerText), Convert.ToInt32(waitinglist.Attributes["item"].InnerText), Convert.ToInt32(waitinglist.Attributes["amount"].InnerText)));
                            }
                            wls.Add(mp);
                        }
                        else if (Results.Name == "ordersinwork")
                        {
                            Ordersinwork oiw = Ordersinwork.Class;
                            oiw.Add(new Ordersinwork.Workplace(Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["period"].InnerText), Convert.ToInt32(node.Attributes["order"].InnerText), Convert.ToInt32(node.Attributes["batch"].InnerText), Convert.ToInt32(node.Attributes["item"].InnerText), Convert.ToInt32(node.Attributes["amount"].InnerText), Convert.ToInt32(node.Attributes["timeneed"].InnerText)));
                        }
                        else if (Results.Name == "completedorders")
                        {
                            Completedorders       co = Completedorders.Class;
                            Completedorders.Order o  = new Completedorders.Order(Convert.ToInt32(node.Attributes["period"].InnerText), Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["item"].InnerText));
                            foreach (XmlNode batch in node)
                            {
                                o.AddBatch(new Completedorders.Order.Batch(Convert.ToInt32(batch.Attributes["id"].InnerText), Convert.ToInt32(batch.Attributes["amount"].InnerText), Convert.ToInt32(batch.Attributes["cycletime"].InnerText), Convert.ToDouble(batch.Attributes["cost"].InnerText)));
                            }
                            co.AddOrder(o);
                        }
                        else if (Results.Name == "cycletimes")
                        {
                            Cycletimes ct = Cycletimes.Class;
                            if (Cycletimes.Class == null)
                            {
                                ct = new Cycletimes(Convert.ToInt32(Results.Attributes["startedorders"].InnerText), Convert.ToInt32(Results.Attributes["waitingorders"].InnerText));
                            }
                            ct.AddOrder(new Cycletimes.Order(Convert.ToInt32(node.Attributes["id"].InnerText), Convert.ToInt32(node.Attributes["period"].InnerText), node.Attributes["starttime"].InnerText, node.Attributes["finishtime"].InnerText, Convert.ToInt32(node.Attributes["cycletimemin"].InnerText), Convert.ToDouble(node.Attributes["cycletimefactor"].InnerText)));
                        }
                        else if (Results.Name == "result")
                        {
                            foreach (XmlNode inner in node)
                            {
                                if (node.Name == "general")
                                {
                                    if (inner.Name == "capacity")
                                    {
                                        Result.General.Capacity = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "possiblecapacity")
                                    {
                                        Result.General.Possiblecapacity = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "relpossiblenormalcapacity")
                                    {
                                        Result.General.Relpossiblenormalcapacity = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "productivetime")
                                    {
                                        Result.General.Productivetime = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "effiency")
                                    {
                                        Result.General.Effiency = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "sellwish")
                                    {
                                        Result.General.Sellwish = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "salesquantity")
                                    {
                                        Result.General.Salesquantity = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "deliveryreliability")
                                    {
                                        Result.General.Deliveryreliability = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "idletime")
                                    {
                                        Result.General.Idletime = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "idletimecosts")
                                    {
                                        Result.General.Idletimecosts = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "storevalue")
                                    {
                                        Result.General.Storevalue = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "storagecosts")
                                    {
                                        Result.General.Storagecosts = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                                else if (node.Name == "defectivegoods")
                                {
                                    if (inner.Name == "quantity")
                                    {
                                        Result.Defectivegoods.Quantity = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "costs")
                                    {
                                        Result.Defectivegoods.Costs = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                                else if (node.Name == "normalsale")
                                {
                                    if (inner.Name == "salesprice")
                                    {
                                        Result.Normalsale.Salesprice = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "profit")
                                    {
                                        Result.Normalsale.Profit = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "profitperunit")
                                    {
                                        Result.Normalsale.Profitperunit = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                                else if (node.Name == "directsale")
                                {
                                    if (inner.Name == "profit")
                                    {
                                        Result.Directsale.Profit = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                    else if (inner.Name == "contractpenalty")
                                    {
                                        Result.Directsale.Contractpenalty = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                                else if (node.Name == "marketplacesale")
                                {
                                    if (inner.Name == "profit")
                                    {
                                        Result.Marketplacesale.Profit = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                                else if (node.Name == "summary")
                                {
                                    if (inner.Name == "profit")
                                    {
                                        Result.Summary.Profit = new Result.ResultTyp(inner.Attributes["current"].InnerText, inner.Attributes["average"].InnerText, inner.Attributes["all"].InnerText);
                                    }
                                }
                            }
                        }
                    }
                }
            } catch {
                return(false);
            }
            return(true);
        }