public JsonResult PostData(Doctor doctor) { Doctor dataDoctor = new Doctor(); dataDoctor.Name = doctor.Name; dataDoctor.LastName = doctor.LastName; dataDoctor.Email = doctor.Email; dataDoctor.Phone = doctor.Phone; dataDoctor.BirthDate = doctor.BirthDate; dataDoctor.EnrollmentType = doctor.EnrollmentType; dataDoctor.EnrollmentNumber = doctor.EnrollmentNumber; dataDoctor.Specialty = doctor.Specialty; if (doctor.Id > 0) { dataDoctor.Id = doctor.Id; db.Update(dataDoctor); } else { db.Add(dataDoctor); } return(Json("success", JsonRequestBehavior.AllowGet)); }
public void delete(UpdateDoctorRequest request) { try { var response = new UpdateDoctorResponse(); var bc = new DoctorComponent(); bc.Update(request.Doctor); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public Doctor Update(Doctor doctor) { bs.Update(doctor); return(doctor); }