Пример #1
0
        internal async void Search(string text)
        {
            text = text.ToLower();

            LabResultList.Clear();
            if (String.IsNullOrEmpty(text))
            {
                var loader = await MaterialDialog.Instance.LoadingDialogAsync("Loading ..");
                await Initilize();

                await loader.DismissAsync();
            }
            else
            {
                PageNumber = 1;
                var mainList = SortAndFilter(CheckFilterIndex, SortedIndex, PageNumber, CalendarSelectedDates);
                var list     = mainList.Where(s => s.ASREF.ToLower().Contains(text) || s.ASBRCH.ToLower().Contains(text) || s.ASYEAR.ToLower().Contains(text) ||
                                              s.ASPATT.ToLower().Contains(text) || s.ASPATF.ToLower().Contains(text) || s.ASPATL.ToLower().Contains(text));
                list.ForEach(s => LabResultList.Add(s));
            };
        }
Пример #2
0
        public LabResultPageVM(INavigation _Nav)
        {
            Navigation = _Nav;

            CheckFilterIndex = -1;

            CalendarCommand = new DelegateCommand((s) =>
            {
                CalendarVisibility = true;
            });

            CheckFilterCommand = new DelegateCommand(async(s) =>
            {
                try
                {
                    var index = await ShowActionSheet("Filter", CheckReportsFilter.ToList());// await MaterialDialog.Instance.SelectActionAsync(CheckReportsFilter);
                    if (index >= 0)
                    {
                        LabResultList.Clear();
                        PageNumber       = 1;
                        CheckFilterIndex = index;
                        var list         = SortAndFilter(CheckFilterIndex, SortedIndex, PageNumber, CalendarSelectedDates);
                        list.ForEach(a => LabResultList.Add(a));
                        FilterLabelText = SetFilterLabelText(CheckFilterIndex, CalendarSelectedDates);
                    }
                }
                catch (Exception ex)
                {
                }
            });

            SortCommand = new DelegateCommand(async(s) =>
            {
                try
                {
                    var index = await ShowActionSheet("Sort", SortDatesFilter.ToList());// await MaterialDialog.Instance.SelectActionAsync(SortDatesFilter);
                    if (index >= 0)
                    {
                        LabResultList.Clear();
                        PageNumber  = 1;
                        SortedIndex = index;
                        var list    = SortAndFilter(CheckFilterIndex, SortedIndex, PageNumber, CalendarSelectedDates);
                        list.ForEach(a => LabResultList.Add(a));
                    }
                }
                catch (Exception ex)
                {
                }
            });

            FilterCommand = new DelegateCommand(async(s) =>
            {
                try
                {
                    LabResultList.Clear();
                    await Initilize();
                    PageNumber = 1;
                    var list   = SortAndFilter(CheckFilterIndex, SortedIndex, PageNumber, CalendarSelectedDates);
                    list.ForEach(a => LabResultList.Add(a));
                    CalendarVisibility = false;
                    FilterLabelText    = SetFilterLabelText(CheckFilterIndex, CalendarSelectedDates);
                }
                catch (Exception ex)
                {
                }
            });


            //CalendarSelectedDates.StartDate = DateTime.Now.AddMonths(2);
            //CalendarSelectedDates.EndDate = DateTime.Now;
        }