Пример #1
0
        private async Task Refresh()
        {
            if (IsSearched && !String.IsNullOrWhiteSpace(_patientNumber))
            {
                using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
                {
                    try
                    {
                        Record = await ViewModel.GetPersonDetialsByAccountNoAsync(_patientNumber);
                    }
                    catch
                    {
                        await DisplayAlert("Refresh List", Constants.ErrorMsgSorry, "OK");
                    }

                    if (Record != null)
                    {
                        if (Record.Success)
                        {
                            eSearch.Unfocus();

                            if (Record.Patient.Forms.Count > 0)
                            {
                                listPatientDeatils.ItemsSource = Record.Patient.Forms;
                                stkTop.IsVisible = true;

                                // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                stkSelectAllForms.IsVisible = true;

                                Settings.SetVisitId(Record.Patient.VisitId);

                                Settings.SetFormsList(Record.Patient.Forms);
                                string accountNumber = eSearch.Text;
                                string accNumber     = Convert.ToString(eSearch.Text);

                                Settings.SetAccoiuntNumber(accNumber);

                                IsSearched = true;

                                if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                                {
                                    Application.Current.MainPage = new NavigationPage(new MainViewsMasters());
                                }
                                else
                                {
                                    await Navigation.PopAsync();

                                    await Navigation.PushAsync(new MainViewsMasters());
                                }
                            }
                            else
                            {
                                // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                IsSearched = false;

                                stkTop.IsVisible = false;

                                // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                stkSelectAllForms.IsVisible = false;

                                List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                                Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                                F.Name = "No Record Found";

                                listF.Add(F);

                                listPatientDeatils.ItemsSource = listF;
                            }
                        }
                        else
                        {
                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            IsSearched       = false;
                            stkTop.IsVisible = false;

                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            stkSelectAllForms.IsVisible = false;

                            List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                            Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                            F.Name = "No Record Found";

                            listF.Add(F);

                            listPatientDeatils.ItemsSource = listF;
                        }
                    }

                    if (Record.Success)
                    {
                        UpdatePatientProperties();
                    }

                    listPatientDeatils.IsVisible = true;

                    // THIS DIDN'T EXIST IN SLIDER
                    stkSelectAllForms.IsVisible = true;

                    stkSearch.IsVisible = false;
                    eSearch.Text        = "";
                }
            }
        }
Пример #2
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            try {
                IsAnyFormSelected();
                if (App.IsLoggedInFirstTime)
                {
                    Device.BeginInvokeOnMainThread((Action)(async() => {
                        await OnScan();
                    }));

                    return;
                }
                else
                {
                    App.IsLoggedInFirstTime = false;
                }

                stkTop.IsVisible             = false;
                stkForms.IsVisible           = false;
                listPatientDeatils.IsVisible = false;
                stkSelectAllForms.IsVisible  = false;


                if (IsSearched && Record != null)
                {
                    using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
                    {
                        Record = await ViewModel.GetPersonDetialsByAccountNoAsync(_patientNumber);

                        stkTop.IsVisible             = true;
                        listPatientDeatils.IsVisible = true;
                        stkSelectAllForms.IsVisible  = true;
                        if (Record != null && Record.Success)
                        {
                            stkSelectAllForms.IsVisible    = true;
                            listPatientDeatils.ItemsSource = Record.Patient.Forms;
                            foreach (var item in Record.Patient.Forms)
                            {
                                item.UnShow = "checkbox.png";
                            }

                            if (_listOfFormsToBeProcessed != null)
                            {
                                _listOfFormsToBeProcessed.Clear();
                            }
                        }
                        else
                        {
                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            IsSearched = false;

                            stkTop.IsVisible = false;
                            List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                            Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                            F.Name = "No Record Found";
                            stkSelectAllForms.IsVisible = false;
                            listF.Add(F);

                            listPatientDeatils.ItemsSource = listF;
                        }

                        //IsSearched
                        if (Record.Success)
                        {
                            UpdatePatientProperties();
                        }

                        stkSearch.IsVisible = false;
                        eSearch.Text        = String.Empty;
                    }
                }
                else
                {
                    stkSearch.IsVisible = true;
                }



                if (App.IsFormsAdded)
                {
                    using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
                    {
                        try
                        {
                            if (MainView._patientNumber != null)
                            {
                                Record = await ViewModel.GetPersonDetialsByAccountNoAsync(MainView._patientNumber);
                            }
                        }
                        catch
                        {
                            await DisplayAlert(Constants.ErrorMsgTitleOops, Constants.ErrorMsgSorry, "OK");
                        }

                        if (Record != null)
                        {
                            if (Record.Success)
                            {
                                if (Record.Patient.Forms.Count > 0)
                                {
                                    listPatientDeatils.ItemsSource = Record.Patient.Forms;

                                    foreach (var item in Record.Patient.Forms)
                                    {
                                        item.UnShow = "checkbox.png";
                                    }

                                    if (_listOfFormsToBeProcessed != null)
                                    {
                                        _listOfFormsToBeProcessed.Clear();
                                    }


                                    stkTop.IsVisible = true;

                                    // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                    stkSelectAllForms.IsVisible = true;

                                    Settings.SetVisitId(Record.Patient.VisitId);

                                    Settings.SetFormsList(Record.Patient.Forms);
                                    string accountNumber = eSearch.Text;
                                    string accNumber     = Convert.ToString(MainView._patientNumber);

                                    Settings.SetAccoiuntNumber(accNumber);
                                    stkSelectAllForms.IsVisible = true;
                                    IsSearched       = true;
                                    App.IsFormsAdded = false;
                                }
                                else
                                {
                                    // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                    IsSearched = false;

                                    stkTop.IsVisible = false;

                                    // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                    stkSelectAllForms.IsVisible = false;

                                    List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                                    Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                                    F.Name = "No Record Found";
                                    stkSelectAllForms.IsVisible = false;
                                    App.IsFormsAdded            = false;
                                    listF.Add(F);

                                    listPatientDeatils.ItemsSource = listF;
                                }
                            }
                            else
                            {
                                // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                IsSearched = false;

                                stkTop.IsVisible = false;

                                // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                stkSelectAllForms.IsVisible = false;

                                List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                                Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                                F.Name = "No Record Found";
                                stkSelectAllForms.IsVisible = false;
                                listF.Add(F);

                                listPatientDeatils.ItemsSource = listF;
                                App.IsFormsAdded = false;
                            }
                        }

                        if (Record.Success)
                        {
                            UpdatePatientProperties();
                        }

                        listPatientDeatils.IsVisible = true;

                        // THIS DID NOT EXIST IN SLIDER


                        stkSearch.IsVisible = false;
                        eSearch.Text        = "";
                    }
                }
            }
            catch (Exception ex) {
                var innerMsg = (null == ex.InnerException) ? String.Empty : ex.InnerException.Message;
                var msg      = $"Exception in MainView.xaml.cs --> OnAppearing(). Exception: {ex.Message}{Environment.NewLine} Inner Exception: {innerMsg}";
                Debug.WriteLine(msg);
            }
        }
Пример #3
0
        async void OnScan(object sender, EventArgs e)
        {
            var options = ConfigureMobileScannerOptions();

            // Get the scanPage
            var scanPage = ConfigureScanPageForScanner(options);

            scanPage.OnScanResult += (result) => {
                scanPage.IsScanning = false;

                Device.BeginInvokeOnMainThread((Action)(async() => {
                    await Navigation.PopAsync();

                    if (result != null)
                    {
                        using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
                        {
                            try
                            {
                                _patientNumber = result.Text;
                                Record = await ViewModel.GetPersonDetialsByAccountNoAsync(result.Text);
                            }
                            catch
                            {
                                await DisplayAlert(Constants.ErrorMsgTitleOops, Constants.ErrorMsgSorry, "OK");
                            }

                            if (Record != null)
                            {
                                if (Record.Success)
                                {
                                    listPatientDeatils.ItemsSource = Record.Patient.Forms;
                                    stkTop.IsVisible = true;
                                    stkSelectAllForms.IsVisible = true;
                                    Settings.SetVisitId(Record.Patient.VisitId);
                                    IsSearched = true;
                                }
                                else
                                {
                                    IsSearched = false;
                                    stkTop.IsVisible = false;
                                    List <Domain.Models.ResponseModels.FormModel> listF =
                                        new List <Domain.Models.ResponseModels.FormModel>();
                                    Domain.Models.ResponseModels.FormModel F =
                                        new Domain.Models.ResponseModels.FormModel();

                                    stkSelectAllForms.IsVisible = false;
                                    F.Name = "No Record Found";
                                    listF.Add(F);
                                    listPatientDeatils.ItemsSource = listF;
                                }
                            }

                            if (Record.Success)
                            {
                                UpdatePatientProperties();
                            }

                            listPatientDeatils.IsVisible = true;


                            stkSearch.IsVisible = false;
                            eSearch.Text = "";
                        }
                    }
                }));
            };

            // Navigate to our scanner page
            await Navigation.PushAsync(scanPage);
        }
Пример #4
0
        async Task OnScan()
        {
            var options = ConfigureMobileScannerOptions();

            // Get the scanPage
            var scanPage = ConfigureScanPageForScanner(options);

            scanPage.OnScanResult += (result) => {
                scanPage.IsScanning = false;

                Device.BeginInvokeOnMainThread((Action)(async() => {
                    await Navigation.PopAsync();

                    if (result != null)
                    {
                        using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
                        {
                            try
                            {
                                _patientNumber = result.Text;
                                Record = await ViewModel.GetPersonDetialsByAccountNoAsync(result.Text);
                            }
                            catch
                            {
                                await DisplayAlert(Constants.ErrorMsgTitleOops, Constants.ErrorMsgSorry, "OK");
                            }

                            if (Record != null)
                            {
                                if (Record.Success)
                                {
                                    listPatientDeatils.ItemsSource = Record.Patient.Forms;
                                    stkTop.IsVisible = true;
                                    stkSelectAllForms.IsVisible = true;
                                    // WEDNESDAY - MERGE SLIDER --****************** THIS WAS REMOVED FROM CURRENT AND EXISTED IN SLIDER
                                    //stkSelectAllForms.IsVisible = true;

                                    Settings.SetVisitId(Record.Patient.VisitId);
                                    IsSearched = true;
                                }
                                else
                                {
                                    // WEDNESDAY - MERGE SLIDER --****************** THIS WAS REMOVED FROM CURRENT AND EXISTED IN SLIDER
                                    IsSearched = false;
                                    stkSelectAllForms.IsVisible = false;
                                    stkTop.IsVisible = false;

                                    // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                                    stkSelectAllForms.IsVisible = false;
                                    List <Domain.Models.ResponseModels.FormModel> listF =
                                        new List <Domain.Models.ResponseModels.FormModel>();

                                    Domain.Models.ResponseModels.FormModel F =
                                        new Domain.Models.ResponseModels.FormModel();

                                    F.Name = "No Record Found";
                                    listF.Add(F);
                                    listPatientDeatils.ItemsSource = listF;
                                }
                            }
                            if (Record.Success)
                            {
                                UpdatePatientProperties();
                            }

                            listPatientDeatils.IsVisible = true;

                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN *** SLIDER


                            stkSearch.IsVisible = false;
                            eSearch.Text = "";
                        }
                    }
                }));
            };

            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
            App.IsLoggedInFirstTime = false;

            // Navigate to our scanner page
            Device.BeginInvokeOnMainThread((Action)(async() => {
                // THIS WAS CONFIGURE AWAIT (FALSE) IN SLIDER
                await Navigation.PushAsync(scanPage).ConfigureAwait(true);
            }));
        }
Пример #5
0
        //
        // ***************************** SEARCH *****************************
        //
        private async void OnBtnSearchClicked(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(eSearch?.Text))
            {
                await DisplayAlert("Search", "Enter an Account Number on which to search.", "OK");

                return;
            }

            using (UserDialogs.Instance.Loading("Loading", null, null, true, MaskType.Black))
            {
                try {
                    Record = await ViewModel.GetPersonDetialsByAccountNoAsync(eSearch.Text);

                    _patientNumber = eSearch.Text;
                }
                catch {
                    await DisplayAlert(Constants.ErrorMsgTitleOops, Constants.ErrorMsgSorry, "OK");
                }

                if (Record != null)
                {
                    if (Record.Success)
                    {
                        eSearch.Unfocus();

                        if (Record.Patient.Forms.Count > 0)
                        {
                            listPatientDeatils.ItemsSource = Record.Patient.Forms;//   Record.Patient.Forms;

                            // stkSelectAllForms.IsVisible = true;
                            // stkTop.IsVisible = true;

                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            // stkSelectAllForms.IsVisible = true;
                            Settings.SetVisitId(Record.Patient.VisitId);

                            Settings.SetFormsList(Record.Patient.Forms);
                            string accountNumber = eSearch.Text;
                            string accNumber     = Convert.ToString(eSearch.Text);

                            Settings.SetAccoiuntNumber(accNumber);

                            // toggle searched flag which is used to assist in control flow.
                            IsSearched = true;

                            //Application.Current.MainPage = new NavigationPage(new MainViewsMasters());

                            if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                            {
                                Application.Current.MainPage = new NavigationPage(new MainViewsMasters());
                            }
                            else
                            {
                                await Navigation.PopAsync();

                                await Navigation.PushAsync(new MainViewsMasters());
                            }
                        }
                        else
                        {
                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            //IsSearched = false;
                            stkSelectAllForms.IsVisible = false;
                            stkTop.IsVisible            = false;
                            IsSearched = false;

                            // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                            //stkSelectAllForms.IsVisible = false;

                            List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                            Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                            F.Name = "No Record Found";

                            listF.Add(F);

                            listPatientDeatils.ItemsSource = listF;
                            await DisplayAlert("Message", "No Record Found", "ok");

                            if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                            {
                                Application.Current.MainPage = new NavigationPage(new MainViewsMasters());
                            }
                            else
                            {
                                await Navigation.PopAsync();

                                await Navigation.PushAsync(new MainViewsMasters());
                            }
                        }
                    }
                    else
                    {
                        // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                        //IsSearched = false;

                        stkTop.IsVisible = false;

                        // WEDNESDAY - MERGE SLIDER -- THIS WAS REMOVED IN VERSION IN TFS
                        stkSelectAllForms.IsVisible = false;
                        List <Domain.Models.ResponseModels.FormModel> listF = new List <Domain.Models.ResponseModels.FormModel>();
                        Domain.Models.ResponseModels.FormModel        F     = new Domain.Models.ResponseModels.FormModel();
                        stkSelectAllForms.IsVisible = false;
                        F.Name     = "No Record Found";
                        IsSearched = false;
                        listF.Add(F);

                        listPatientDeatils.ItemsSource = listF;
                        await DisplayAlert("Message", "No Record Found", "ok");

                        if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                        {
                            Application.Current.MainPage = new NavigationPage(new MainViewsMasters());
                        }
                        else
                        {
                            await Navigation.PopAsync();

                            await Navigation.PushAsync(new MainViewsMasters());
                        }
                    }
                }
            }

            if (Record.Success)
            {
                UpdatePatientProperties();
            }

            listPatientDeatils.IsVisible = true;

            // WEDNESDAY - MERGE SLIDER -- THIS ******************* THIS DID NOT EXIST IN SLIDER SIDE   REMOVED IN VERSION IN TFS


            stkSearch.IsVisible = false;
            eSearch.Text        = "";
        }