public async void LoadPayrolls() { List <PayrollModel> payrollList = await _payrollEndpoint.GetAll(); payrollList.Sort((x, y) => (x.Prezime).CompareTo(y.Prezime)); Employees = await _employeeEndpoint.GetAll(); PayrollSum.Prezime = "UKUPNO:"; PayrollSum.Bruto = payrollList.Sum(x => x.Bruto); PayrollSum.Mio1 = payrollList.Sum(x => x.Mio1); PayrollSum.Mio2 = payrollList.Sum(x => x.Mio2); PayrollSum.Odbitak = payrollList.Sum(x => x.Odbitak); PayrollSum.PoreznaOsnovica = payrollList.Sum(x => x.PoreznaOsnovica); PayrollSum.PoreznaStopa1 = payrollList.Sum(x => x.PoreznaStopa1); PayrollSum.PoreznaStopa2 = payrollList.Sum(x => x.PoreznaStopa2); PayrollSum.Prirez = payrollList.Sum(x => x.Prirez); PayrollSum.UkupnoPorez = payrollList.Sum(x => x.UkupnoPorez); PayrollSum.UkupnoPorezPrirez = payrollList.Sum(x => x.UkupnoPorezPrirez); PayrollSum.DoprinosZdravstvo = payrollList.Sum(x => x.DoprinosZdravstvo); PayrollSum.Dohodak = payrollList.Sum(x => x.Dohodak); PayrollSum.Neto = payrollList.Sum(x => x.Neto); payrollList.Add(PayrollSum); Payrolls = new ObservableCollection <PayrollModel>(payrollList); _payrollsView = CollectionViewSource.GetDefaultView(Payrolls); _payrollsView.Filter = o => string.IsNullOrEmpty(FilterPayroll) ? true : ((PayrollModel)o).Prezime.ToLower().Contains(FilterPayroll.ToLower()); }
public async void LoadPayrolls() { var payrollList = await _payrollEndpoint.GetAll(); var cPayrollList = _mapper.Map <List <PayrollArchivePayrollModel> >(payrollList); PayrollCalculations = new ObservableCollection <PayrollArchivePayrollModel>(cPayrollList); LoadPayrollsFilter(); }