Ejemplo n.º 1
0
        public NewToApplicationWindow(IApplicationHotkeyService hotkeyService, IAppSettingService settingService, IActionService actionService)
        {
            InitializeComponent();

            this.Title = "New to RecNForget?";

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.hotkeyService = new DesignerApplicationHotkeyService();
                this.actionService = new DesignerActionService();
                SettingService     = new DesignerAppSettingService();
                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.hotkeyService = hotkeyService;
                SettingService     = settingService;
                this.actionService = actionService;

                this.KeyDown += Window_KeyDown;
            }
        }
        public async Task <IActionResult> UpdateFormDocument(long id, FormDictionaryDto model,
                                                             [FromServices] IActionService <IUpdateFormDictionaryAction> service)
        {
            model.Id = id;
            if (model.File != null && model.File.Length > 0)
            {
                FormDocumentFileHelper docHelper = new FormDocumentFileHelper();
                string filePath = await docHelper.SaveFormDocument(model.Code, model.File, _enviroment);

                model.FileName = Path.Combine(Path.Combine(filePath, $"{model.Code}"));
            }

            service.RunBizAction(model);

            if (!service.Status.HasErrors)
            {
                return(new ObjectResult(new ResultResponseDto <String, long>
                {
                    Key = HttpStatusCode.OK,
                    Value = "FormDocument updated..",
                    Subject = model.Id
                }));
            }

            var errors = service.Status.CopyErrorsToString(ModelState);

            return(new ObjectResult(new ResultResponseDto <String, long> {
                Key = HttpStatusCode.BadRequest, Value = errors, Subject = model.Id
            }));
        }
Ejemplo n.º 3
0
        public IActionResult ChangeDelivery(WebChangeDeliveryDto dto,
                                            [FromServices] IActionService <IChangeDeliverAction> service)
        {
            if (!ModelState.IsValid)
            {
                //I have to reset the DTO, which will call SetupSecondaryData
                //to set up the values needed for the display
                service.ResetDto(dto);
                //return to the same view to show the errors
                return(View(dto));
            }

            //This runs my business logic using the service injected in the
            //Action's service parameter
            service.RunBizAction(dto);

            if (!service.Status.HasErrors)
            {
                SetupTraceInfo();       //Used to update the logs
                //We copy the message from the business logic to show
                return(RedirectToAction("ConfirmOrder", "Orders",
                                        new { dto.OrderId, message = service.Status.Message }));
            }

            //Otherwise errors, so I need to redisplay the page to the user
            service.Status.CopyErrorsToModelState(ModelState, dto);
            //I reset the DTO, which will call SetupSecondaryData i set up the display props
            service.ResetDto(dto);
            SetupTraceInfo();  //Used to update the logs
            return(View(dto)); //redisplay the page, with the errors
        }
Ejemplo n.º 4
0
        public IActionResult PlaceOrder(PlaceOrderInDto dto,
                                        [FromServices] IActionService <IRepository, IPlaceOrderAction> service)
        {
            if (!ModelState.IsValid)
            {
                //model errors so return to checkout page, showing the basket
                return(View("Index", FormCheckoutDtoFromCookie(HttpContext)));
            }

            //This runs my business logic using the service injected into the Action's parameters
            var orderDto = service.RunBizAction <OrderIdDto>(dto);

            if (!service.Status.HasErrors)
            {
                //If successful I need to clear the line items from the basket cookie
                ClearCheckoutCookie(HttpContext);
                SetupTraceInfo();       //Used to update the logs
                return(RedirectToAction("ConfirmOrder", "Orders",
                                        new { orderDto.OrderId, Message = "Your order is confirmed" }));
            }

            //Otherwise errors, so I need to redisplay the basket from the cookie
            var checkoutDto = FormCheckoutDtoFromCookie(HttpContext);

            //This copies the errors to the ModelState
            service.Status.CopyErrorsToModelState(ModelState, checkoutDto);

            SetupTraceInfo();       //Used to update the logs
            return(View("Index", checkoutDto));
        }
Ejemplo n.º 5
0
 public UserPetService(IUserPetRepository userPetRepo, IPetService petService, IUserService userService, IActionService actionService)
 {
     this.userPetRepo   = userPetRepo;
     this.petService    = petService;
     this.userService   = userService;
     this.actionService = actionService;
 }
Ejemplo n.º 6
0
        private void HandleFirstStartAndUpdates(IActionService actionService, IAppSettingService appSettingService, IApplicationHotkeyService hotkeyService, bool firstTimeUser)
        {
            if (appSettingService.CheckForUpdateOnStart)
            {
                Task.Run(() => { actionService.CheckForUpdates(showMessages: false); });
            }

            var     currentFileVersion   = new Version(ThisAssembly.AssemblyFileVersion);
            Version lastInstalledVersion = appSettingService.LastInstalledVersion;

            appSettingService.LastInstalledVersion = currentFileVersion;
            hotkeyService.ResetAndReadHotkeysFromConfig();

            if (firstTimeUser)
            {
                actionService.ShowNewToApplicationWindow();
            }
            else if (currentFileVersion.CompareTo(lastInstalledVersion) > 0)
            {
                actionService.ShowNewToVersionDialog(currentFileVersion, lastInstalledVersion);
            }
            else if (appSettingService.ShowTipsAtApplicationStart)
            {
                actionService.ShowRandomApplicationTip();
            }
        }
Ejemplo n.º 7
0
        public HouseController(IHouseService houseService,
                               IActionService actionService)
        {
            _houseService = houseService;

            _actionService = actionService;
        }
Ejemplo n.º 8
0
        public AboutWindow()
        {
            DataContext = this;
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.appSettingService = new DesignerAppSettingService();
                this.actionService     = new DesignerActionService();
                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.appSettingService = UnityHandler.UnityContainer.Resolve <IAppSettingService>();
                this.actionService     = UnityHandler.UnityContainer.Resolve <IActionService>();
            }

            var assemblyInformationalVersion = appSettingService.RuntimeInformalVersionString;
            var assemblyFileVersion          = new Version(appSettingService.RuntimeVersionString);

            AppNameAndVersion.Text = string.Format("RecNForget {0}", string.Format("{0}.{1}.{2}", assemblyFileVersion.Major, assemblyFileVersion.Minor, assemblyFileVersion.Build));
            VersionLabel.Text      = string.Format("{0} - v{1}", "Chili Garlic Shrimps", assemblyInformationalVersion);
        }
Ejemplo n.º 9
0
        public RecordingAndPlaybackControl()
        {
            DataContext = this;
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.actionService     = new DesignerActionService();
                this.appSettingService = new DesignerAppSettingService();

                AudioPlaybackService  = new DesignerAudioPlaybackService();
                AudioRecordingService = new DesignerAudioRecordingService();
                SelectedFileService   = new DesignerSelectedFileService();
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.actionService     = UnityHandler.UnityContainer.Resolve <IActionService>();
                this.appSettingService = UnityHandler.UnityContainer.Resolve <IAppSettingService>();
                AudioPlaybackService   = UnityHandler.UnityContainer.Resolve <IAudioPlaybackService>();
                AudioRecordingService  = UnityHandler.UnityContainer.Resolve <IAudioRecordingService>();
                SelectedFileService    = UnityHandler.UnityContainer.Resolve <ISelectedFileService>();

                AudioPlaybackService.PropertyChanged  += AudioPlaybackService_PropertyChanged;
                AudioRecordingService.PropertyChanged += AudioRecordingService_PropertyChanged;
            }
        }
Ejemplo n.º 10
0
 public UsersController(IUserService service, IActionTimelineService actionTimelineService, IActionService actionService)
     : base(service)
 {
     this.service = service;
     this.actionTimelineService = actionTimelineService;
     this.actionService         = actionService;
 }
 public PartnerActionMapFactory(IPartnerActionMapService service, IPartnerService partnerService, IActionService actionService, IMapper mapper)
 {
     _service        = service;
     _partnerService = partnerService;
     _actionService  = actionService;
     _mapper         = mapper;
 }
Ejemplo n.º 12
0
        public void GetAllActionOk()
        {
            IActionService service    = GetActionService();
            string         allActions = service.ActionsToString();

            Assert.AreEqual("City,Road,Village,Country,County,AmenityType,AmenityName,Date,DateTime,Time,YearMonth,Noop", allActions);
        }
Ejemplo n.º 13
0
        public OutputPathControl()
        {
            DataContext = this;
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.actionService         = new DesignerActionService();
                this.appSettingService     = new DesignerAppSettingService();
                this.audioRecordingService = new DesignerAudioRecordingService();
                this.selectedFileService   = new DesignerSelectedFileService();

                OutputPathWithFilePattern = audioRecordingService.GetTargetPathTemplateString();
                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.actionService         = UnityHandler.UnityContainer.Resolve <IActionService>();
                this.appSettingService     = UnityHandler.UnityContainer.Resolve <IAppSettingService>();
                this.audioRecordingService = UnityHandler.UnityContainer.Resolve <IAudioRecordingService>();

                SelectedFileService = UnityHandler.UnityContainer.Resolve <ISelectedFileService>();

                appSettingService.PropertyChanged += AppSettingService_PropertyChanged;

                UpdateOutputPathWithFileNamePattern();
            }
        }
Ejemplo n.º 14
0
 public RoleController(IRoleService roleService, IActionService actionService, IFunctionService functionService, IActionRoleService acctionRoleService)
 {
     _roleService        = roleService;
     _actionService      = actionService;
     _functionService    = functionService;
     _acctionRoleService = acctionRoleService;
 }
Ejemplo n.º 15
0
 public ClientController(IActionService As, IClientService clientservice, IResellerService resellerservice, IRoleService Rs, ISubscriptionsService SS)
 {
     this.ActionService       = As;
     this.ClientService       = clientservice;
     this.ResellerService     = resellerservice;
     this.RoleService         = Rs;
     this.SubscriptionService = SS;
 }
Ejemplo n.º 16
0
        public void HasAllActionWithEmptyActions()
        {
            string[]       actions      = new string[0];
            IActionService service      = GetActionService();
            bool           hasAllAction = service.HasNoExistAction(actions);

            Assert.IsFalse(hasAllAction);
        }
Ejemplo n.º 17
0
        public void HasAllActionKo()
        {
            string[]       actions      = new[] { "City", "Invented", "Road", "YearMonth" };
            IActionService service      = GetActionService();
            bool           hasAllAction = service.HasNoExistAction(actions);

            Assert.IsTrue(hasAllAction);
        }
Ejemplo n.º 18
0
        public void HasAllActionWithVerticalBar()
        {
            string[]       actions      = new[] { $"Country{Config.AlternativeCharacter}City", "Road", "YearMonth" };
            IActionService service      = GetActionService();
            bool           hasAllAction = service.HasNoExistAction(actions);

            Assert.IsFalse(hasAllAction);
        }
Ejemplo n.º 19
0
 public ApiController(IDBContext dbContext, IDiagramService diagramService, IActionService actionService, IMainNotifier mainNotifier, ILogger <ApiController> logger)
 {
     _dbContext      = dbContext;
     _diagramService = diagramService;
     _actionService  = actionService;
     _mainNotifier   = mainNotifier;
     _logger         = logger;
 }
Ejemplo n.º 20
0
 public UsedActionFactory(IUsedActionService service, IPartnerService partnerService, IActionService actionService, IUserService userService, IMapper mapper)
 {
     _service        = service;
     _partnerService = partnerService;
     _actionService  = actionService;
     _mapper         = mapper;
     _userService    = userService;
 }
Ejemplo n.º 21
0
        public ActionController(IActionService ActionService)

        {
            //_logger = logger;
            //_mediator = mediator;
            //_cache = cache;
            _ActionService = ActionService;
        }
Ejemplo n.º 22
0
        public EngineService(IActionService actionService, IEngineConfiguration engineConfiguration)
        {
            _actionService = actionService;

            _engineConfiguration = engineConfiguration;

            _runtime = WorkflowRuntimeFactory();
        }
Ejemplo n.º 23
0
 public WorkOrderController(IWorkService workService, UserManager <AppUser> userManager, IActionService actionService, INotificationService notificationService,
                            IMapper mapper) : base(userManager)
 {
     _workService         = workService;
     _actionService       = actionService;
     _notificationService = notificationService;
     _mapper = mapper;
 }
 public PermissionController()
 {
     _spService             = StructureMap.ObjectFactory.GetInstance <ISpService>();
     _permissionService     = StructureMap.ObjectFactory.GetInstance <IPermissionService>();
     _rolePermissionService = StructureMap.ObjectFactory.GetInstance <IRolePermissionService>();
     _actionCategoryService = StructureMap.ObjectFactory.GetInstance <IActionCategoryService>();
     _actionService         = StructureMap.ObjectFactory.GetInstance <IActionService>();
 }
 public AccountController(IActionService As, IRoleService Rs, IClientService Cs, IResellerService ResellerServ, ISubscriptionsService SS)
 {
     ActionService        = As;
     roleService          = Rs;
     ClientService        = Cs;
     ResellerService      = ResellerServ;
     SubscriptionsService = SS;
 }
Ejemplo n.º 26
0
 public RentANewApartment(IProjectService projectService, IActionService actionService, IActionListService actionListService, IOutputSink output, ISomeSingletonService someSingletonService)
 {
     this.projectService       = projectService;
     this.actionService        = actionService;
     this.actionListService    = actionListService;
     this.output               = output;
     this.someSingletonService = someSingletonService;
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Creating constructor for users controller for accessing
 /// </summary>
 /// <param name="userService">userService</param>
 /// <param name="tourService">tourService</param>
 /// <param name="actionService">actionService</param>
 /// <param name="cachingService">cachingService</param>
 public UserController(IUserService userService, ITourService tourService,
                       IActionService actionService, ICachingService cachingService, ICampaignService campaignService)
 {
     this.userService     = userService;
     this.tourService     = tourService;
     this.actionService   = actionService;
     this.cachingService  = cachingService;
     this.campaignService = campaignService;
 }
 public SolutionListTreeViewService(IApplicationConfiguration applicationConfiguration, IApplicationStorageService applicationStorageService, IAreaTagCheckedListBoxService areaTagCheckedListBoxService, IActionService actionService)
 {
     _applicationStorageService    = applicationStorageService;
     _areaTagCheckedListBoxService = areaTagCheckedListBoxService;
     _actionService = actionService;
     _areaTagCheckedListBoxService.AreaTagCheckedListBoxCheckChanged += AreaTagCheckedListBoxService_AreaTagCheckedListBoxCheckChanged;
     _actionService.ActionRun     += ActionService_ActionRun;
     _actionService.ActionRefresh += ActionService_ActionRefresh;
 }
 public HomeController(ILogger <HomeController> logger, IPropertyService propertySvc, ITenancyService tenancySvc, IPersonService personSvc, IActionService actionSvc, UserManager <ApplicationUser> userManager)
 {
     _logger      = logger;
     _propertySvc = propertySvc;
     _tenancySvc  = tenancySvc;
     _personSvc   = personSvc;
     _actionSvc   = actionSvc;
     _userManager = userManager;
 }
 /// <summary>
 /// Default constructor for the background service.
 /// </summary>
 /// <param name="actionService"></param>
 /// <param name="options"></param>
 /// <param name="logger"></param>
 public ActionQueuingBackgroundService(
     IActionService actionService,
     IOptions <AutomationOptions> options,
     ILogger <ActionQueuingBackgroundService> logger)
 {
     _service = actionService;
     _options = options.Value;
     _logger  = logger;
 }
        public MakeStuffActionableViewModel(IMvxMessenger mvxMessenger,
                                            IInboxService inboxService,
                                            IProjectService projectService,
                                            IActionService actionService)
        {
            _mvxMessenger = mvxMessenger;
            _inboxService = inboxService;
            _projectService = projectService;
            _actionService = actionService;

            ReloadProjects();

            // subscribe to Projects Changed messages to react to changes in project service
            _projectsChangedSubToken =
                _mvxMessenger.Subscribe<ProjectsChangedMessage>(OnProjectsChanged);

            _isSingleActionProject = true;
        }
Ejemplo n.º 32
0
 public ActionController( IActionService actionService)
 {
     this.actionService = actionService;
 }
Ejemplo n.º 33
0
 public RoleController( IRoleService roleservice,IActionService actionservice )
 {
     this.roleService = roleservice;
     this.actionService = actionservice;
 }
Ejemplo n.º 34
0
 public RoleService(IUnitOfWork db, IActionService ActionService)
 {
     this.db = db;
     this.ActionService = ActionService;
 }
 public SearchActionViewModelFactory(IActionService actionService, IActionPlanService actionPlanService, IEmployeeService employeeService)
 {
     _actionService = actionService;
     _actionPlanService = actionPlanService;
     _employeeService = employeeService;
 }
 public AssignActionPlanTaskCommand(IActionService actionService, IBusinessSafeSessionManager businessSafeSessionManager )
 {
     _actionService = actionService;
     _businessSafeSessionManager = businessSafeSessionManager;
 }
 public ReassignActionTaskViewModelFactory(IActionService actionService, IExistingDocumentsViewModelFactory existingDocumentsViewModelFactory, IActionTaskService actionTaskService)
 {
     _actionTaskService = actionTaskService;
     _actionService = actionService;
     _existingDocumentsViewModelFactory = existingDocumentsViewModelFactory;
 }