public int AddPart(int supplierID, string partNumber, string manufacturer) { Debug.WriteLine("Looking for supplier with id " + supplierID + " in repo from facade"); ISupplier supplier = supplierRepository.GetSupplier(supplierID); if (supplier == null) { Console.WriteLine("Supplier with entered ID not found"); return(-1); } IPart part = factory.CreatePart(partNumber, manufacturer, supplier); int id = partRepository.AddPart(part); Debug.WriteLine("Part with ID " + id + " added to repo from facade"); return(id); }
public int AddPart(int supplierID, string partNumber, string manufacturer) { Debug.WriteLine("Looking for supplier with id " + supplierID + " in repo from facade"); ISupplier supplier = supplierRepository.GetSupplier(supplierID); if (supplier == null) { Console.WriteLine("Supplier with entered ID not found"); return(-1); } IPart part = factory.CreatePart(partNumber, manufacturer, supplier); int id = partRepository.AddPart(part); string content = "We would like to place an order for part " + part.PartNumber + " manufacturer " + part.Manufacturer; mailSender.SendMail(supplier.Email, content); Debug.WriteLine("Part with ID " + id + " added to repo from facade"); return(id); }