public async Task <ActionResult> _list(int id = 0, string docname = null, DateTime?fromdate = null, DateTime?todate = null, int pagesize = 10, int page = 1) { int hospitalid = CareMeClient.Helper.CookieHelper.getstaffHospitalID(); if (fromdate != null && todate != null) { ViewBag.appDate = MyExtension.getLocalTime(DateTime.UtcNow); PagedListClient <ScheduleDoctorViewModel> result = await ScheduleApiRequestHelper.list(id, docname, fromdate, todate, pagesize, page, hospitalid); return(PartialView("_searchList", result)); } else { ViewBag.appDate = MyExtension.getLocalTime(DateTime.UtcNow); PagedListClient <ScheduleDoctorViewModel> result = await ScheduleApiRequestHelper.list(id, docname, fromdate, todate, pagesize, page, hospitalid); return(PartialView("_DoctorScheduleList", result)); } }
public async Task <ActionResult> _nextschedule(int docid = 0, int hospitalid = 0, DateTime?appDate = null, string Type = null) { hospitalid = CareMeClient.Helper.CookieHelper.getstaffHospitalID(); ViewBag.Type = Type; if (Type == "next") { ViewBag.appDate = appDate.Value.AddDays(7); ViewBag.doctorid = docid; ViewBag.hospitalid = hospitalid; } else if (Type == "prev") { ViewBag.appDate = appDate.Value.AddDays(-7); ViewBag.doctorid = docid; ViewBag.hospitalid = hospitalid; } List <tbScheduleData> result = await ScheduleApiRequestHelper.schedulebydoctorid(docid, hospitalid, appDate, Type); return(PartialView("_nextschedulelist", result)); }
public async Task <ActionResult> UpsertPatient(tbPatient patient, int doctorid = 0, string doctorname = null, DateTime?appdate = null, DateTime?fromtime = null, DateTime?totime = null, int scheduleid = 0, int hospitalID = 0) { PatientAppointmentViewModel shvm = new PatientAppointmentViewModel(); shvm.appointment = new tbAppointment(); shvm.appointment.DoctorId = doctorid; shvm.appointment.DoctorName = doctorname; string date = appdate.Value.ToShortDateString(); string fromtimedate = fromtime.Value.ToShortTimeString(); string appointmentdate = date + " " + fromtimedate; shvm.appointment.ScheduleDataID = scheduleid; shvm.appointment.AppointmentDateTime = DateTime.Parse(appointmentdate); shvm.appointment.HospitalId = hospitalID; //CareMeClient.Helper.CookieHelper.getstaffHospitalID(); // shvm.appointment.HospitalName = CareMeClient.Helper.CookieHelper.getstaffHospitalName(); shvm.patient = patient; PatientAppointmentViewModel result = await BookingApiRequestHelper.UpsertPatient(shvm); if (result != null) { BookingSuccessModel bsm = new BookingSuccessModel(); bsm.doctor = await DoctorApiRequestHelper.GetDoctorById(result.appointment.DoctorId ?? 0); bsm.hospital = await HospitalApiRequestHelper.GetHospitalById(result.appointment.HospitalId ?? 0); bsm.scheduleData = await ScheduleApiRequestHelper.getScheduleDetail(result.appointment.ScheduleDataID ?? 0); bsm.pavm = result; return(PartialView("_bookingSuccess", bsm)); } else { return(Json("Fail", JsonRequestBehavior.AllowGet)); } }