public void GetCityLimitsTable()
        {
            var _cityLimits = _sizeModel.GetCitiestLimit();
            var _cities     = _sizeModel.GetCitites();

            CitiesLimitss = new ObservableCollection <PeopleViewModel>(_cityLimits.Select(x => new PeopleViewModel {
                CitiesLimit = x, City = _cities.FirstOrDefault(y => y.Id == x.CityId && y.CityName == Citys.CityName)
            }));

            // CitiesLimitss = new ObservableCollection<PeopleViewModel>(_cityLimits.Select(x => new PeopleViewModel { CitiesLimit = x, City = _cities.FirstOrDefault(y => y.Id == x.CityId) }));
        }
        //public int Limitz
        //{ get { return CitysLimits.Limit; } }

        //public static ObservableCollection<CitiesLimit> Limitzz
        //{
        //    get
        //    {
        //        ApplicationContext context = new ApplicationContext();
        //        return new ObservableCollection<CitiesLimit>(context.CitiesLimits.Select(s => s).ToList());

        //    }
        //}
        public EditSizeOrderViewModel(People people)
        {
            _sizeModel = SizeModel.getInstance();
            People     = people.GetCopy();
            City       = _sizeModel.GetCitites();
            LimitsC    = _sizeModel.GetCitiestLimit();
            GetCityLimitsTable();
            OnPropertyChanged("Peoples");
            OnPropertyChanged("City");
            //OnPropertyChanged("CitiesLimitss");
            // OnPropertyChanged("Limitzz");
        }
Exemple #3
0
        void Update()
        {
            var _peoples = _sizemodel.GetPeoples();
            var _cities  = _sizemodel.GetCitites();
            var _limits  = _sizemodel.GetCitiestLimit();

            Peoples = new ObservableCollection <PeopleViewModel>(_peoples.Select(x => new PeopleViewModel {
                People = x, City = _cities.FirstOrDefault(y => y.Id == x.CityId)
            }));
            SelectedPeoples = Peoples.FirstOrDefault();
            Citys           = new ObservableCollection <Cities>(_cities);
            SelectedCitys   = Citys.FirstOrDefault();
            Limits          = new ObservableCollection <LimitViewModel>(_limits.Select(x => new LimitViewModel {
                Limit = x, City = _cities.FirstOrDefault(y => y.Id == x.CityId)
            }));
            OnPropertyChanged("Peoples");
            OnPropertyChanged("SelectedPeoples");
            OnPropertyChanged("Citys");
            OnPropertyChanged("Limits");
            OnPropertyChanged("SelectedLimit");
        }