Esempio n. 1
0
        public ActionResult AppointmentResponse(AppointmentResponseModel model)
        {
            var details = db.Appointment.FirstOrDefault(x => x.Id == model.Id);

            if (details == null)
            {
                return(HttpNotFound());
            }

            if (ModelState.IsValid)
            {
                // Update the appointment status.
                details.Accepted = model.Accepted;


                // Create a repsonse mail.
                //var mail = new AppointmentRepsonseMail
                //               {
                //                   Appointment = appointment,
                //                   Notes = model.Notes,
                //                   FromCounseler = Counseler != null
                //               };
                //_mailHelper.SendAppointmentResponseMail(mail);

                return(RedirectToAction("", ""));
            }

            model.Appointment = details;
            return(View(model));
        }
        public ActionResult AppointmentResponse(AppointmentResponseModel model)
        {
            var appointment = _appointmentRepository.GetById(model.Id);

            if (appointment == null)
            {
                return(HttpNotFound());
            }

            if (ModelState.IsValid)
            {
                // Update the appointment status.
                appointment.Accepted = model.Accepted;
                _appointmentRepository.Update(appointment);

                // Create a repsonse mail.
                var mail = new AppointmentRepsonseMail
                {
                    Appointment   = appointment,
                    Notes         = model.Notes,
                    FromCounseler = Counseler != null
                };
                _mailHelper.SendAppointmentResponseMail(mail);

                return(RedirectToDashboard());
            }

            model.Appointment = appointment;
            return(View(model));
        }
        private async void LoadUpcomingAppointment(int ListType, string Keyword)
        {
            try
            {
                _objAppointmentRequestModel.Key      = Keyword;
                _objAppointmentRequestModel.UserId   = Settings.Id;
                _objAppointmentRequestModel.ListType = ListType;
                _objHeaderModel.OTPToken             = Settings.TokenCode;
                await Navigation.PushPopupAsync(new LoadingPopPage());

                _objAppointmentResponseModel = await _apiServices.LoadAppointmentListAsync(new Get_API_Url().AppointmentListApi(_baseUrl), true, _objHeaderModel, _objAppointmentRequestModel);

                var Result = _objAppointmentResponseModel.Response;
                if (Result.StatusCode == 200)
                {
                    if (Result.AppointmentList.Count > 0)
                    {
                        if (ListType == 1)
                        {
                            listUpcomingAppointment.IsVisible   = true;
                            listPastAppointment.IsVisible       = false;
                            GridPastAppt.IsVisible              = false;
                            listUpcomingAppointment.ItemsSource = Result.AppointmentList;
                        }
                        else
                        {
                            listPastAppointment.IsVisible     = true;
                            listUpcomingAppointment.IsVisible = false;
                            GridPastAppt.IsVisible            = true;
                            listPastAppointment.ItemsSource   = Result.AppointmentList;
                        }
                        //listUpcomingAppointment.ItemsSource = Result.AppointmentList;
                        // DependencyService.Get<IToast>().ShowToast(Result.Message);
                        await Navigation.PopAllPopupAsync();
                    }
                    else
                    {
                        DependencyService.Get <IToast>().ShowToast("No Data To Display!");
                        listUpcomingAppointment.ItemsSource = null;
                        listPastAppointment.ItemsSource     = null;
                        await Navigation.PopAllPopupAsync();
                    }
                }
                else
                {
                    DependencyService.Get <IToast>().ShowToast(Result.Message);
                    await Navigation.PopAllPopupAsync();
                }
            }
            catch (Exception ex)
            {
                await Navigation.PopAllPopupAsync();

                var msg = ex.Message;
            }
        }
 public AppointmentPage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _apiServices = new RestApi();
     _baseUrl     = Settings.Url + Domain.AppointmentApiConstant;
     _objAppointmentResponseModel = new AppointmentResponseModel();
     _objAppointmentRequestModel  = new AppointmentRequestModel();
     _objHeaderModel = new HeaderModel();
     LoadUpcomingAppointment(1, string.Empty);
 }
Esempio n. 5
0
 public HomePage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _apiServices                  = new RestApi();
     _baseUrl                      = Settings.Url + Domain.AppointmentApiConstant;
     _baseUrlPrescription          = Settings.Url + Domain.PrescriptionApiConstant;
     _baseUrlReports               = Settings.Url + Domain.ReportApiConstant;
     _objAppointmentResponseModel  = new AppointmentResponseModel();
     _objAppointmentRequestModel   = new AppointmentRequestModel();
     _objPrescriptionRequestModel  = new PrescriptionRequestModel();
     _objPrescriptionResponseModel = new PrescriptionResponseModel();
     _objReportRequestModel        = new ReportRequestModel();
     _objReportResponseModel       = new ReportResponseModel();
     _objHeaderModel               = new HeaderModel();
     //App.DetailPage = this;
     _objHeaderModel.OTPToken = Settings.TokenCode;
 }
Esempio n. 6
0
        //public ActionResult Details(int id)
        //{
        //    // Get the appointment by its id.
        //    var appointment = _appointmentRepository.GetById(id);
        //    if (appointment == null)
        //    {
        //        return HttpNotFound();
        //    }

        //    if (!AuthorizeAppointment(appointment))
        //    {
        //        return new HttpUnauthorizedResult();
        //    }

        //    ViewBag.IsCounseler = Counseler != null;

        //    return View(appointment);
        //}
        public ActionResult AppointmentResponse(int id)
        {
            // Student or counseler wants to respond on the appointment request.
            //var appointment = _appointmentRepository.GetById(id);
            var appointment = db.Appointment.FirstOrDefault(x => x.Id == id);

            if (appointment == null)
            {
                return(HttpNotFound());
            }

            var model = new AppointmentResponseModel
            {
                Appointment     = appointment,
                Accepted        = true,
                AlreadyAccepted = appointment.Accepted
            };

            return(View(model));
        }
Esempio n. 7
0
        private async void LoadUpcomingAppointment(int ListType, string Keyword)
        {
            try
            {
                _objAppointmentRequestModel.Key      = Keyword;
                _objAppointmentRequestModel.UserId   = Settings.Id;
                _objAppointmentRequestModel.ListType = ListType;
                _objHeaderModel.OTPToken             = Settings.TokenCode;
                _objAppointmentResponseModel         = await _apiServices.LoadAppointmentListAsync(new Get_API_Url().AppointmentListApi(_baseUrl), true, _objHeaderModel, _objAppointmentRequestModel);

                var Result = _objAppointmentResponseModel.Response;
                if (Result.StatusCode == 200)
                {
                    //listUpcomingAppointment.ItemsSource = Result.AppointmentList;
                    var result = Result.AppointmentList.FirstOrDefault() as AppointmentList;
                    if (result != null)
                    {
                        Appointmentdate.Text   = result.AppointmentDate + ",";
                        AppointmentTme.Text    = result.AppointmentTime;
                        lblreason4Visit.Text   = result.ReasonForVisit;
                        LableHospitalName.Text = result.HospitalName;
                    }
                    // DocProfilePic.Source = result.DoctorProfilePic;

                    //  DependencyService.Get<IToast>().ShowToast(Result.Message);
                }
                else
                {
                    DependencyService.Get <IToast>().ShowToast(Result.Message);
                    //  await Navigation.PopAllPopupAsync();
                }
            }
            catch (Exception ex)
            {
                //await Navigation.PopAllPopupAsync();
                var msg = ex.Message;
            }
        }
        public ActionResult AppointmentResponse(int id)
        {
            // Student or counseler wants to respond on the appointment request.
            var appointment = _appointmentRepository.GetById(id);

            if (appointment == null)
            {
                return(HttpNotFound());
            }

            if (!AuthorizeAppointment(appointment))
            {
                return(new HttpUnauthorizedResult());
            }

            var model = new AppointmentResponseModel
            {
                Appointment     = appointment,
                Accepted        = true,
                AlreadyAccepted = appointment.Accepted
            };

            return(View(model));
        }