コード例 #1
0
        public ActionResult CancelAppointment(CancelAppointmentViewModel model)
        {
            try
            {
                var authInfo = (AuthInfo)Session["auth_info"];
                if (authInfo == null)
                {
                    return(Json(new KeyValueResult(false, "Your session has expired. Please signin again."), JsonRequestBehavior.AllowGet));
                }
                var data = new CancelAppoinmentModel
                {
                    AppointmentId = model.AppointmentId,
                    DoctorName    = model.DoctorName,
                    ClinicName    = authInfo.CurrentSelectedClinic.ClinicName,
                    ClinicPhone   = authInfo.CurrentSelectedClinic.Phone,
                    Patient       = new PatientCreateAppointmentModel
                    {
                        FirstName = model.PatientFirstName,
                        LastName  = model.PatientLastName,
                        Phone     = model.PatientPhone,
                        Email     = model.PatientEmail
                    },
                    ExpectedStartDateTime = model.ExpectedStartDateTime,
                };

                _appointmentService.CancelAppointment(data);
                return(Json(new KeyValueResult(true, "Welio appointment successfully canceled."), JsonRequestBehavior.AllowGet));
            }
            catch (ApiException ex)
            {
                return(Json(new KeyValueResult(false, ex.Message), JsonRequestBehavior.AllowGet));
            }
        }
コード例 #2
0
        public void CancelAppointment(CancelAppoinmentModel model)
        {
            var url = ApiUrl.Default.RootApi + ApiUrl.Default.CancelAppointment;

            Restful.Post(url, null, model);
        }