Exemple #1
0
 private void ViewCharge(ChargeViewModel chargeViewModel)
 {
     if (ViewChargeRequested != null)
     {
         ViewChargeRequested(chargeViewModel, EventArgs.Empty);
     }
 }
Exemple #2
0
        private void AddChargeToReport(ChargeViewModel chargeViewModel)
        {
            this._addChargesViewModel.Charges.Remove(chargeViewModel);

            chargeViewModel.ExpenseReportId = this.ExpenseReport.ExpenseReportId;
            this._expenseReportChargesView.Charges.Add(chargeViewModel);
        }
 public void ShowCharge(ChargeViewModel chargeViewModel)
 {
     EventHandler<EventArgs<ChargeViewModel>> handler = this.ShowChargeRequested;
     if (handler != null)
     {
         handler(this, new EventArgs<ChargeViewModel>(chargeViewModel));
     }
 }
Exemple #4
0
        void CreateNewCharge()
        {
            ChargeViewModel viewModel = new ChargeViewModel()
            {
                EmployeeId = EmployeeViewModel.EmployeeId
            };

            if (CreateNewChargeRequested != null)
            {
                CreateNewChargeRequested(viewModel, EventArgs.Empty);
            }
        }
Exemple #5
0
    public async Task TestMethod1()
    {
      ServiceLocator.Current.SetService<INavigationService>(
        new StubINavigationService());

      StubIViewService viewService =
        new StubIViewService()
        {
          ExecuteBusyActionAsyncFuncOfTask =
              async (Func<Task> func) =>
              {
                await func();
              }
        };
      ServiceLocator.Current.SetService<IViewService>(viewService);

      StubIExpenseRepository repository =
        new StubIExpenseRepository()
        {
          GetChargeAsyncInt32 =
              (chargeId) =>
              {
                return Task.FromResult(
                    new Charge()
                    {
                      ChargeId = chargeId,
                    });
              }
        };
      ServiceLocator.Current.SetService<IExpenseRepository>(repository);




      // Create a new ChargeViewModel.
      ChargeViewModel chargeViewModel = new ChargeViewModel();

      // Make sure it defaults to a ChargeId of 0.
      Assert.AreEqual(0, chargeViewModel.ChargeId);

      // Load the charge with the ChargeId of 1.
      await chargeViewModel.LoadAsync(1);

      // Confirm the ViewModel’s ChargeId is 1.
      Assert.AreEqual(1, chargeViewModel.ChargeId);

    }
 public void ShowCharge(ChargeViewModel charge)
 {
     this.CurrentViewModel = charge;
 }
Exemple #7
0
 private void RemoveChargeFromReport(ChargeViewModel chargeViewModel)
 {
     chargeViewModel.ExpenseReportId = null;
     this._expenseReportChargesView.Charges.Remove(chargeViewModel);
     this._addChargesViewModel.Charges.Add(chargeViewModel);
 }
 private void ViewCharge(ChargeViewModel chargeViewModel)
 {
     this.NavigationService.ShowCharge(chargeViewModel);
 }
 private void RemoveChargeFromReport(ChargeViewModel chargeViewModel)
 {
     chargeViewModel.ExpenseReportId = null;
     this._expenseReportChargesView.Charges.Remove(chargeViewModel);
     this._addChargesViewModel.Charges.Add(chargeViewModel);
 }
        private void AddChargeToReport(ChargeViewModel chargeViewModel)
        {
            this._addChargesViewModel.Charges.Remove(chargeViewModel);

            chargeViewModel.ExpenseReportId = this.ExpenseReport.ExpenseReportId;
            this._expenseReportChargesView.Charges.Add(chargeViewModel);
        }
Exemple #11
0
 private void ViewCharge(ChargeViewModel chargeViewModel)
 {
     this.NavigationService.ShowCharge(chargeViewModel);
 }