public IncomeViewModel(DBDataOperation myBd, Window w2) { bd = myBd; IncomeGuide = bd.GetALLINCOME_GUIDES(App.id); iNCOMEDate = DateTime.Now; iNCOMESize = "0"; iNCOMEDate2 = DateTime.Now; iNCOMEDate1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, App.id); IncomeDataGrid = bd.GetALLINCOMESSELECT(iNCOMEDate1, iNCOMEDate2, App.id); w = w2; double r = 0; if (IncomeDataGrid != null) { for (int i = 0; i < IncomeDataGrid.Count; i++) { r += (double)IncomeDataGrid[i].income_size; } } iNCOMESum = "Итог за выбранный период: " + r.ToString(); }