Exemple #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));
        }
Exemple #2
0
 public AddDoctorResponse add(AddDoctorRequest request)
 {
     try
     {
         var response = new AddDoctorResponse();
         var bc       = new DoctorComponent();
         response.Result = bc.Add(request.Doctor);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Exemple #3
0
        public Doctor Add(Doctor doctor)
        {
            var model = bs.Add(doctor);

            return(model);
        }