Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public Doctor Update(Doctor doctor)
 {
     bs.Update(doctor);
     return(doctor);
 }