public int ProvideGarageService(int custID, int serviceID) { Debug.WriteLine("Looking for customer with id " + custID + " in repo from facade"); ICustomer customer = customerRepository.GetCustomer(custID); if (customer == null) { Console.WriteLine("Customer with entered ID not found"); return(-1); } Debug.WriteLine("Looking for garage service with id " + serviceID + " in repo from facade"); IGarageService service = garageServiceRepository.GetGarageService(serviceID); if (service == null) { Console.WriteLine("Service with entered ID not found"); return(-1); } provider.WaitingTimeInDays = 3; provider.ProvideGarageService(customer, service); string content = "Thank you for using our services. Your waiting time is " + provider.WaitingTimeInDays + " days."; mailSender.SendMail(customer.Email, content); return(0); }
public int ProvideGarageService(int custID, int serviceID) { Debug.WriteLine("Looking for customer with id " + custID + " in repo from facade"); ICustomer customer = customerRepository.GetCustomer(custID); if (customer == null) { Console.WriteLine("Customer with entered ID not found"); return(-1); } Debug.WriteLine("Looking for garage service with id " + serviceID + " in repo from facade"); IGarageService service = garageServiceRepository.GetGarageService(serviceID); if (service == null) { Console.WriteLine("Service with entered ID not found"); return(-1); } provider.WaitingTimeInDays = 3; provider.ProvideGarageService(customer, service); return(0); }