Пример #1
0
        private void PerformSearch(string searchtext)
        {
            CountryListView.BeginRefresh();

            CountryListView.ItemsSource = string.IsNullOrEmpty(searchtext) ? vm.ItemsSource : vm.ItemsSource.Where(x => x.Name.ToLower().Contains(searchtext.ToLower()));
            CountryListView.EndRefresh();
        }
Пример #2
0
        private async void Form1_Shown(object sender, EventArgs e)
        {
            await Operations.GetCountries();

            CountryListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            CountryListView.FocusedItem       = CountryListView.Items[0];
            CountryListView.Items[0].Selected = true;

            ActiveControl = CountryListView;
        }
Пример #3
0
        //
        // GET: /Admin/Country/

        public ViewResult Index(CountryListView model)
        {
            if (model.page < 1)
            {
                model.page = 1;
            }

            IEnumerable <Country> Countries = db.IssuingCountries;

            if (model.onlyActive == true)
            {
                Countries = Countries.Where(c => c.active == true);
            }
            if (model.detailContains != "" && model.detailContains != null)
            {
                Countries = Countries.Where(c => c.Detail.ToLower().Contains(model.detailContains.ToLower().ToString()));
            }
            model.Countries = Countries.OrderBy(c => c.Detail).ToPagedList(model.page, Int32.Parse(ConfigurationManager.AppSettings["pageSize"]));
            return(View(model));
        }
Пример #4
0
        public List <CountryListView> Search(string search)
        {
            LoyaltyProgramContext db = new LoyaltyProgramContext();

            try
            {
                CountryList = new List <CountryListView>();
                var countries = new List <Country>();
                if (search == null)
                {
                    countries = db.Country.ToList();
                }
                else
                {
                    countries = db.Country.Where(x => x.Name.Contains(search)).ToList();
                }
                foreach (var item in countries)
                {
                    CountryListView country = new CountryListView();
                    country.CountryID     = item.CountryID;
                    country.Name          = item.Name;
                    country.IsDeactivated = item.IsDeactivated;
                    country.CreatedOn     = item.CreatedOn;
                    country.ModifiedOn    = item.ModifiedOn;
                    CountryList.Add(country);
                }
                return(CountryList);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                db.Dispose();
            }
            return(null);
        }
Пример #5
0
        private void CountryPanel(object sender, RoutedEventArgs e)
        {
            CountryListView view = new CountryListView(this);

            view.ShowDialog();
        }
Пример #6
0
        private void CountryPanel(object sender, RoutedEventArgs e)
        {
            CountryListView countryView = new CountryListView(_factory);

            countryView.Show();
        }