public IActionResult DeleteAppointmentDate(int Id)
        {
            ResultModel resultModel = new ResultModel();

            if (Id != 0)
            {
                var appointmentDateData = _appointmentServices.GetAppointmentDateById(Id);
                _appointmentServices.DeleteAppointmentDate(appointmentDateData);
                resultModel.Status   = 1;
                resultModel.Message  = ValidationMessages.Success;
                resultModel.Response = "Appointmnet Date Deleted ";
                return(Ok(resultModel));
            }
            else
            {
                resultModel.Message  = ValidationMessages.Failure;
                resultModel.Status   = 0;
                resultModel.Response = "Appointment Date not found";
                return(Ok(resultModel));
            }
        }
Esempio n. 2
0
        public virtual IActionResult AppointmentDateDelete(int id, int AppointmentId)
        {
            //permissions
            if (SharedData.isAppointmentMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var appointment     = _appointmentServices.GetAppointmentById(AppointmentId);
                var appointmentDate = appointment.AppointmentDates.Where(a => a.Id == id).FirstOrDefault();
                if (appointment == null)
                {
                    //No product found with the specified id
                    return(RedirectToAction("List"));
                }

                if (appointment != null)
                {
                    _appointmentServices.DeleteAppointmentDate(appointmentDate);
                    responceModel.Success = true;
                    responceModel.Message = "Deleted.";
                    return(Json(responceModel));
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDelete";
                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                return(Json(responceModel));
            }
        }