public string DentalCare(string name, int procedureTime) { var animal = GetAnimal(name); dentalCare.DoService(animal, procedureTime); return($"{animal.Name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { CheckIfAnimalExist(name); dentalCare.DoService(hotel.Animals[name], procedureTime); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { DoesAnimalExistInHotel(name); var animal = this.hotel.Animals[name]; care.DoService(animal, procedureTime); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { IAnimal animal = CheckForAnimal(name); dentalCare.DoService(animal, procedureTime); string result = $"{name} had dental care procedure"; return(result); }
public string DentalCare(string name, int procedureTime) { var animal = GetAnimal(name); dentalCared.DoService(animal, procedureTime); this.dentalCared.ProcedureHistory.Add(animal); string result = $"{name} had dental care procedure"; return(result); }
public string DentalCare(string name, int procedureTime) { CheckIfAnimalExists(name); IAnimal animal = GetAnimal(name); dentalCare.DoService(animal, procedureTime); dentalCare.ProcedureHistory.Add(animal); return($"{animal.Name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (hotel.Animals.ContainsKey(name) == false) { throw new ArgumentException($"Animal {name} does not exist"); } IAnimal currentAnimal = hotel.Animals.FirstOrDefault(x => x.Key == name).Value; dentalCare.DoService(currentAnimal, procedureTime); return($"{currentAnimal.Name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { var animal = this.hotel .Animals .Values .First(x => x.Name == name); dentalCare.DoService(animal, procedureTime); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (!AnimalExists(name)) { throw new ArgumentException($"Animal {name} does not exist"); } IAnimal currentAnimal = hotel.Animals[name]; dentalCare.DoService(currentAnimal, procedureTime); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (!hotel.Animals.ContainsKey(name)) { throw new ArgumentException($"Animal {name} does not exist"); } var animal = hotel.Animals[name]; dental.DoService(animal, procedureTime); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { DentalCare dentalCare = new DentalCare(); var animal = this.hotel.Animals[name]; dentalCare.DoService(animal, procedureTime); this.proceduresAndItsAnimals["DentalCare"].Add(animal); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (!AnimalExists(name)) { throw new ArgumentException(string.Format(animalDoesntExistErrorMessage, name)); } var animal = this.hotel.Animals.FirstOrDefault(a => a.Key == name).Value; dentalCare.DoService(animal, procedureTime); return(string.Format(dentalCareMessage, name)); }
public string DentalCare(string name, int procedureTime) { IAnimal animal = GetAnimal(name, procedureTime); DentalCare dentalCare = new DentalCare(); dentalCare.DoService(animal, procedureTime); AddToHistory(dentalCare.GetType().Name, animal); string result = $"{animal.Name} had dental care procedure"; return(result); }
public string DentalCare(string name, int procedureTime) { if (IsExistInHotel(name)) { throw new ArgumentException($"Animal {name} does not exist"); } Procedure procedure = new DentalCare(); procedure.DoService(animalsInHotel[name], procedureTime); procedures.Add(procedure); string result = $"{name} had dental care procedure"; return(result); }
public string DentalCare(string name, int procedureTime) { CheckForAnimal(name); DentalCare dentalCare = new DentalCare(); Animal animal = hotel.Animals.Values.FirstOrDefault(x => x.Name == name); dentalCare.DoService(animal, procedureTime); if (!history.ContainsKey("DentalCare")) { history.Add("DentalCare", new List <Animal>()); } history["DentalCare"].Add(animal); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { string dental = "DentalCare"; CheckAnimalExist(name); DentalCare dentalCare = new DentalCare(); IAnimal animal = GetAnimal(name); dentalCare.DoService(animal, procedureTime); AddHistory(animal, dental); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (hotel.Animals.ContainsKey(name) == false) { throw new ArgumentException($"Animal {name} does not exist"); } var animal = hotel.Animals[name]; dentalCare.DoService(animal, procedureTime); dentalCare.ProcedureHistory.Add(animal); this.procedures.Add(dentalCare); return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { AnimalDoesntExist(name); IAnimal animal = TakeAnimal(name); IProcedure dentalCare = new DentalCare(); dentalCare.DoService(animal, procedureTime); AddTypeProcedure(dentalCare); return(string.Format( ConstantMessages.HadProcedure, animal.Name, "dental care")); }
public string DentalCare(string name, int procedureTime) { this.DoesExist(name); var animal = hotel.GetAnimal(name); if (this.procedures.Any(p => p.GetType().Name == "DentalCare")) { this.procedures.First(p => p.GetType().Name == "DentalCare") .DoService(animal, procedureTime); } else { Procedure procedure = new DentalCare(); procedure.DoService(animal, procedureTime); this.procedures.Add(procedure); } return($"{name} had dental care procedure"); }
public string DentalCare(string name, int procedureTime) { if (!this.hotel.Animals.ContainsKey(name)) { throw new ArgumentException($"Animal {name} does not exist"); } var animal = this.hotel.Animals.First(x => x.Value.Name == name).Value; if (this.procedures.Any(x => x.GetType() == typeof(DentalCare))) { this.procedures.First(x => x.GetType() == typeof(DentalCare)).DoService(animal, procedureTime); } else { var dentalCare = new DentalCare(); dentalCare.DoService(animal, procedureTime); this.procedures.Add(dentalCare); } return($"{animal.Name} had dental care procedure"); }