Example #1
0
        public ActionResult EditModalNew(string startDateStr, int startHour, string professionalId)
        {
            DateTime startDate        = DateTime.Parse(startDateStr);
            DateTime appointmentStart = startDate.AddHours(startHour);

            var appointment = new AppointmentForProUiDto(appointmentStart);

            appointment.DurationInMinutes = 60;
            appointment.Forename          = "";
            appointment.Surname           = "";
            appointment.TelephoneMobile   = "";

            AppointmentModalVm appointmentVm = new AppointmentModalVm(_companyQueries, User.Identity.GetUserId(), professionalId, appointment);

            return(PartialView("_editAppointmentPartial", appointmentVm));
        }
Example #2
0
        public ActionResult EditModal(Guid?id, string professionalId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            // Get the appointment for the professional.
            AppointmentForProUiDto appointment = _appointmentQueries.GetUiDto_AppointmentByIdForProfessionalOrEmployee(User.Identity.GetUserId(), professionalId, (Guid)id);

            if (appointment == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            AppointmentModalVm appointmentVm = new AppointmentModalVm(_companyQueries, User.Identity.GetUserId(), professionalId, appointment);

            return(PartialView("_editAppointmentPartial", appointmentVm));
        }