public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            heatSupplierRepository = new HeatSupplierRepository(db);
            buildingRepository = new BuildingRepository(db);
            reportRepository = new ReportRepository(db);
            normativeCalculationRepository = new NormativeCalculationRepository(db);
            thermometerReadingRepository = new ThermometerReadingRepository(db);
            contractConsumprionRepository = new ContractComsumptionRepository(db);
            clearingRepository = new ClearingRepository(db);
            variablesRepository = new BuildingMonthVariablesRepository(db);

            heatSupplierViewModel = new HeatSupplierViewModel(heatSupplierRepository);
            buildingViewModel = new BuildingViewModel(buildingRepository);
            createReportViewModel = new CreateReportViewModel(reportRepository);
            normativeAndProjectModel = new NormativeAndProjectModel(normativeCalculationRepository, new StandartCalculator(),
                                                               contractConsumprionRepository, new ContractCalculator(),
                                                               variablesRepository);
            //normativeCalculationViewModel = new NormativeCalculationViewModel(normativeCalculationRepository, new StandartCalculator());
            thermometerReadingViewModel = new ThermometersReaderViewModel(thermometerReadingRepository);
            contractConsumptionViewModel = new ContractConsumptionViewModel(contractConsumprionRepository, new ContractCalculator());

            clearinViewModel = new ClearingViewModel(clearingRepository, new TotalCalculation());

            _reportViewer.Load += ReportViewerLoad;
        }
 public ThermometersReaderViewModel(IThermometerReadingRepository repository)
 {
     this.repository = repository;
     ThermometerReadings = new ObservableCollection<ThermometerReading>(repository.GetThermometerReadings());
     var monthList = new List<EnumMonth>(12)
                         {
                             EnumMonth.Январь,
                             EnumMonth.Февраль,
                             EnumMonth.Март,
                             EnumMonth.Апрель,
                             EnumMonth.Май,
                             EnumMonth.Июнь,
                             EnumMonth.Июль,
                             EnumMonth.Август,
                             EnumMonth.Сентябрь,
                             EnumMonth.Октябрь,
                             EnumMonth.Ноябрь,
                             EnumMonth.Декабрь
                         };
     Months = new ObservableCollection<EnumMonth>(monthList);
     view = new ThermometerReadingView(){DataContext = this};
 }