Exemplo n.º 1
0
        public HttpResponseMessage AppointmentSchedule(HttpRequestMessage request, DateTime?datetime, string type = null, int hospitalid = 0)
        {
            AppointScheduleViewModel asvm   = new AppointScheduleViewModel();
            List <tbScheduleData>    result = null;

            if (type == null)
            {
                result = scheduledataRepo.Get().Where(a => a.IsDeleted != true & a.AppointmentDatetime.Value.Day == datetime.Value.Day && a.HospitalID == hospitalid).ToList();

                asvm.appointDatetime = datetime;
                asvm.scheduledatas   = result;
            }
            else if (type == "next")
            {
                DateTime nextDate = datetime.Value.AddDays(1);
                result = scheduledataRepo.Get().Where(a => a.IsDeleted != true & a.AppointmentDatetime.Value.Day == nextDate.Day && a.HospitalID == hospitalid).ToList();

                asvm.appointDatetime = nextDate;
                asvm.scheduledatas   = result;
            }
            else
            {
                DateTime prevDate = datetime.Value.AddDays(-1);
                result = scheduledataRepo.Get().Where(a => a.IsDeleted != true & a.AppointmentDatetime.Value.Day == prevDate.Day && a.HospitalID == hospitalid).ToList();

                asvm.appointDatetime = prevDate;
                asvm.scheduledatas   = result;
            }

            return(request.CreateResponse <AppointScheduleViewModel>(HttpStatusCode.OK, asvm));
        }
Exemplo n.º 2
0
        //Get Appointment Schcedule Time by Schedule Date(Previous and Next)
        public async Task <ActionResult> AppointmentSchedule(DateTime?datetime = null, string type = null)
        {
            int hospitalid = Helper.CookieHelper.getstaffHospitalID();
            //   List<tbScheduleData> result = await DoctorApiRequestHelper.AppointmentSchedule(datetime, type);
            AppointScheduleViewModel result = await BookingApiRequestHelper.AppointmentSchedule(datetime, type, hospitalid);

            return(PartialView("_scheduleTimeByDate", result));
        }