public bool Delete(int SealedProductID) { bool Confirmation; SealedProductDataController SealedProductDataController = new SealedProductDataController(); Confirmation = SealedProductDataController.DeleteSealedProduct(SealedProductID); return(Confirmation); }
public SealedProduct GetSealedProductByID(int SealedProductID) { SealedProduct FoundProduct = new SealedProduct(); SealedProductDTO SealedProductDTO = new SealedProductDTO(); SealedProductDataController SealedProductDataController = new SealedProductDataController(); SealedProductDTO = SealedProductDataController.GetSealedProduct(SealedProductID); FoundProduct.SealedProductID = SealedProductDTO.SealedProductID; FoundProduct.SetID = SealedProductDTO.SetID; FoundProduct.SealedProductName = SealedProductDTO.SealedProductName; FoundProduct.Price = SealedProductDTO.Price; return(FoundProduct); }
public bool Put([FromBody] SealedProduct UpdatedSealedProduct) { bool Confirmation; SealedProductDataController SealedProductDataController = new SealedProductDataController(); SealedProductDTO ProductDTO = new SealedProductDTO { SealedProductID = UpdatedSealedProduct.SealedProductID, SealedProductName = UpdatedSealedProduct.SealedProductName, SetID = UpdatedSealedProduct.SetID, Price = UpdatedSealedProduct.Price }; Confirmation = SealedProductDataController.UpdateSealedProduct(ProductDTO); return(Confirmation); }
public bool Post([FromBody] SealedProduct NewProduct) { bool Confrimation; SealedProductDataController SealedProductDataController = new SealedProductDataController(); SealedProductDTO ProductDTO = new SealedProductDTO { SealedProductID = NewProduct.SealedProductID, SealedProductName = NewProduct.SealedProductName, SetID = NewProduct.SetID, Price = NewProduct.Price }; Confrimation = SealedProductDataController.AddSealedProduct(ProductDTO); return(Confrimation); }
public List <SealedProduct> GetSealedProductByGame(int GameID) { List <SealedProduct> SealedProducts = new List <SealedProduct>(); List <SealedProductDTO> SealedProductDTOs = new List <SealedProductDTO>(); SealedProductDataController SealedProductDataController = new SealedProductDataController(); SealedProductDTOs = SealedProductDataController.GetSealedProductsByGame(GameID); foreach (var Product in SealedProductDTOs) { SealedProduct FoundProduct = new SealedProduct { SealedProductID = Product.SealedProductID, SetID = Product.SetID, SealedProductName = Product.SealedProductName, Price = Product.Price }; SealedProducts.Add(FoundProduct); } return(SealedProducts); }
public List <SealedProduct> Get() { List <SealedProduct> AllSealedProducts = new List <SealedProduct>(); List <SealedProductDTO> SealedProductDTOs = new List <SealedProductDTO>(); SealedProductDataController SealedProductDataController = new SealedProductDataController(); SealedProductDTOs = SealedProductDataController.GetAllSealedProducts(); foreach (var Product in SealedProductDTOs) { SealedProduct FoundProduct = new SealedProduct { SealedProductID = Product.SealedProductID, SetID = Product.SetID, SealedProductName = Product.SealedProductName, Price = Product.Price }; AllSealedProducts.Add(FoundProduct); } return(AllSealedProducts); }