/// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="logger">ILogger</param>
 /// <param name="service">Сервис для работы с запросами к БД</param>
 /// <param name="context">Контекст БД</param>
 public WebServiceControllerBase(ILogger <WebServiceControllerBase> logger, IQueryService service, TransneftDbContext context)
 {
     Logger               = new Log(logger);
     QueryService         = service;
     QueryService.Context = context;
     RequestId            = Guid.NewGuid();
 }
        public Gatekeeper(IQueryService service)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            _service = service;
        }
        public DefaultUnitiniumLuaRuntime(IQueryService query)
        {
            Executions   = new List <LuaRuntimeExecution>();
            GlobalScript = new Script();

            UserData.RegisterType <GameObject>();
            UserData.RegisterType <Debug>();
            UserData.RegisterType <Type>();
            UserData.RegisterType <IQueryService>();
            UserData.RegisterType <SceneNode>();
            UserData.RegisterType <LuaRuntimeExecution>();
            UserData.RegisterType <LuaCoroutineYield>();
            UserData.RegisterType <WaitLuaCoroutineYield>();


            GlobalScript.Globals["GameObject"] = UserData.CreateStatic <GameObject>();
            GlobalScript.Globals["Debug"]      = UserData.CreateStatic <Debug>();
            GlobalScript.Globals["Type"]       = UserData.CreateStatic <Type>();
            GlobalScript.Globals["query"]      = query;
            GlobalScript.Globals["yield"]      = GlobalScript.DoString(@"return |_| coroutine.yield(_)");
            GlobalScript.Globals["__wait_s"]   = (Func <float, LuaCoroutineYield>)((s) => new WaitLuaCoroutineYield(s));
            GlobalScript.Globals["wait_s"]     = GlobalScript.DoString(@"return |_| yield(__wait_s(_))");

            Script.GlobalOptions
            .CustomConverters
            .SetScriptToClrCustomConversion(DataType.Table, typeof(IDictionary <object, object>),
                                            v => {
                return(v.Table.Pairs.ToDictionary(k => k.Key.ToObject(), vo => vo.Value.ToObject()));
            }
                                            );
        }
Ejemplo n.º 4
0
        public async Task SetUp()
        {
            var dataManager = new DataManager();
            var users       = await dataManager.PrepareDataForQuerying().ConfigureAwait(false);

            _queryService = new QueryService(users);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Theater controller constructor. Should only be used by IoC container and tests.
 /// </summary>
 /// <param name="messageBus">The message bus dependency, used to send commands</param>
 /// <param name="queryService">The query service dependency, used to obtain data</param>
 public TheaterController(
     IMessageBus messageBus,
     IQueryService queryService)
 {
     _messageBus = messageBus;
     _queryService = queryService;
 }
 public SingularityController(ICommandService commandService, IQueryService queryService, ILogger logger, ApiClientRegistrations apiClientRegistrations)
 {
     _commandService         = commandService;
     _queryService           = queryService;
     _logger                 = logger;
     _apiClientRegistrations = apiClientRegistrations;
 }
 public BaseViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
 {
     _MainWindow = mainWindow;
     _CommandService = commandService;
     _QueryService = queryService;
     _Logger = logger;
 }
        public WeatherInfoViewModel(INavigationService navigationService, IRestService restService,
                                    IQueryService queryService,
                                    ISettingsService settingsService, ILocationService locationService, IPopupNavigation popupNavigation)
        {
            Debug.WriteLine("GOT TO CON");
            CityWeatherViewModels = new ObservableCollection <CityWeatherViewModel>();

            _restService       = restService;
            _navigationService = navigationService;
            _queryService      = queryService;
            _settingsService   = settingsService;
            _locationService   = locationService;
            _popupNavigation   = popupNavigation;

            _getCurrentCityCommand = new Command(async() => await GetCurrentCity());

            GetWeatherCommand = new Command(async() => await GetWeatherInfo());

            MessagingCenter.Unsubscribe <string>(this, "NewAdded");
            MessagingCenter.Subscribe <string>(this, "NewAdded", AddCity);

            MessagingCenter.Unsubscribe <string>(this, "DeleteCity");
            MessagingCenter.Subscribe <string>(this, "DeleteCity", DeleteCity);

            Task.Run(async() => await CheckPermissionsAndContinue());
        }
        public PerformanceQueryServiceDecorator(
            IEfRepository <PerformanceEntry> performanceRepository,
            IEfDbContextSaveChanges contextSaveChanges,
            IDateTimeProvider timeProvider,
            IQueryService <TQuery, TResult> decoratee)
        {
            if (performanceRepository is null)
            {
                throw new ArgumentNullException(nameof(performanceRepository));
            }

            if (contextSaveChanges is null)
            {
                throw new ArgumentNullException(nameof(contextSaveChanges));
            }

            if (timeProvider is null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            if (decoratee is null)
            {
                throw new ArgumentNullException(nameof(decoratee));
            }

            this.performanceRepository = performanceRepository;
            this.contextSaveChanges    = contextSaveChanges;
            this.timeProvider          = timeProvider;
            this.decoratee             = decoratee;
        }
 public MainWindowViewModel(IQueryService queryService, IFileExporterFactory fileExporterFactory)
 {
     _queryService        = queryService;
     _fileExporterFactory = fileExporterFactory;
     SearchCommand        = new RelayCommand(SearchLog, CanExecuteSearchCommand);
     ExportCommand        = new RelayCommand(ExportLog, CanExecuteExportCommand);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocatableStationService"/> class.
 /// </summary>
 /// <param name="locationQueryService">The service to get the location.</param>
 /// <param name="dataQueryService">The service to get the transportation data.</param>
 public LocatableStationService(
     ILocationQueryService locationQueryService,
     IQueryService dataQueryService)
 {
     this.locationQueryService = locationQueryService;
     this.dataQueryService     = dataQueryService;
 }
Ejemplo n.º 12
0
        public EditTaskViewModel(Task task, IQueryService <Task> taskQueryService, IQueryService <TaskState> taskStateQueryService)
        {
            _task     = task;
            TaskState = taskStateQueryService.GetByKey(task.State);

            var brushConverter = new BrushConverter();

            TaskStateColor = (Brush)brushConverter.ConvertFromString(TaskState.Color);

            _taskQueryService    = taskQueryService;
            _okCommand           = new RelayCommand(OnOkClick);
            _addTaskStateCommand = new RelayCommand(OnAddTaskStateClick);
            _deleteCommand       = new RelayCommand(OnDeleteClick);

            SelectUsersViewModel        = new SelectUsersViewModel(true);
            SelectTaskPriorityViewModel = new SelectTaskPriorityViewModel();

            _content = _task.Content;
            foreach (var user in _task.AssignedMembers)
            {
                SelectUsersViewModel.SelectedUsers.Add(user);
            }
            SelectTaskPriorityViewModel.SelectedTaskPriority = _task.Priority;
            SelectTaskPriorityViewModel.PropertyChanged     += SelectTaskPriorityViewModelOnPropertyChanged;
        }
Ejemplo n.º 13
0
        public CacheQueryServiceProxy(
            IQueryService <TQuery, TResult> queryService,
            ICacheManager cacheManager,
            IUserContext userContext,
            CacheOptions options)
        {
            if (cacheManager is null)
            {
                throw new ArgumentNullException(nameof(cacheManager));
            }

            if (userContext is null)
            {
                throw new ArgumentNullException(nameof(userContext));
            }

            if (queryService is null)
            {
                throw new ArgumentNullException(nameof(queryService));
            }

            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            this.queryService = queryService;
            this.cacheManager = cacheManager;
            this.userContext  = userContext;
            this.options      = options;
        }
Ejemplo n.º 14
0
 protected AbstractQueryViewModel(string queryCode, string profileKey)
 {
     QueryCode       = queryCode;
     this.profileKey = profileKey;
     queryService    = ApplicationContext.ComponentContext.Resolve <IQueryService>();
     Columns         = new DataGridColumn[0];
 }
        /// <summary>
        /// 存储所需修改IssueReceiptD的数据集合的临时表
        /// </summary>
        private IDataEntityType CreateDTmpTable(IQueryService qrySrv)
        {
            string typeName = "Temp_UpdateSalesIssueD_" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            #region 字段

            defaultType.RegisterSimpleProperty("item_no", businessSrv.SimpleItemCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemCode });

            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.SimpleItemFeatureType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemFeature });

            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.SimpleUnitCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleUnitCode });

            defaultType.RegisterSimpleProperty("doc_no", businessSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { businessSrv.SimpleDocNo });

            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(Int32), 0, false, new Attribute[] { tempAttr });

            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });

            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });

            defaultType.RegisterSimpleProperty("lot_no", businessSrv.SimpleLotCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleLotCode });

            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.SimpleQuantityType, 0M, false, new Attribute[] { businessSrv.SimpleQuantity });

            tempAttr = new SimplePropertyAttribute(GeneralDBType.String, 1000);
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            #endregion

            qrySrv.CreateTempTable(defaultType);
            return(defaultType);
        }
Ejemplo n.º 16
0
 public EpgpModule(
     IPriorityReportingService priorityReportingService,
     IQueryService queryService,
     IEpgpService epgpService,
     IAuditService auditService,
     IEpgpCalculator epgpCalculator,
     IEpgpConfigurationService epgpConfigurationService,
     IPageService pageService,
     IDocumentationService documentationService,
     IEmoteService emoteService,
     IAliasService aliasService,
     IItemService itemService,
     IRaidService raidService,
     IAdministrationService administrationService,
     BuzzBotDbContext dbContext, IUserService userService, IMapper mapper, IDecayProcessor decayProcessor)
 {
     _priorityReportingService = priorityReportingService;
     _queryService             = queryService;
     _epgpService              = epgpService;
     _auditService             = auditService;
     _epgpCalculator           = epgpCalculator;
     _epgpConfigurationService = epgpConfigurationService;
     _pageService              = pageService;
     _documentationService     = documentationService;
     _emoteService             = emoteService;
     _aliasService             = aliasService;
     _itemService              = itemService;
     _raidService              = raidService;
     _administrationService    = administrationService;
     _dbContext      = dbContext;
     _userService    = userService;
     _mapper         = mapper;
     _decayProcessor = decayProcessor;
 }
Ejemplo n.º 17
0
        private void ExecuteQuery()
        {
            string sql;

            if (SelectedText != null && SelectedText.Length > 0)
            {
                sql = SelectedText;
            }
            else
            {
                sql = QueryString;
            }

            if (CheckOnlySelectQuery(sql)) // We can't execute with UPDATE, DELETE, INSERT operators.
            {
                _queryService = new QueryService(_connectionString);
                try
                {
                    ExecuteResult = null;
                    ExecuteResult = _queryService.ExecuteQuery(sql);
                }
                catch (Exception ex)
                {
                    Ext.LogPanel.PrintLog(ex.Message.ToString());
                }
            }
            else
            {
                MessageBox.Show("В целях безопасности в приложении отключена возможность выполнять sql-запросы с операторами INSERT, UPDATE, DELETE");
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Reperimento formato file documentum
        /// </summary>
        /// <param name="queryService"></param>
        /// <param name="mimeType"></param>
        /// <returns></returns>
        public static string getDctmFileFormat(IQueryService queryService, string fileExtension)
        {
            string fileFormat = string.Empty;

            PassthroughQuery passthroughQuery = new PassthroughQuery();

            passthroughQuery.QueryString  = string.Format("SELECT name FROM dm_format WHERE dos_extension = '{0}'", replaceInvalidFileExtension(fileExtension).ToLower());
            passthroughQuery.Repositories = new List <string>();
            passthroughQuery.Repositories.Add(DctmConfigurations.GetRepositoryName());

            QueryExecution queryExecution = new QueryExecution();

            queryExecution.CacheStrategyType = CacheStrategyType.NO_CACHE_STRATEGY;
            queryExecution.MaxResultCount    = 1;

            QueryResult queryResult = queryService.Execute(passthroughQuery, queryExecution, null);

            if (queryResult.DataPackage.DataObjects != null &&
                queryResult.DataPackage.DataObjects.Count > 0)
            {
                DataObject dataObj = queryResult.DataPackage.DataObjects[0];

                fileFormat = ((StringProperty)dataObj.Properties.Properties[0]).Value;
            }

            return(fileFormat);
        }
Ejemplo n.º 19
0
        public static string getDctmObjectId(IQueryService querySvc, Qualification qualification)
        {
            string result = string.Empty;

            PassthroughQuery passthroughQuery = new PassthroughQuery();

            passthroughQuery.QueryString  = "SELECT r_object_id  FROM " + qualification.GetValueAsString();
            passthroughQuery.Repositories = new List <string>();
            passthroughQuery.Repositories.Add(DctmConfigurations.GetRepositoryName());

            QueryExecution queryExecution = new QueryExecution();

            queryExecution.CacheStrategyType = CacheStrategyType.NO_CACHE_STRATEGY;
            queryExecution.MaxResultCount    = 1;

            QueryResult queryResult = querySvc.Execute(passthroughQuery, queryExecution, null);

            if (queryResult.DataPackage.DataObjects != null && queryResult.DataPackage.DataObjects.Count > 0)
            {
                DataObject dataObj = queryResult.DataPackage.DataObjects[0];
                result = ((ObjectId)dataObj.Identity.Value).Id;
            }

            return(result);
        }
Ejemplo n.º 20
0
 public ListQueryHandler(
     IQueryRepository queryRepository,
     IQueryService queryService)
 {
     this.repository   = queryRepository;
     this.queryService = queryService;
 }
Ejemplo n.º 21
0
        /// <summary>
        /// 产生生产入库申请单
        /// </summary>
        /// <param name="employee_no">扫描人员</param>
        /// <param name="scan_type">扫描类型1.有箱条码 2.无箱条码</param>
        /// <param name="report_datetime">上传时间</param>
        /// <param name="picking_department_no">领料部门</param>
        /// <param name="recommended_operations">建议执行作业</param>
        /// <param name="recommended_function">A.新增  S.过帐</param>
        /// <param name="scan_doc_no">扫描单号</param>
        /// <param name="scanColl"></param>
        public DependencyObjectCollection InsertMOReceiptReq(string employee_no, string scan_type, DateTime report_datetime, string picking_department_no,
                                                             string recommended_operations, string recommended_function, string scan_doc_no, DependencyObjectCollection scanColl)
        {
            IInfoEncodeContainer infoContainer = GetService <IInfoEncodeContainer>();

            if (string.IsNullOrEmpty(recommended_operations))
            {
                throw new BusinessRuleException(string.Format(infoContainer.GetMessage("A111201"), "recommended_operations"));
            }
            if (string.IsNullOrEmpty(recommended_function))
            {
                throw new BusinessRuleException(string.Format(infoContainer.GetMessage("A111201"), "recommended_function"));
            }
            string category = "59";
            //20170209 add by liwei1 for P001-170203001 ===begin===
            object docId = QueryDocId(category, recommended_operations, scanColl);

            if (Maths.IsEmpty(docId))
            {
                throw new BusinessRuleException(infoContainer.GetMessage("A111275"));
            }
            //20170209 add by liwei1 for P001-170203001 ===end===
            UtilsClass utilsClass = new UtilsClass();
            DependencyObjectCollection resultColl = utilsClass.CreateReturnCollection();

            using (IConnectionService connectionService = this.GetService <IConnectionService>()) {
                _qurService = this.GetService <IQueryService>();
                CreateTempTable();
                InsertToScan(employee_no, picking_department_no, scanColl);
                InsertMR(report_datetime, category, recommended_operations, resultColl, docId);
            }
            return(resultColl);
        }
Ejemplo n.º 22
0
        public BotService(IOptions <BotConfig> config, IQueryService queryService, IUserService userService)
        {
            QueryService = queryService;
            UserService  = userService;
            _config      = config.Value;
            Client       = string.IsNullOrEmpty(_config.Socks5Host)
                ? new TelegramBotClient(_config.BotToken)
                : new TelegramBotClient(_config.BotToken, new HttpToSocks5Proxy(_config.Socks5Host, _config.Socks5Port));
            Console.WriteLine("Client created:{0} \n \t {1} \n \t {2}", _config.BotToken, _config.Socks5Host, _config.Socks5Port);


            //InitAsync = _SetWebhookAsync();
            //Add commands
            ActiveQuiz = new Dictionary <Int64, Quiz>();

            commandsList = new List <Command>();
            commandsList.Add(new HelloCommand());
            commandsList.Add(new StartQuizCommand());
            //commandsList.Add(new StopQuizCommand());
            commandsList.Add(new ScoreCommand());
            //commandsList.Add(new WoLCommand());

            foreach (var _sign in AstroSigns)
            {
                commandsList.Add(item: new AstrologyCommand(_sign));
            }
        }
 public CreateNewGameController(IPlayerAuthenticator player_authenticator,
                                IQueryService query_service,
                                ICommandBus command_bus)
 {
     _player_authenticator = player_authenticator;
     _command_bus          = command_bus;
 }
Ejemplo n.º 24
0
        public async Task <ActionResult <IEnumerable> > Post([FromBody] Predicate predicate)
        {
            IQueryService queryService = _queryServiceFactory.Create(predicate.EntityType);
            IEnumerable   data         = await queryService.QueryData(predicate.LambdaExpression, predicate.SelectedProperties);

            return(Ok(data));
        }
Ejemplo n.º 25
0
        public virtual async Task <IActionResult> Post([FromServices] IQueryService queryService, [FromServices] ISubNameResolver subNameResolver)
        {
            using (var stream = new StreamReader(Request.Body))
            {
                var result = await queryService.ExecuteAsync(stream.ReadToEnd(), subNameResolver.Resolve());

                switch (result.ErrorCode)
                {
                case QueryErrorCode.ValidationError:
                case QueryErrorCode.BadRequest:
                    return(BadRequest(result));

                case QueryErrorCode.InternalError:
                case QueryErrorCode.SyntaxError:
                case QueryErrorCode.Unknown:
                    return(StatusCode((int)HttpStatusCode.InternalServerError, result));

                case QueryErrorCode.Unauthorized:
                    return(Unauthorized());

                case QueryErrorCode.UnauthorizedOrNotFound:
                case QueryErrorCode.ActionNotFound:
                case QueryErrorCode.NotFound:
                case QueryErrorCode.QueryNotFound:
                case QueryErrorCode.SubQueryNotFound:
                    return(NotFound(result));

                default:
                    return(Ok(result));
                }
            }
        }
        public void ApplyCriteria(FilterRequest <T> request, IQueryService queryService)
        {
            var rule      = queryService.FilterRuleFor(request);
            var criterion = CriterionBuilder.CriterionForRule(rule);

            _projection.AddWhere(criterion);
        }
Ejemplo n.º 27
0
 public LootModule(IUserDataService userDataService, IServerRepository serverRepository,
                   IItemRepository itemRepository, IQueryService queryService) : base(userDataService)
 {
     _serverRepository = serverRepository;
     _itemRepository   = itemRepository;
     _queryService     = queryService;
 }
Ejemplo n.º 28
0
        public JsonApiRelationReadOnlyController(TIDataSource dataSource, IQueryService queryService)
        {
            this._datasource   = dataSource;
            this._queryService = queryService;

            this.PrimaryForeigneKeyProperty = AttributeRelationsHandling.FindForeignKeyPropertyFromType(typeof(TRessource), typeof(TRessourceRelation));
        }
Ejemplo n.º 29
0
 public AlternatesFactory(
     IQueryService queryService,
     ICurrentContentAccessor currentContentAccessor)
 {
     _queryService           = queryService;
     _currentContentAccessor = currentContentAccessor;
 }
Ejemplo n.º 30
0
 public TaskStateChangeViewModel(string oldValue, string newValue, IQueryService <TaskState> taskStateQueryService)
     : base(oldValue, newValue)
 {
     OldTaskState = null;
     NewTaskState = null;
     TryResolveTaskStates(taskStateQueryService);
 }
 public CreateNewGameController(IPlayerAuthenticator player_authenticator, 
                                IQueryService query_service,
                                ICommandBus command_bus)
 {
     _player_authenticator = player_authenticator;                                    
     _command_bus = command_bus;
 }
 public QueryServiceDemo(String defaultRepository, String secondaryRepository, String userName, String password)
     : base(defaultRepository, secondaryRepository, userName, password)
 {
     ServiceFactory serviceFactory = ServiceFactory.Instance;
     queryService =
         serviceFactory.GetRemoteService<IQueryService>(DemoServiceContext);
 }
Ejemplo n.º 33
0
        public TaskStateColumnViewModel(TaskState taskState,
                                        IQueryService <TaskState> taskStateQueryService,
                                        FiltersViewModel filtersViewModel, int number,
                                        bool isOpened, bool canMoveLeft, bool canMoveRight)
        {
            _taskStateQueryService = taskStateQueryService;
            _filtersViewModel      = filtersViewModel;
            _isOpened = isOpened;

            var brushConverter = new BrushConverter();

            TaskStateColor = (Brush)brushConverter.ConvertFromString(taskState.Color);
            TaskState      = taskState;

            _addTaskCommand         = new RelayCommand(OnAddTaskCommand);
            _showColumnCommand      = new RelayCommand(OnShowColumnCommand);
            _hideColumnCommand      = new RelayCommand(OnHideColumnCommand);
            _moveColumnLeftCommand  = new RelayCommand(OnMoveColumnLeftCommand);
            _moveColumnRightCommand = new RelayCommand(OnMoveColumRightCommand);
            _deleteTaskStateCommand = new RelayCommand(OnDeleteTaskStateCommand);

            CanMoveLeft  = canMoveLeft;
            CanMoveRight = canMoveRight;

            Tasks = new ObservableCollection <TaskDetailsViewModel>();
            Tasks.CollectionChanged          += (sender, args) => RaisePropertyChanged("CanBeDeleted");
            _filtersViewModel.FiltersUpdated += FiltersViewModelOnFiltersUpdated;
            SetBackground(number);
        }
        private string GetMultiOrgnNameValues(string orgIdStrings)
        {
            List <string> list   = new List <string>();
            string        result = string.Empty;

            if (orgIdStrings.Trim().Length > 0)
            {
                IQueryService         service = Kingdee.BOS.Contracts.ServiceFactory.GetService <IQueryService>(base.Context);
                QueryBuilderParemeter para    = new QueryBuilderParemeter
                {
                    FormId              = "ORG_Organizations",
                    SelectItems         = SelectorItemInfo.CreateItems("FNAME"),
                    FilterClauseWihtKey = string.Format(" FORGID IN ({0}) AND FLOCALEID={1}", orgIdStrings, base.Context.UserLocale.LCID)
                };
                DynamicObjectCollection dynamicObjectCollection = service.GetDynamicObjectCollection(base.Context, para, null);
                foreach (DynamicObject current in dynamicObjectCollection)
                {
                    list.Add(current["FNAME"].ToString());
                }
                if (list.Count > 0)
                {
                    result = string.Join(",", list.ToArray());
                }
            }
            return(result);
        }
Ejemplo n.º 35
0
 public ObjectSelectorBox(Parameter parameter) : base(parameter)
 {
     queryService = ApplicationContext.ComponentContext.Resolve <IQueryService>();
     queryCode    = parameter.subQueryCode;
     CommandBindings.Add(new CommandBinding(InputBox.Browse, BrowseCommandExecuted));
     InputBindings.Add(new KeyBinding(InputBox.Browse, Key.PageDown, ModifierKeys.None));
 }
Ejemplo n.º 36
0
 public CashInController(IPlayerAuthenticator player_authenticator, 
                         ICommandBus command_bus,
                         IQueryService query_service)
 {
     _player_authenticator = player_authenticator;
     _command_bus = command_bus;
     _query_service = query_service;
 }
 public static IQueryService GetQueryService()
 {
     if(queryService == null)
     {
         queryService = new QueryService();
     }
     return queryService;
 }
        public ViewGameResultsViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
            : base(commandService, queryService, mainWindow, logger)
        {
            CloseCommand = new RelayCommand(x => this.Close());

            Height = 400;
            WindowTitle = "View Game Results";
        }
Ejemplo n.º 39
0
	    public Migrations(IMenuService menuService, IContentManager contentManager, IQueryService queryService, IMembershipService membershipService, IRoleService roleService)
		{
			_menuService = menuService;
			_contentManager = contentManager;
			_queryService = queryService;
			_membershipService = membershipService;
		    _roleService = roleService;
		}
Ejemplo n.º 40
0
		public PageCommandsController(
			ICommandService commandService,
			IQueryService queryService
			)
		{
			_commandService = commandService;
			_queryService = queryService;
		}
        public RoleManagerUnAssignModel( IQueryService<Role> queryRole,
            IQueryService<Permission> queryFunction,
            ISaveOrUpdateCommand<Role> updateRole)
        {
            this.queryFunction = queryFunction;
            this.queryRole = queryRole;

            this.updateRole = updateRole;
        }
 public ProgressPageViewModel(IQueryService progressListService)
 {
     this._queryService = progressListService;
     NavigatedToCommand = new RelayCommand<object>((e) =>
       {
           LoadProgressList(Convert.ToInt64(e));
       });
    
 }
Ejemplo n.º 43
0
        public FunctionRightsService( HttpContextBase httpContext,
            IQueryService<Permission> queryFunctions,
            IQueryService<User> queryEmployees)
        {
            this.queryFunctions = queryFunctions;
            this.queryEmployees = queryEmployees;

            this.employeeName = httpContext.User.Identity.Name;
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PostController"/> class.
        /// </summary>
        /// <param name="tagQueryService">The query service used to retrieve the <see cref="Tag"/> items to display.</param>
        /// <exception cref="ArgumentNullException"><paramref name="tagQueryService"/> is null.</exception>
        public TagController(IQueryService<Tag> tagQueryService)
        {
            if (tagQueryService == null)
            {
                throw new ArgumentNullException("tagQueryService");
            }

            this.tagQueryService = tagQueryService;
        }
Ejemplo n.º 45
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PostController"/> class.
        /// </summary>
        /// <param name="postQueryService">The query service used to retrieve the <see cref="Post"/> items to display.</param>
        /// <exception cref="ArgumentNullException"><paramref name="postQueryService"/> is null.</exception>
        public PostController(IQueryService<Post> postQueryService)
        {
            if (postQueryService == null)
            {
                throw new ArgumentNullException("postQueryService");
            }

            this.postQueryService = postQueryService;
        }
Ejemplo n.º 46
0
        public UserManagerAssignModel( IQueryService<Role> queryRole,
            IQueryService<User> queryEmployee,
            ISaveOrUpdateCommand<User> updateRole)
        {
            this.queryEmployee = queryEmployee;
            this.queryRole = queryRole;

            this.updateEmployee = updateRole;
        }
        public with_a_BetController()
        {
            player_authenticator = MockRepository.GenerateStub<IPlayerAuthenticator>();
            command_bus = MockRepository.GenerateStub<ICommandBus>();
            query_service = MockRepository.GenerateStub<IQueryService>();
            bet_command_mapper = MockRepository.GenerateStub<ICommandMapper<BetCommand, BetView>>();

            SUT = new BetController(player_authenticator, command_bus, query_service, bet_command_mapper);
        }
Ejemplo n.º 48
0
 public BetController(IPlayerAuthenticator player_authenticator, 
                      ICommandBus command_bus,
                      IQueryService query_service,
                      ICommandMapper<BetCommand, BetView> bet_command_mapper)
 {
     _player_authenticator = player_authenticator;
     _command_bus = command_bus;
     _query_service = query_service;
     _bet_command_mapper = bet_command_mapper;
 }
        public PlayerGamesViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
            : base(commandService, queryService, mainWindow, logger)
        {
            CloseCommand = new RelayCommand(x => Close());
            RenamePlayerCommand = new RelayCommand(x => RenamePlayer(), x => CanRenamePlayer());

            Height = 400;
            Width = 385;
            WindowTitle = "View Player Games";
        }
Ejemplo n.º 50
0
        static ViewModelLocator()
        {
            ServiceLocator.Default.RegisterSingleton<IMenusService, MenusService>();
            menusService = ServiceLocator.Default.Resolve<IMenusService>();

            ServiceLocator.Default.RegisterSingleton<IDeptService, DeptService>();
            deptService = ServiceLocator.Default.Resolve<IDeptService>();

            ServiceLocator.Default.RegisterSingleton<IQueryService, QueryService>();
            queryService = ServiceLocator.Default.Resolve<IQueryService>();
        }
Ejemplo n.º 51
0
        static void Main(string[] args)
        {
            using(var webService = new AutotaskWebService())
            {
                _service = new BasicQueryService(webService: webService);
                var gatekeeper = new Gatekeeper(_service);
                gatekeeper.TryLoginUntilSuccess();

                LoopInCommandModeUntilExitRequest();
            }
        }
        public PlayerStatisticsViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
            : base(commandService, queryService, mainWindow, logger)
        {
            _players = new ObservableCollection<GetPlayerStatisticsDto>(_QueryService.GetPlayerStatistics());

            GamesCommand = new RelayCommand(x => NavigateToGamesView());
            PlayerDoubleClickCommand = new RelayCommand(x => PlayerDoubleClick());

            Height = 400;
            Width = 500;
            WindowTitle = "Player Statistics";
        }
        public UserService(IQueryService queryService, Lazy<ICommandBus> commandBus)
        {
            if (queryService == null)
            {
                throw new ArgumentNullException("queryService");
            }
            if (commandBus == null)
            {
                throw new ArgumentNullException("commandBus");
            }

            this.queryService = queryService;
            this.commandBus = commandBus;
        }
Ejemplo n.º 54
0
        public Migrations(IMenuService menuService,
                          IContentManager contentManager,
                          IQueryService queryService,
                          IWidgetsService widgetsService,
                          ITaxonomyService taxonomyService,
                            IProjectionManager projectionManager) {

            _menuService = menuService;
            _contentManager = contentManager;
            _queryService = queryService;
            _widgetsService = widgetsService;
            _taxonomyService = taxonomyService;
            _projectionManager = projectionManager;
        }
Ejemplo n.º 55
0
 public LayoutController(
     IOrchardServices services,
     IFormManager formManager,
     IShapeFactory shapeFactory,
     IProjectionManager projectionManager,
     IRepository<LayoutRecord> repository,
     IQueryService queryService) {
     Services = services;
     _formManager = formManager;
     _projectionManager = projectionManager;
     _repository = repository;
     _queryService = queryService;
     Shape = shapeFactory;
 }
        public ViewGamesListViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
            : base(commandService, queryService, mainWindow, logger)
        {
            _games = new ObservableCollection<GetGamesListDto>(_QueryService.GetGamesList());

            PlayersCommand = new RelayCommand(x => NavigateToPlayersView());
            AddGameCommand = new RelayCommand(x => AddGame());
            DeleteGameCommand = new RelayCommand(x => DeleteGame(), x => CanDeleteGame());
            GameDoubleClickCommand = new RelayCommand(x => GameDoubleClick());

            Height = 400;
            Width = 385;
            WindowTitle = "View Games";
        }
 public JobFeatureEventhandler(IMenuService menuService,
                   IContentManager contentManager,
                   IQueryService queryService,
                   IWidgetsService widgetsService,
                   ITaxonomyService taxonomyService,
                     IProjectionManager projectionManager)
 {
     _menuService = menuService;
     _contentManager = contentManager;
     _queryService = queryService;
     _widgetsService = widgetsService;
     _taxonomyService = taxonomyService;
     _projectionManager = projectionManager;
 }
        public EnterGameResultsViewModel(ICommandService commandService, IQueryService queryService, IMainWindow mainWindow, ILog logger)
            : base(commandService, queryService, mainWindow, logger)
        {
            ResetPlayerCommands();

            AddPlayerCommand = new RelayCommand(x => this.AddPlayer(), x => this.CanAddPlayer());
            DeletePlayerCommand = new RelayCommand(x => this.DeletePlayer(), x => this.CanDeletePlayer());
            SaveGameCommand = new RelayCommand(x => this.SaveGame(), x => this.CanSaveGame());
            CancelCommand = new RelayCommand(x => this.Cancel());

            ClearNewPlayer();

            Height = 400;
            WindowTitle = "Enter Game Results";
        }
Ejemplo n.º 59
0
 public SortCriterionController(
     IOrchardServices services,
     IFormManager formManager,
     IShapeFactory shapeFactory,
     IProjectionManager projectionManager,
     IRepository<SortCriterionRecord> repository,
     IQueryService queryService,
     ISortService sortService) {
     Services = services;
     _formManager = formManager;
     _projectionManager = projectionManager;
     _repository = repository;
     _queryService = queryService;
     _sortService = sortService;
     Shape = shapeFactory;
 }
Ejemplo n.º 60
0
 public FilterController(
     IOrchardServices services,
     IFormManager formManager,
     IShapeFactory shapeFactory,
     IProjectionManager projectionManager,
     IRepository<FilterRecord> repository,
     IRepository<FilterGroupRecord> groupRepository,
     IQueryService queryService) {
     Services = services;
     _formManager = formManager;
     _projectionManager = projectionManager;
     _repository = repository;
     _groupRepository = groupRepository;
     _queryService = queryService;
     Shape = shapeFactory;
 }