Ejemplo n.º 1
0
        public MakeProduct GetMakeProduct(string id)
        {
            MakeProduct makeProduct = _context.MakeProducts.Where(a => a.Id.Equals(id))
                                      .SingleOrDefault();

            return(makeProduct);
        }
Ejemplo n.º 2
0
        public MakeProduct CreateMakeProduct(MakeProduct makeProduct)
        {
            _context.MakeProducts.Add(makeProduct);
            _context.SaveChanges();

            return(makeProduct);
        }
Ejemplo n.º 3
0
        public MakeProduct CreateMakeProduct(MakeProduct makeProduct)
        {
            if (makeProduct.AssemblyMmsId != null)
            {
                makeProduct.AssemblyMms = _assemblyMmsRepository
                                          .GetAssemblyMms(makeProduct.AssemblyMmsId);
            }
            else
            {
                throw new ArgumentException($"Please, enter ID Assembly Mms ");
            }
            if (makeProduct.AuthorId != null)
            {
                makeProduct.Author = _authorRepository
                                     .GetAuthor(makeProduct.AuthorId.Value);
            }
            if (makeProduct.WarehouseId != null)
            {
                makeProduct.Warehouse = _warehouseRepository
                                        .GetWarehouse(makeProduct.WarehouseId.Value);
            }

            return(_makeProductRepository.CreateMakeProduct(makeProduct));
        }
Ejemplo n.º 4
0
 public MakeProduct CreateMakeProduct(MakeProduct makeProduct)
 {
     return(_makeProductService.CreateMakeProduct(makeProduct));
 }