public MainWindowViewModel(IBaseViewModel archiveVm, IBaseViewModel commentsVm, IEmplyeesViewModel emplyeesVm, ILoginViewModel loginVm, IForgetPasswordViewModel forgetPasswordVm, IBaseViewModel myTasksVm, IBaseViewModel profileVm, IReportsViewModel reportsVm, ITrackingTasksViewModel trackingTasksVm) { _archiveVm = archiveVm; _currentVm = loginVm; _commentsVm = commentsVm; _emplyeesVm = emplyeesVm; _forgetPasswordVm = forgetPasswordVm; _loginVm = loginVm; _myTasksVm = myTasksVm; _profileVm = profileVm; _reportsVm = reportsVm; _trackingTasksVm = trackingTasksVm; SubscribeToSwitchViewRequested(); }
/// <summary> /// Initialises a new instance of the <see cref="BodyViewModel"/> class. /// </summary> /// <param name="dataEntryModel"> /// The model object associated with the data entry process. /// </param> /// <param name="dataModel"> /// The model object containing data set. /// </param> /// <param name="fileFactory">beastie file factory</param> /// <param name="logger">the logger</param> public BodyViewModel( IEventEntry dataEntryModel, IDataManager dataModel, IBeastieDataFileFactory fileFactory, IAsLogger logger) { this.configurationViewModel = new ConfigurationViewModel( dataModel, fileFactory); this.consistencyViewModel = new ConsistencyViewModel(); this.reportsViewModel = new ReportsViewModel( dataModel, logger); this.dataEntryViewModel = new DataEntryViewModel( dataEntryModel, dataModel.FindBeastie); this.currentView = this.dataEntryViewModel; Messenger.Default.Register <MainViewMessage>(this, this.ChangeView); }
public void GetServiceLineData(IReportsViewModel vm) { Stopwatch sw = new Stopwatch(); sw.Start(); try { log.Debug("Call GetConnection"); using (var connection = GetConnection()) { log.Debug("Connection made"); //Setup the SQL command object SqlCommand cmd = new SqlCommand("IRM.spServiceLineExplorerData", connection); cmd.CommandType = CommandType.StoredProcedure; //Add date range params cmd.Parameters.AddWithValue("@StartDate", vm.StartDate); cmd.Parameters.AddWithValue("@EndDate", vm.EndDate); log.DebugFormat("@StartDate = {0}", vm.StartDate); log.DebugFormat("@EndDate = {0}", vm.EndDate); DataTable EncounterTypesfilterTempTable = BuildFilterParameter(vm.EncounterTypesList, vm.EncounterTypesIDlist); DataTable ServiceLinesfilterTempTable = BuildFilterParameter(vm.ServiceLinesList, vm.DiagnosisCodeIDlist); DataTable ClientOrganizationfilterTempTable = BuildFilterParameter(vm.OrganizationList, vm.ClientOrganizationIDList); SqlParameter tvparam = cmd.Parameters.AddWithValue("@EncounterTypeFilterList", EncounterTypesfilterTempTable); tvparam.SqlDbType = SqlDbType.Structured; tvparam = cmd.Parameters.AddWithValue("@DiagnosisFilterList", ServiceLinesfilterTempTable); tvparam.SqlDbType = SqlDbType.Structured; tvparam = cmd.Parameters.AddWithValue("@ClientOrganizationFilterList", ClientOrganizationfilterTempTable); tvparam.SqlDbType = SqlDbType.Structured; log.Debug("Call cmd.ExecuteReader"); // execute query, consume results, etc. here using (SqlDataReader reader = cmd.ExecuteReader()) { vm.ServiceLineExplorerResults.Clear(); while (reader.Read()) { string ID = reader.FieldToString("DiagnosisCodeGroupID"); string description = reader.FieldToString("Description"); int totalEncounters = reader.FieldToInt("Encounters"); decimal totalCharged = reader.FieldToDecimal("Charged"); decimal totalPayments = reader.FieldToDecimal("Payments"); decimal totalCost = reader.FieldToDecimal("TotalCost"); decimal Profit = reader.FieldToDecimal("Profit"); var values = new ServiceLineExplorerResults() { Idx = ID, Description = description, TotalCount = totalEncounters, TotalCharged = totalCharged, Totalpayments = totalPayments, TotalCost = totalCost, TotalProfit = Profit }; vm.ServiceLineExplorerResults.Add(values); } } } } finally { sw.Stop(); LoggerHelper.RecordTiming(System.Reflection.MethodBase.GetCurrentMethod().Name, sw, log); log.DebugFormat("{0} rows returned.", vm.ServiceLineExplorerResults.Count); } }
public ReportsComponent(IReportsViewModel reportsViewModel) : this() => DataContext = reportsViewModel;
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); _viewModel = App.ServiceProvider.GetService <IReportsViewModel>(); await _viewModel.Initialization(); }