internal void Refresh(Filter tag) { switch (tag.FilterField) { case "0": { AllSaldos = AllSaldoss.Where(e => e[0].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "1": { AllSaldos = AllSaldoss.Where(e => e[1].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "2": { AllSaldos = AllSaldoss.Where(e => e[2].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "3": { AllSaldos = AllSaldoss.Where(e => e[3].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "4": { AllSaldos = AllSaldoss.Where(e => e[4].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "5": { AllSaldos = AllSaldoss.Where(e => e[5].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "6": { AllSaldos = AllSaldoss.Where(e => e[6].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "7": { AllSaldos = AllSaldoss.Where(e => e[7].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; case "8": { AllSaldos = AllSaldoss.Where(e => e[8].Contains(tag.FilterWord)).ToList(); FetchCount(); CurrentPage = 1; FetchRange(0, pagesize); } break; } }
private void GetValue(AccountsModel accountsModel) { Title = string.Format("Начални аналитични салда на сметка {0}", accountsModel); string sumalvk, sumalvd, sumalvksub, sumalvdsub; this.accountsModel = accountsModel; AllSaldoss = Context.GetAllMovementsDetails(accountsModel.Id, accountsModel.Num, accountsModel.FirmaId, out sumalvk, out sumalvd, out sumalvdsub, out sumalvksub); if (AllSaldoss != null && AllSaldoss.Count > 0) { var _reportItems = new List <ReportItem>(); int k = 0; foreach (var item in AllSaldoss[0]) { if (k <= 1) { _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = item, Width = 30, IsSuma = true, Sborno = true }); } else { _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = item, Width = 30 }); } k++; } ReportItems = _reportItems; Titles = new ObservableCollection <string>(AllSaldoss[0]); AllSaldoss.Remove(AllSaldoss[0]); Filters = new ObservableCollection <Filter>(); var i = 0; foreach (var item in Titles) { var fil = new Filter(); fil.FilterName = item; fil.FilterField = i.ToString(); Filters.Add(fil); i++; } } else { var _reportItems = new List <ReportItem>(); this.ReportItems = _reportItems; } AllSaldos = new List <List <string> >(AllSaldoss); SumaLvD = sumalvd; SumaLvK = sumalvk; string sumavd, sumavk, sumakd, sumakk; Context.GetAllMovementsSalosVK(accountsModel.Id, out sumalvk, out sumalvd, out sumavd, out sumavk, out sumakd, out sumakk); SumaKD = sumakd; SumaKK = sumakk; SumaVD = sumavd; SumaVK = sumavk; decimal test = 0; accountsModel.SubSaldoDL = decimal.TryParse(sumalvdsub, out test)?test:0; accountsModel.SubSaldoKL = decimal.TryParse(sumalvksub, out test)?test:0; Contents = new ObservableCollection <ObservableCollection <string> >(); SetPager(); }