public SummaryItemsViewModel(EmployeeViewModel employeeViewModel)
 {
     this._employeeViewModel = employeeViewModel;
     this._repository = ServiceLocator.Current.GetService<IExpenseRepository>();
     this.GroupedSummaryItems = new ObservableCollection<GroupInfoList<object>>();
     this.SortTypes = new ObservableCollection<SortType>();
     this.SortTypes.Add(SortType.Age);
     this.SortTypes.Add(SortType.Amount);
 }
Esempio n. 2
0
        public ChargesViewModel()
        {
            this.EmployeeViewModel = ServiceLocator.Current.GetService<EmployeeViewModel>();
            this.NavigationService = ServiceLocator.Current.GetService<INavigationService>();
            this._repository = ServiceLocator.Current.GetService<IExpenseRepository>();
            this.ViewService = ServiceLocator.Current.GetService<IViewService>();
            this.GroupedCharges = new ObservableCollection<GroupInfoList<object>>();
            this.SortTypes = new ObservableCollection<SortType>();
            this.SortTypes.Add(SortType.Age);
            this.SortTypes.Add(SortType.Amount);

            this.ViewChargeCommand = new RelayCommand(
                (charge) =>
                {
                    this.ViewCharge(charge as ChargeViewModel);
                });

            this.ChargesSelectionChangedCommand = new RelayCommand(
                (selectionChange) =>
                {
                    this.ChargesSelectionChanged(selectionChange);
                });
        }
        public ExpenseReportViewModel()
        {
            this._repository = ServiceLocator.Current.GetService<IExpenseRepository>();
            this._employeeViewModel = ServiceLocator.Current.GetService<EmployeeViewModel>();
            this.NavigationService = ServiceLocator.Current.GetService<INavigationService>();
            this.ViewService = ServiceLocator.Current.GetService<IViewService>();

            employeeId = this._employeeViewModel.EmployeeId;
            employeeName = this._employeeViewModel.Name;
            approver = this._employeeViewModel.Manager;
            costCenter = 50992;
            purpose = string.Empty;

            this.SaveReportCommand = new RelayCommand(
                async (_) =>
                {
                    await this.SaveAsync();
                });

            this.DeleteReportCommand = new RelayCommand(
                async (_) =>
                {
                    await this.DeleteAsync();
                });

            this.SubmitReportCommand = new RelayCommand(
                async (_) =>
                {
                    await this.SubmitAsync();
                });
        }
        public ExpenseReportsViewModel()
        {
            this.EmployeeViewModel = ServiceLocator.Current.GetService<EmployeeViewModel>();
            this.NavigationService = ServiceLocator.Current.GetService<INavigationService>();
            this._repository = ServiceLocator.Current.GetService<IExpenseRepository>();
            this.ViewService = ServiceLocator.Current.GetService<IViewService>();

            this._expenseReports = new ObservableCollection<ExpenseReportViewModel>();
            this._groupedExpenseReports = new ObservableCollection<GroupInfoList<object>>();
            this.SortTypes = new ObservableCollection<SortType>();
            this.SortTypes.Add(SortType.Age);
            this.SortTypes.Add(SortType.Amount);

            this.ViewReportCommand = new RelayCommand(
                (report) =>
                {
                    this.ViewReport(report as ExpenseReportViewModel);
                });
        }