public bool Execute(int cityId, string cityName) { if (!gateway.LoadCity(cityId, out var c)) { return(false); } c.Name = cityName; gateway.UpdateCity(c); return(true); }
public bool Execute(string firstName, string lastName, DateTime birthDay, int birthCityId, out Employee e) { if (!gateway.LoadCity(birthCityId, out var birthCity)) { e = null; return(false); } e = new Employee(firstName, lastName, birthDay, birthCity); gateway.InsertEmployee(e); return(true); }
public bool Execute(int employeeId, string firstName, string lastName, DateTime birthDay, int birthCityId) { if (!gateway.LoadEmployee(employeeId, out var e)) { Error = "The employeeId is not existed"; return(false); } if (!gateway.LoadCity(birthCityId, out var c)) { Error = "The birthCityId is not existed"; return(false); } e.FirstName = firstName; e.LastName = lastName; e.BirthDay = birthDay; e.BirthCity = c; gateway.UpdateEmployee(e); return(true); }
public bool Execute(int cityId, out City c) { return(gateway.LoadCity(cityId, out c)); }