public ExchangeRateAddViewModel(IExchangeRateAppService service, IEventAggregator eventAggregator) { AppService = service; EventAggregator = eventAggregator; CreateCommand = new DelegateCommand <ICloseable>(Create); Exchange = AppService.CurrentExchangeRate().Result; }
public InvoiceInputViewModel(IInvoiceAppService appService, IPatientAppService patientApp, ICategoryAppService categoryApp, IEventAggregator eventAggregator, ISettingProvider setting, IExchangeRateAppService exchangeRateApp, IServiceProvider serviceProvider) { SettingProvider = setting; EventAggregator = eventAggregator; _serviceProvider = serviceProvider; PatientService = patientApp; AppService = appService; rateAppService = exchangeRateApp; CategoryService = categoryApp; CreateCommand = new DelegateCommand <ICloseable>(Create); AddPatientCommand = new DelegateCommand(CreatePatient); DeleteInvoiceLineCommand = new DelegateCommand(OnInvoiceLineDeleted); SelectedCommand = new DelegateCommand <object[]>(OnItemSelected); AddExamCommand = new DelegateCommand <ExamDto>(AddExam); Patients = new ObservableCollection <PatientDto>(); Patients.AddRange(PatientService.GetListAsync().Result); Currency = SettingProvider.GetOrNullAsync(FacCigoSettings.InvoiceCurrency).Result; Model = new InvoiceModel(); Model.ReferenceNo = AppService.NextReferenceNo(Model.InvoiceDate.Year).Result; Categories = new ObservableCollection <CategoryDto>(); Categories.AddRange(CategoryService.GetListAsync().Result); EventAggregator.GetEvent <PatientAddedEvent>().Subscribe(PatientAdded); ExchangeRate = rateAppService.CurrentExchangeRate().Result; }
public MainViewModel(IExchangeRateAppService exchangeAppService, ISettingProvider setting, IEventAggregator ea) { ExchangeService = exchangeAppService; SettingProvider = setting; EventAggregator = ea; EventAggregator.GetEvent <ExchangeRateAddedEvent>().Subscribe(ExchangeChanged); Exchange = ExchangeService.CurrentExchangeRate().Result; }
public CreateExchangeRateCommand(IExchangeRateAppService service, IEventAggregator aggregator) { appService = service; eventAggregator = aggregator; }