コード例 #1
0
 public ArtistAppService(
     ICrudServicesAsync crudServices,
     IMapper mapper)
 {
     _crudServices = crudServices;
     _mapper       = mapper;
 }
コード例 #2
0
 public AccountListViewActionViewModel(ICrudServicesAsync crudServices,
                                       IMvxLogProvider logProvider,
                                       IMvxNavigationService navigationService) : base(logProvider, navigationService)
 {
     this.crudServices      = crudServices;
     this.navigationService = navigationService;
 }
コード例 #3
0
 /// <summary>
 ///     Base class for the category list user control
 /// </summary>
 protected AbstractCategoryListViewModel(ICrudServicesAsync crudServices,
                                         IDialogService dialogService,
                                         IMvxLogProvider logProvider,
                                         IMvxNavigationService navigationService) : base(logProvider, navigationService)
 {
     CrudServices  = crudServices;
     DialogService = dialogService;
 }
コード例 #4
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public PaymentListBalanceViewModel(ICrudServicesAsync crudServices,
                                    IBalanceCalculationService balanceCalculationService,
                                    int accountId) : base(balanceCalculationService)
 {
     this.crudServices = crudServices;
     this.balanceCalculationService = balanceCalculationService;
     this.accountId = accountId;
 }
コード例 #5
0
 /// <summary>
 ///     Creates an CategoryListViewModel for the usage of providing a CategoryViewModel selection.
 /// </summary>
 public SelectCategoryListViewModel(ICrudServicesAsync crudServicesAsync,
                                    IDialogService dialogService,
                                    IMvxMessenger messenger,
                                    IMvxLogProvider logProvider,
                                    IMvxNavigationService navigationService) : base(crudServicesAsync, dialogService, logProvider, navigationService)
 {
     this.messenger = messenger;
 }
コード例 #6
0
        public async Task <IActionResult> AddPromotion(int id, [FromServices] ICrudServicesAsync <BookDbContext> service)
        {
            Request.ThrowErrorIfNotLocal();
            var dto = await service.ReadSingleAsync <AddPromotionDto>(id);

            SetupTraceInfo();
            return(View(dto));
        }
コード例 #7
0
 /// <summary>
 ///     Base class for the category list user control
 /// </summary>
 protected AbstractCategoryListViewModel(ICrudServicesAsync crudServices,
                                         IDialogService dialogService,
                                         INavigationService navigationService)
 {
     CrudServices      = crudServices;
     DialogService     = dialogService;
     NavigationService = navigationService;
 }
コード例 #8
0
 /// <summary>
 ///     Constructor
 /// </summary>
 protected ModifyCategoryViewModel(ICrudServicesAsync crudServices,
                                   ISettingsFacade settingsFacade,
                                   IBackupService backupService,
                                   IMvxLogProvider logProvider,
                                   IMvxNavigationService navigationService) : base(logProvider, navigationService)
 {
     this.settingsFacade = settingsFacade;
     this.backupService  = backupService;
     this.crudServices   = crudServices;
 }
コード例 #9
0
        /// <summary>
        ///     Constructor
        /// </summary>
        protected ModifyCategoryViewModel(ICrudServicesAsync crudServices,
                                          ISettingsFacade settingsFacade,
                                          IBackupService backupService,
                                          INavigationService navigationService)
        {
            this.settingsFacade = settingsFacade;
            this.backupService  = backupService;
            this.crudServices   = crudServices;

            NavigationService = navigationService;
        }
コード例 #10
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public PaymentListBalanceViewModel(ICrudServicesAsync crudServices,
                                    IBalanceCalculationService balanceCalculationService,
                                    int accountId,
                                    IMvxLogProvider logProvider,
                                    IMvxNavigationService navigationService) : base(
         balanceCalculationService, logProvider, navigationService)
 {
     this.crudServices = crudServices;
     this.balanceCalculationService = balanceCalculationService;
     this.accountId = accountId;
 }
コード例 #11
0
        public AddCategoryViewModel(ICrudServicesAsync crudServices,
                                    IDialogService dialogService,
                                    ISettingsFacade settingsFacade,
                                    IBackupService backupService,
                                    INavigationService navigationService) : base(crudServices, settingsFacade, backupService, navigationService)
        {
            this.crudServices  = crudServices;
            this.dialogService = dialogService;

            Title = Strings.AddCategoryTitle;
        }
コード例 #12
0
 public AddCategoryViewModel(ICrudServicesAsync crudServices,
                             IDialogService dialogService,
                             ISettingsFacade settingsFacade,
                             IBackupService backupService,
                             IMvxLogProvider logProvider,
                             IMvxNavigationService navigationService)
     : base(crudServices, settingsFacade, backupService, logProvider, navigationService)
 {
     this.crudServices  = crudServices;
     this.dialogService = dialogService;
 }
コード例 #13
0
 public EditAccountViewModel(ICrudServicesAsync crudServices,
                             ISettingsFacade settingsFacade,
                             IBackupService backupService,
                             IDialogService dialogService,
                             INavigationService navigationService) : base(settingsFacade, backupService, navigationService)
 {
     this.crudServices   = crudServices;
     this.settingsFacade = settingsFacade;
     this.backupService  = backupService;
     this.dialogService  = dialogService;
 }
コード例 #14
0
 public SubscriberAppService(
     ICrudServicesAsync crudServices,
     EmailManager emailManager,
     TemplateManager templateManager,
     IConfiguration configuration
     )
 {
     _crudServices    = crudServices;
     _emailManager    = emailManager;
     _templateManager = templateManager;
     _configuration   = configuration;
 }
コード例 #15
0
 public AddPaymentViewModel(IPaymentService paymentService,
                            ICrudServicesAsync crudServices,
                            IDialogService dialogService,
                            ISettingsFacade settingsFacade,
                            IBackupService backupService,
                            INavigationService navigationService)
     : base(crudServices, dialogService, settingsFacade, backupService, navigationService)
 {
     this.paymentService    = paymentService;
     this.navigationService = navigationService;
     this.dialogService     = dialogService;
 }
コード例 #16
0
        public async Task <IActionResult> RemovePromotion(int id, [FromServices] ICrudServicesAsync <BookDbContext> service)
        {
            Request.ThrowErrorIfNotLocal();
            var dto = await service.ReadSingleAsync <RemovePromotionDto>(id);

            if (!service.IsValid)
            {
                service.CopyErrorsToModelState(ModelState, dto);
            }
            SetupTraceInfo();
            return(View(dto));
        }
コード例 #17
0
        public AddAccountViewModel(ICrudServicesAsync crudService,
                                   ISettingsFacade settingsFacade,
                                   IBackupService backupService,
                                   IDialogService dialogService,
                                   INavigationService navigationService)
            : base(settingsFacade, backupService, navigationService)
        {
            this.crudService   = crudService;
            this.dialogService = dialogService;

            Title = Strings.AddAccountTitle;
        }
コード例 #18
0
 public AddPaymentViewModel(IPaymentService paymentService,
                            ICrudServicesAsync crudServices,
                            IDialogService dialogService,
                            ISettingsFacade settingsFacade,
                            IMvxMessenger messenger,
                            IBackupService backupService,
                            IMvxLogProvider logProvider,
                            IMvxNavigationService navigationService)
     : base(crudServices, dialogService, settingsFacade, messenger, backupService, logProvider, navigationService)
 {
     this.paymentService = paymentService;
     this.dialogService  = dialogService;
 }
コード例 #19
0
        /// <summary>
        ///     Default constructor
        /// </summary>
        protected ModifyPaymentViewModel(ICrudServicesAsync crudServices,
                                         IDialogService dialogService,
                                         ISettingsFacade settingsFacade,
                                         IBackupService backupService,
                                         INavigationService navigationService)
        {
            this.crudServices      = crudServices;
            this.dialogService     = dialogService;
            this.settingsFacade    = settingsFacade;
            this.backupService     = backupService;
            this.navigationService = navigationService;

            MessengerInstance.Register <CategorySelectedMessage>(this, ReceiveMessage);
        }
コード例 #20
0
        /// <summary>
        ///     Default constructor
        /// </summary>
        protected ModifyPaymentViewModel(ICrudServicesAsync crudServices,
                                         IDialogService dialogService,
                                         ISettingsFacade settingsFacade,
                                         IMvxMessenger messenger,
                                         IBackupService backupService,
                                         IMvxLogProvider logProvider,
                                         IMvxNavigationService navigationService) : base(logProvider, navigationService)
        {
            this.crudServices      = crudServices;
            this.dialogService     = dialogService;
            this.settingsFacade    = settingsFacade;
            this.backupService     = backupService;
            this.navigationService = navigationService;

            token = messenger.Subscribe <CategorySelectedMessage>(ReceiveMessage);
        }
コード例 #21
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public AccountListViewModel(ICrudServicesAsync crudService,
                                    IBalanceCalculationService balanceCalculationService,
                                    IDialogService dialogService,
                                    ISettingsFacade settingsFacade,
                                    INavigationService navigationService)
        {
            this.crudService       = crudService;
            this.dialogService     = dialogService;
            this.navigationService = navigationService;
            this.settingsFacade    = settingsFacade;

            BalanceViewModel    = new BalanceViewModel(balanceCalculationService);
            ViewActionViewModel = new AccountListViewActionViewModel(crudService, this.navigationService);

            Accounts = new ObservableCollection <AlphaGroupListGroupCollection <AccountViewModel> >();
        }
コード例 #22
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public PaymentListViewActionViewModel(ICrudServicesAsync crudServices,
                                       ISettingsFacade settingsFacade,
                                       IDialogService dialogService,
                                       IBalanceViewModel balanceViewModel,
                                       IMvxMessenger messenger,
                                       int accountId,
                                       IMvxLogProvider logProvider,
                                       IMvxNavigationService navigationService) : base(logProvider, navigationService)
 {
     this.crudServices      = crudServices;
     this.settingsFacade    = settingsFacade;
     this.dialogService     = dialogService;
     this.balanceViewModel  = balanceViewModel;
     this.navigationService = navigationService;
     this.messenger         = messenger;
     this.accountId         = accountId;
 }
コード例 #23
0
        /// <summary>
        ///     Default constructor
        /// </summary>
        public PaymentListViewModel(ICrudServicesAsync crudServices,
                                    IPaymentService paymentService,
                                    IDialogService dialogService,
                                    ISettingsFacade settingsFacade,
                                    IBalanceCalculationService balanceCalculationService,
                                    IBackupService backupService,
                                    INavigationService navigationService)
        {
            this.crudServices              = crudServices;
            this.paymentService            = paymentService;
            this.dialogService             = dialogService;
            this.settingsFacade            = settingsFacade;
            this.balanceCalculationService = balanceCalculationService;
            this.backupService             = backupService;
            this.navigationService         = navigationService;

            MessengerInstance.Register <PaymentListFilterChangedMessage>(this, LoadPayments);
        }
コード例 #24
0
        public async Task <IActionResult> ChangePubDate(ChangePubDateDto dto, [FromServices] ICrudServicesAsync <BookDbContext> service)
        {
            if (!ModelState.IsValid)
            {
                return(View(dto));
            }
            await service.UpdateAndSaveAsync(dto);

            SetupTraceInfo();
            if (service.IsValid)
            {
                return(View("BookUpdated", new BookUpdatedDto(service.Message, _backToDisplayController)));
            }

            //Error state
            service.CopyErrorsToModelState(ModelState, dto);
            return(View(dto));
        }
コード例 #25
0
        public async Task <IActionResult> ChangePubDate(ChangePubDateEventsDto dto, [FromServices] ICrudServicesAsync <SqlEventsDbContext> service)
        {
            if (!ModelState.IsValid)
            {
                return(View(dto));
            }
            await service.UpdateAndSaveAsync(dto);

            SetupTraceInfo();
            if (service.IsValid)
            {
                return(View("BookUpdated", service.Message));
            }

            //Error state
            service.CopyErrorsToModelState(ModelState, dto);
            return(View(dto));
        }
コード例 #26
0
        public async Task <IActionResult> AddPromotion(AddPromotionDto dto, [FromServices] ICrudServicesAsync <BookDbContext> service)
        {
            Request.ThrowErrorIfNotLocal();
            if (!ModelState.IsValid)
            {
                return(View(dto));
            }
            await service.UpdateAndSaveAsync(dto);

            SetupTraceInfo();
            if (!service.HasErrors)
            {
                return(View("BookUpdated", new BookUpdatedDto(service.Message, _backToDisplayController)));
            }

            //Error state
            service.CopyErrorsToModelState(ModelState, dto);
            return(View(dto));
        }
コード例 #27
0
        public async Task <IActionResult> AddBookReview(AddReviewDto dto, [FromServices] ICrudServicesAsync <BookDbContext> service)
        {
            Request.ThrowErrorIfNotLocal();
            if (!ModelState.IsValid)
            {
                return(View(dto));
            }
            await service.UpdateAndSaveAsync(dto);

            SetupTraceInfo();
            if (service.IsValid)
            {
                return(View("BookUpdated", service.Message));
            }

            //Error state
            service.CopyErrorsToModelState(ModelState, dto);
            return(View(dto));
        }
コード例 #28
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public PaymentListViewActionViewModel(int accountId,
                                              ICrudServicesAsync crudServices,
                                              ISettingsFacade settingsFacade,
                                              IDialogService dialogService,
                                              IBalanceViewModel balanceViewModel,
                                              INavigationService navigationService)
        {
            this.accountId = accountId;

            this.crudServices      = crudServices;
            this.settingsFacade    = settingsFacade;
            this.dialogService     = dialogService;
            this.balanceViewModel  = balanceViewModel;
            this.navigationService = navigationService;

            var accountCount = crudServices.ReadManyNoTracked <AccountViewModel>().Count();

            IsTransferAvailable   = accountCount >= 2;
            IsAddIncomeAvailable  = accountCount >= 1;
            IsAddExpenseAvailable = accountCount >= 1;
        }
コード例 #29
0
        /// <summary>
        ///     Default constructor
        /// </summary>
        public PaymentListViewModel(ICrudServicesAsync crudServices,
                                    IPaymentService paymentService,
                                    IDialogService dialogService,
                                    ISettingsFacade settingsFacade,
                                    IBalanceCalculationService balanceCalculationService,
                                    IBackupService backupService,
                                    IMvxNavigationService navigationService,
                                    IMvxMessenger messenger,
                                    IMvxLogProvider logProvider)
        {
            this.crudServices              = crudServices;
            this.paymentService            = paymentService;
            this.dialogService             = dialogService;
            this.settingsFacade            = settingsFacade;
            this.balanceCalculationService = balanceCalculationService;
            this.backupService             = backupService;
            this.navigationService         = navigationService;
            this.messenger   = messenger;
            this.logProvider = logProvider;

            token = messenger.Subscribe <PaymentListFilterChangedMessage>(LoadPayments);
        }
コード例 #30
0
 /// <summary>
 ///     Creates an CategoryListViewModel for usage when the list including the option is needed.
 /// </summary>
 public CategoryListViewModel(ICrudServicesAsync curdServicesAsync,
                              IDialogService dialogService,
                              INavigationService navigationService) : base(curdServicesAsync, dialogService, navigationService)
 {
 }