public static Doctor Update(Doctor doctor) { if (doctor == null) { throw new ArgumentException("doctor information was not provided"); } var query = SqlQueryGeneration.InsertDoctor(doctor); return(string.IsNullOrEmpty(query) ? doctor : _sqlManager.UpdateDoctor(query)); }
public static Guid Insert(Doctor doctor) { if (doctor == null) { throw new ArgumentException("doctor information was not provided"); } var query = SqlQueryGeneration.InsertDoctor(doctor); try { return(_sqlManager.InsertDoctor(query)); } catch (SqlException e) { //ToDo: Log Exception throw new Exception("Failed to insert Doctor", e); } }