Ejemplo n.º 1
0
 public PrescriptionPage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _objHeaderModel          = new HeaderModel();
     _objHeaderModel.OTPToken = Settings.TokenCode;
     _baseUrl     = Settings.Url + Domain.PrescriptionApiConstant;
     _apiServices = new RestApi();
     _objPrescriptionRequestModel  = new PrescriptionRequestModel();
     _objPrescriptionResponseModel = new PrescriptionResponseModel();
     // App.DetailPage = this;
     LoadPrescription(string.Empty);
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
        public async void LoadPrescription(string Keyword)
        {
            try
            {
                // await Navigation.PushPopupAsync(new LoadingPopPage());
                _objPrescriptionRequestModel.key = Keyword;
                _objPrescriptionResponseModel    = await _apiServices.GetPrescriptionListAsync(new Get_API_Url().PrescriptionListApi(_baseUrlPrescription), true, _objHeaderModel, _objPrescriptionRequestModel);

                var Result = _objPrescriptionResponseModel.Response;
                if (Result.StatusCode == 200)
                {
                    // listprescriptionListByDoc.ItemsSource = Result.PrescriptionList;
                    var result = Result.PrescriptionList.FirstOrDefault() as PrescriptionList;
                    if (result != null)
                    {
                        ListPillsReminder.ItemsSource = result.TabletList;
                        pillremindertime.Text         = result.PrescriptionTime;
                    }

                    // LblAllergy.Text
                    // DependencyService.Get<IToast>().ShowToast(Result.Message);
                    // await Navigation.PopAllPopupAsync();
                }
                else
                {
                    DependencyService.Get <IToast>().ShowToast(Result.Message);
                    // await Navigation.PopAllPopupAsync();
                }
            }
            catch (Exception ex)
            {
                DependencyService.Get <IToast>().ShowToast("Something Went Wrong please try Again or check your Internet Connection!!");
                // await Navigation.PopAllPopupAsync();
                var msg = ex.Message;
            }
        }
Ejemplo n.º 4
0
        public async void LoadPrescription(string Keyword)
        {
            try
            {
                _objPrescriptionRequestModel.key = Keyword;
                await Navigation.PushPopupAsync(new LoadingPopPage());

                _objPrescriptionResponseModel = await _apiServices.GetPrescriptionListAsync(new Get_API_Url().PrescriptionListApi(_baseUrl), true, _objHeaderModel, _objPrescriptionRequestModel);

                var Result = _objPrescriptionResponseModel.Response;
                if (Result.StatusCode == 200)
                {
                    if (Result.PrescriptionList.Count > 0)
                    {
                        //var max = Result.PrescriptionList.Max(e => e.TabletList.Count);
                        //  var xyz = Result.PrescriptionList.SelectMany(e => e.TabletList);
                        // var i = 0;
                        foreach (var items in Result.PrescriptionList)
                        {
                            string concatTabName = null;
                            string concatTabTime = null;
                            items.HeightReq = (items.TabletList.Count * 15) + 100;

                            foreach (var value in items.TabletList)
                            {
                                //items.TabName = value.TabletName;
                                //items.tabTime = value.Repetaion;
                                //items.CompleteString += items.AveragePrice + "\n";
                                //  concatResult += + "\n";
                                //concatResult.Spans.Add(new Span { Text = value.TabletName,ForegroundColor=Color.Red, FontAttributes = FontAttributes.Bold });
                                //concatResult.Spans.Add(new Span { Text = value.Repetaion, ForegroundColor = Color.Blue, FontAttributes = FontAttributes.Bold });
                                //s += concatResult;
                                concatTabName += value.TabletName + "\n";
                                concatTabTime += value.Repetaion + "\n";
                            }
                            //  items.CompleteString = s;
                            items.TabName = concatTabName;
                            items.tabTime = concatTabTime;
                            //i++;
                        }

                        //foreach (var itm in Result.PrescriptionList)
                        //{
                        //    itm.HeightReq = max * 15 + 100;
                        //}
                        listprescriptionListByDoc.ItemsSource = Result.PrescriptionList;
                        // DependencyService.Get<IToast>().ShowToast(Result.Message);
                        await Navigation.PopAllPopupAsync();
                    }
                    else
                    {
                        DependencyService.Get <IToast>().ShowToast("No Data to Display!");
                        await Navigation.PopAllPopupAsync();
                    }
                }
                else
                {
                    DependencyService.Get <IToast>().ShowToast(Result.Message);
                    await Navigation.PopAllPopupAsync();
                }
            }
            catch (Exception ex)
            {
                DependencyService.Get <IToast>().ShowToast("Something Went Wrong please try Again or check your Internet Connection!!");
                await Navigation.PopAllPopupAsync();

                var msg = ex.Message;
            }
        }