/// <summary>
        /// View doctor detail & schedule
        /// </summary>
        /// <param name="doctorId"></param>
        /// <returns></returns>
        public async Task <ActionResult> DoctorSchedule(string doctorId)
        {
            //get doctor
            var    token  = _userSession.BearerToken;
            string id     = doctorId;
            var    doctor = await GetDoctorDetail(id);

            if (doctor == null)
            {
                doctor = new DoctorProfileViewModel();
            }

            var model = new ScheduleUserViewModel();

            //get schedule of doctor
            var    userId         = doctor.UserId;
            var    start          = DateTime.Now;
            var    end            = DateTime.Now.AddDays(2);
            string apiUrlSchedule = APIProvider.APIGenerator(controllerSchedule, new List <string> {
                nameof(userId),
                nameof(start), nameof(end)
            }, true, userId, start.ToString("yyyy-MM-dd"), end.ToString("yyyy-MM-dd"));
            var schedule = await APIProvider.Authorize_Get <List <ScheduleViewModel> >(token, apiUrlSchedule, APIConstant.API_Resource_CORE);

            model.DoctorProfileViewModel = doctor;
            model.lstScheduleViewModel   = schedule;

            return(PartialView("_DoctorDetail", model));
        }
Esempio n. 2
0
 public ScheduleUserView()
 {
     InitializeComponent();
     this._viewModel     = new ScheduleUserViewModel();
     this.BindingContext = this._viewModel;
 }