Пример #1
0
        // CREATE
        public async Task Create(ProductVersieCyclus obj)
        {
            try
            {
                // Reset Product Versie status naar "Test"
                ProductVersie pv = await productVersieRepository.GetFrom(obj.ProductVersieId);

                if (pv == null)
                {
                    return;
                }

                if (pv.Status.Equals(2))
                // Als de Product Versie status "productie" heeft, omschakelen naar "test" status
                {
                    pv.Status = 1;
                }

                // Update object

                repository.Create(obj);
                await DB.SaveChangesAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        // READ
        public async Task <ProductVersie> GetFrom(long productVersieID)
        {
            try
            {
                // Lees Actuele DataBase
                ProductVersie tmpResult = await repository.GetFrom(productVersieID);

                this.UpdateVersie(ref tmpResult);

                return(tmpResult);;
            }
            catch (Exception ex)
            {
                throw;
            }
        }