예제 #1
0
        // Ophalen van lijst maak instellingen op basis van cyclus type
        public List<CyclusMaakInstelling> GetCyclusMaakInstellingenFromCyclusType(string cyclusTypeNaam)
        {
            try
            {

                ProductVersieCyclus pvc = this.ProductVersieCyclus.Where(x => x.Cyclus.CyclusType.Naam.Equals(cyclusTypeNaam)).SingleOrDefault();

                if (pvc == null)
                {
                    throw new Exception("Geen product versie cyclys gevonden van het opgegeven cyclus type");
                }

                if (pvc.Cyclus == null)
                {
                    throw new Exception("Geen Cyclus object beschikbaar");
                }

                if (pvc.Cyclus.CyclusMaakInstelling == null)
                {
                    throw new Exception("Geen cyclus maak instellingen beschikbaar.");
                }

                return pvc.Cyclus.CyclusMaakInstelling.ToList();
            }
            catch (Exception ex)
            {
                return null;
            }

        }
예제 #2
0
        // Ophalen van lijst maak instellingen op basis van cyclus type
        public List <CyclusMaakInstelling> GetCyclusMaakInstellingenFromCyclusType(string cyclusTypeNaam)
        {
            try
            {
                if (this.ProductVersie.Count > 1)
                // Fail als er meer dan 1 versie is
                {
                    throw new Exception("Deze functie kan enkel gebruiket worden als er maar één versie in het artikel wordt meegegeven. Ref functie: GetLaatsteVersie");
                }

                if (this.ProductVersie.Count.Equals(0))
                // FAIL als er geen versies zijn
                {
                    throw new Exception("Geen versie beschikbaar");
                }

                ProductVersieCyclus pvc = this.ProductVersie.ToList()[0].ProductVersieCyclus.Where(x => x.Cyclus.CyclusType.Naam.Equals(cyclusTypeNaam)).SingleOrDefault();

                if (pvc == null)
                {
                    throw new Exception("Geen product versie cyclys gevonden van het opgegeven cyclus type");
                }

                if (pvc.Cyclus == null)
                {
                    throw new Exception("Geen Cyclus object beschikbaar");
                }

                if (pvc.Cyclus.CyclusMaakInstelling == null)
                {
                    throw new Exception("Geen cyclus maak instellingen beschikbaar.");
                }

                return(pvc.Cyclus.CyclusMaakInstelling.ToList());
            }
            catch (Exception ex)
            {
                return(null);
            }
        }