public CommissionOverviewViewModel(ICommissionRepository icr) { this._icr = icr; CommissionList = new ObservableCollection <CommissionViewModel>(icr.GetAll()); ShowableEmployeeList = new ObservableCollection <EmployeeViewModel>(); CompleteEmployeeList = new ObservableCollection <EmployeeViewModel>(); }
public void AddCommission() { var locationId = _icr.GetLocationViewModels().ToList().Count; if (ValidateInput()) { _icr.CreateLocation(new LocationViewModel(locationId, ZipCode, StreetNumber, SelectedRegion)); Commission = new CommissionViewModel(_icr.GetAll().ToList().Count + 1, Frequency, SelectedCustomer.Id, locationId, null, DateTime.Now, null, Description, SelectedRegion, SelectedCustomer.Name); if (_icr.Create(Commission)) { _cvm.CommissionList.Add(Commission); _router.SetViewCommand.Execute("commissions-overview"); } } else { ShowValidationError(); } }
public CommissionMaster GetLast() { var details = _CommissionRepository.GetAll().LastOrDefault(); return(details); }