Beispiel #1
0
        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));
        }
Beispiel #2
0
        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);
            }
        }