/// <summary> /// Get account for selected user. /// </summary> /// <param name="id">Id of account</param> /// <param name="userId">Id of current user</param> /// <param name="needCheckUserId">Check if account should be created by current user</param> /// <returns></returns> public static Account GetAccount(IRepositoryFactory factory, long id, string userId, bool needCheckUserId) { var account = factory.AccountRepository.FindById(id); if ((account == null) || (needCheckUserId && account.UserId != userId)) return null; return account; }
public CatalogPromotionViewModel( IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory, IRepositoryFactory<IMarketingRepository> repositoryFactory, IRepositoryFactory<ICatalogRepository> catalogRepositoryFactory, IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory, IViewModelsFactory<ISearchCategoryViewModel> searchCategoryVmFactory, IViewModelsFactory<ISearchItemViewModel> searchItemVmFactory, IRepositoryFactory<IShippingRepository> shippingRepositoryFactory, IMarketingEntityFactory entityFactory, INavigationManager navManager, Promotion item) : base(appConfigRepositoryFactory, repositoryFactory, entityFactory, navManager, item, false, searchCategoryVmFactory, searchItemVmFactory, shippingRepositoryFactory) { _catalogRepositoryFactory = catalogRepositoryFactory; _pricelistRepositoryFactory = pricelistRepositoryFactory; ViewTitle = new ViewTitleBase { Title = "Promotion", SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name.ToUpper(CultureInfo.InvariantCulture) : string.Empty }; }
public ServiceManager(IRepositoryFactory repositoryFactory ) { _repositoryFactory = repositoryFactory; _shouldstop = false; _wifiManager=new WiFiManager(JimbeWiFi.NativeApiVersion.windowsVista); _locationManager = new LocationManager(); }
public PropertyViewModel(IViewModelsFactory<IPropertyValueViewModel> propertyValueVmFactory, IViewModelsFactory<IPropertyAttributeViewModel> attributeVmFactory, ICatalogEntityFactory entityFactory, Property item, catalogModel.Catalog parentCatalog, IRepositoryFactory<ICatalogRepository> repositoryFactory, ObservableCollection<Property> properties) { InnerItem = item; _propertyValueVmFactory = propertyValueVmFactory; _attributeVmFactory = attributeVmFactory; _entityFactory = entityFactory; _properties = properties; ParentCatalog = parentCatalog; // _repositoryFactory = repositoryFactory; ValueAddCommand = new DelegateCommand(RaiseValueAddInteractionRequest); ValueEditCommand = new DelegateCommand<PropertyValueBase>(RaiseValueEditInteractionRequest, x => x != null); ValueDeleteCommand = new DelegateCommand<PropertyValueBase>(RaiseValueDeleteInteractionRequest, x => x != null); AttributeAddCommand = new DelegateCommand(RaiseAttributeAddInteractionRequest); AttributeEditCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeEditInteractionRequest, x => x != null); AttributeDeleteCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeDeleteInteractionRequest, x => x != null); CommonConfirmRequest = new InteractionRequest<Confirmation>(); var allValueTypes = (PropertyValueType[])Enum.GetValues(typeof(PropertyValueType)); PropertyTypes = new List<PropertyValueType>(allValueTypes); PropertyTypes.Sort((x, y) => x.ToString().CompareTo(y.ToString())); }
public LabelsSettingsViewModel(IViewModelsFactory<ILabelViewModel> labelVmFactory, IRepositoryFactory<ICustomerRepository> repositoryFactory) { _repositoryFactory = repositoryFactory; _labelVmFactory = labelVmFactory; CommandsInit(); }
public ViewModelFactory(IRepositoryFactory repositoryFactory, IImportManagerFactory importManagerFactory) { repositoryFactory.ThrowIfNull("repositoryFactory"); importManagerFactory.ThrowIfNull("importManagerFactory"); this.repositoryFactory = repositoryFactory; this.importManagerFactory = importManagerFactory; }
public CompilationsService(IRepositoryFactory repositoryFactory) { if(repositoryFactory == null) throw new ArgumentNullException(nameof(repositoryFactory)); _compilationRepository = repositoryFactory.CreateCompilationRepository(); }
public MainFulfillmentViewModel( IInventoryHomeViewModel inventoryVm, IPicklistHomeViewModel picklistVm, IRmaHomeViewModel rmaVm, IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, IOrderService orderService, IAuthenticationContext authContext) { ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" }; _inventoryHomeVm = inventoryVm; _inventoryHomeVm.ParentViewModel = this; _picklistHomeVm = picklistVm; _picklistHomeVm.ParentViewModel = this; _rmaHomeVm = rmaVm; _rmaHomeVm.ParentViewModel = this; _completeShipmentVmFactory = completeShipmentVmFactory; _orderRepositoryFactory = orderRepositoryFactory; _authContext = authContext; _orderService = orderService; PopulateTabItems(); CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment); CommonConfirmRequest = new InteractionRequest<Confirmation>(); CommonNotifyRequest = new InteractionRequest<Notification>(); }
public StoreLocalizationStepViewModel(IStoreEntityFactory entityFactory, Store item, IRepositoryFactory<IStoreRepository> repositoryFactory, IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory) : base(repositoryFactory, entityFactory, item) { _appConfigRepositoryFactory = appConfigRepositoryFactory; }
public ConfigSetTask(IRepositoryFactory repositoryFactory, IEnvironmentTasks environmentTasks) { this.cacheController = cacheController; this.environmentTasks = environmentTasks; Repository = repositoryFactory.GetRepository(); Repository.SavingChanges += SavingChanges; }
public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory<IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory<IEmailDialogViewModel> emailVmFactory, IViewModelsFactory<ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory<IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory, IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact, ICustomerRepository customerRepository, IRepositoryFactory<ISecurityRepository> securityRepositoryFactory, IRepositoryFactory<ICountryRepository> countryRepositoryFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel) { _securityService = securityService; _loginViewModel = loginViewModel; _parentViewModel = parentViewModel; _authContext = authContext; _customerRepository = customerRepository; _orderRepositoryFactory = orderRepositoryFactory; _securityRepositoryFactory = securityRepositoryFactory; _countryRepositoryFactory = countryRepositoryFactory; _entityFactory = entityFactory; _addressVmFactory = addressVmFactory; _wizardUserVmFactory = wizardUserVmFactory; _emailVmFactory = emailVmFactory; _phoneVmFactory = phoneVmFactory; _fileDialogService = new FileDialogService(); InnerItem = innerContact; InnerItem.PropertyChanged += _innerContact_PropertyChanged; CommandsInit(); RequestInit(); CollectionInit(); HasCurrentContactLoginAndSuspendAccessCheck(); }
public TasksModel(ISourceControl sourceControl, IIssuesTracking issuesTracking, IRepositoryFactory repositoryFactory) { _sourceControl = sourceControl; _issuesTracking = issuesTracking; _repositoryFactory = repositoryFactory; LoadModels(); }
public TreeCatalogViewModel( IViewModelsFactory<ICatalogViewModel> vmFactory, catalogModel.Catalog item, IRepositoryFactory<ICatalogRepository> repositoryFactory, IAuthenticationContext authContext, INavigationManager navigationManager, IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory, IViewModelsFactory<ITreeCategoryViewModel> treeCategoryVmFactory, IDataManagementService exportService) : base(repositoryFactory, authContext) { InnerItem = item; EmbeddedHierarchyEntry = this; _catalogDeleteVmFactory = catalogDeleteVmFactory; _treeCategoryVmFactory = treeCategoryVmFactory; _exportService = exportService; OpenItemCommand = new DelegateCommand(() => { if (NavigationData == null) { var editVM = vmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem) , new KeyValuePair<string, object>("parentTreeVM", this)); NavigationData = ((IClosable)editVM).NavigationData; } navigationManager.Navigate(NavigationData); }); ExportItemCommand = new DelegateCommand(() => RaiseExportItemCommand()); }
public ImportService(IImportRepository importRepository, IAssetService blobProvider, ICatalogRepository catalogRepository, IOrderRepository orderRepository, IAppConfigRepository appConfigRepository, IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory) { _orderRepository = orderRepository; _catalogRepository = catalogRepository; _importJobRepository = importRepository; _appConfigRepository = appConfigRepository; _appConfigRepositoryFactory = appConfigRepositoryFactory; _assetProvider = blobProvider; _entityImporters = new List<IEntityImporter> { new ItemImporter() { Name = "Product"}, new ItemImporter() { Name = "Sku"}, new ItemImporter() { Name = "Bundle"}, new ItemImporter() { Name = "DynamicKit"}, new ItemImporter() { Name = "Package"}, new PriceImporter(_catalogRepository), new AssociationImporter(_catalogRepository), new RelationImporter(_catalogRepository), new CategoryImporter(), new LocalizationImporter(), new TaxValueImporter(), new ItemAssetImporter(), new TaxCategoryImporter(), new JurisdictionImporter(), new JurisdictionGroupImporter(), new SeoImporter() }; _importResults = new Dictionary<string, ImportResult>(); }
public EventService(IRepositoryFactory factory) { _personPersonRepo = factory.GetRepository<Person>(); _gameRepository = factory.GetRepository<Game>(); _foodRepository = factory.GetRepository<FoodItem>(); _invitationRepository = factory.GetRepository<PendingInvitation>(); }
public NotificationServiceTests() { EmailRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailQueue, Guid>>(); EmailPreferenceRepository = MockRepository.GenerateStub < IRepositoryWithTypedId<EmailPreferences, string>>(); UserIdentity = MockRepository.GenerateStub<IUserIdentity>(); UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>(); OrderStatusCodeRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<OrderStatusCode, string>>(); ServerLink = MockRepository.GenerateStub<IServerLink>(); QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>(); RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>(); RepositoryFactory.OrganizationRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>(); AdminWorkgroupRepository = MockRepository.GenerateStub<IRepository<AdminWorkgroup>>(); QueryRepositoryFactory.AdminWorkgroupRepository = AdminWorkgroupRepository; WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>(); RepositoryFactory.WorkgroupRepository = WorkgroupRepository; NotificationService = new NotificationService(EmailRepository, EmailPreferenceRepository, UserRepository, OrderStatusCodeRepository, UserIdentity, ServerLink, QueryRepositoryFactory, RepositoryFactory); ServerLink.Expect(a => a.Address).Return("FakeHost").Repeat.Any(); ApprovalRepository = MockRepository.GenerateStub<IRepository<Approval>>(); SetupOrderStatusCodes(); }
public ShippingOptionOverviewStepViewModel( IRepositoryFactory<IShippingRepository> repositoryFactory, IOrderEntityFactory entityFactory, ShippingOption item) : base(null, repositoryFactory, entityFactory, null, item) { }
/// <summary> /// Add new request for unblocking account. /// </summary> /// <param name="id">id of account to unblock</param> /// <param name="userId">id of current user</param> public static void AddRequest(long id, string userId, IRepositoryFactory factory) { var account = factory.AccountRepository.FindById(id); if (account == null) throw new ValidationException("Нельзя разблокировать чужой счет"); if (account.User.Id != userId) throw new ValidationException("Нельзя разблокировать чужой счет"); if(!account.IsBlocked) throw new ValidationException("Аккаунт не заблокирован."); var oldRequest = factory.RequestRepository.Find(r => r.Account.AccountId == id).FirstOrDefault(); if (oldRequest == null) { var request = new Request { Account = account, Date = DateTime.Now }; factory.RequestRepository.Add(request); } else { oldRequest.Date = DateTime.Now; factory.RequestRepository.Edit(oldRequest); } }
/// <summary> /// Take first N request. /// </summary> /// <param name="n">number of requests</param> public static List<Request> FirstNRequests(IRepositoryFactory factory, int n) { return factory.RequestRepository.Get() .OrderByDescending(r => r.Date) .Take(n) .ToList(); }
public TreeVirtualCatalogViewModel( IViewModelsFactory<ITreeCategoryViewModel> vmFactory, IViewModelsFactory<IVirtualCatalogViewModel> virtualCatalogVmFactory, IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory, CatalogBase item, IRepositoryFactory<ICatalogRepository> repositoryFactory, IAuthenticationContext authContext, INavigationManager navigationManager) : base(repositoryFactory, authContext) { InnerItem = item; _vmFactory = vmFactory; _catalogDeleteVmFactory = catalogDeleteVmFactory; EmbeddedHierarchyEntry = this; ViewTitle = new ViewTitleBase { SubTitle = "VIRTUAL CATALOG", Title = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : "" }; OpenItemCommand = new DelegateCommand(() => { if (NavigationData == null) { var editVM = virtualCatalogVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem) , new KeyValuePair<string, object>("parentTreeVM", this)); NavigationData = ((IClosable)editVM).NavigationData; } navigationManager.Navigate(NavigationData); }); }
public ConfigurationWizardViewModel( Project item, IRepositoryFactory<IProjectRepository> projectRepositoryFactory, IViewModelsFactory<IProjectLocationStepViewModel> projectLocationStepVmFactory, IViewModelsFactory<IDatabaseSettingsStepViewModel> databaseSettingsStepVmFactory, IViewModelsFactory<ISearchSettingsStepViewModel> searchSettingsStepVmFactory, IViewModelsFactory<IConfigurationViewModel> configurationVmFactory, IViewModelsFactory<IConfirmationStepViewModel> confirmationStepVmFactory, NavigationManager navigationManager ) { _item = item; _projectRepositoryFactory = projectRepositoryFactory; _navigationManager = navigationManager; // initializing step instances _confirmationViewModel = confirmationStepVmFactory.GetViewModelInstance(); var confirmParam = new KeyValuePair<string, object>("confirmationViewModel", _confirmationViewModel); _searchSettingsStepViewModel = searchSettingsStepVmFactory.GetViewModelInstance(confirmParam); var searchParam = new KeyValuePair<string, object>("searchViewModel", _searchSettingsStepViewModel); _databaseSettingsStepViewModel = databaseSettingsStepVmFactory.GetViewModelInstance(confirmParam); var dbParam = new KeyValuePair<string, object>("databaseViewModel", _databaseSettingsStepViewModel); _projectLocationStepViewModel = projectLocationStepVmFactory.GetViewModelInstance(confirmParam, searchParam, dbParam); var locationParam = new KeyValuePair<string, object>("projectLocationViewModel", _projectLocationStepViewModel); _configurationViewModel = configurationVmFactory.GetViewModelInstance(locationParam, dbParam, searchParam); Initialize(); RegisterWizardSteps(); }
public UserService(IRepositoryFactory _repositoryFactory, IHraSessionManager hraSessionManger) { this._repositoryFactory = _repositoryFactory; _hraSessionManager = hraSessionManger; sample = new SampleData(); }
public WorkgroupServiceTests() { AutomapperConfig.Configure(); VendorRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Vendor, string>>(); VendorAddressRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<VendorAddress, Guid>>(); UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>(); EmailPreferencesRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailPreferences, string>>(); WorkgroupPermissionRepository = MockRepository.GenerateStub<IRepository<WorkgroupPermission>>(); WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>(); OrganizationRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>(); SearchService = MockRepository.GenerateStub<IDirectorySearchService>(); RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>(); RepositoryFactory.RoleRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Role, string>>(); RepositoryFactory.WorkgroupPermissionRepository = WorkgroupPermissionRepository; RepositoryFactory.AccountRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Account, string>>(); QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>(); UserIdentity = MockRepository.GenerateStub<IUserIdentity>(); QueryRepositoryFactory.RelatatedWorkgroupsRepository = MockRepository.GenerateStub<IRepository<RelatedWorkgroups>>(); WorkgroupService = new WorkgroupService(VendorRepository, VendorAddressRepository, UserRepository, EmailPreferencesRepository, WorkgroupPermissionRepository, WorkgroupRepository, OrganizationRepository, SearchService, RepositoryFactory, QueryRepositoryFactory, UserIdentity); }
public DisplayTemplateOverviewStepViewModel( IRepositoryFactory<IAppConfigRepository> repositoryFactory, IAppConfigEntityFactory entityFactory, DisplayTemplateMapping item) : base(null, repositoryFactory, entityFactory, null, null, item) { }
public HomeController(IRepositoryFactory repositoryFactory, IMapDataService mapService) { Contract.Requires(repositoryFactory != null); Contract.Requires(mapService != null); _repositoryFactory = repositoryFactory; _mapService = mapService; }
public TableStorageContextFactory( ICloudStorageServices cloudStorageServices, IRepositoryFactory repositoryFactory) { this.cloudStorageServices = cloudStorageServices; this.repositoryFactory = repositoryFactory; }
public SynchronizationService(IRepositoryFactory repositoryFactory) { _repositoryFactory = repositoryFactory; _resolver.Add(SynchronizationType.Get, Get); _resolver.Add(SynchronizationType.Post, Post); _resolver.Add(SynchronizationType.Both, Both); }
static void Main(string[] args) { Console.WriteLine("Enter type of repository\n 1. FakeRoomRepository\n 2. SqlRoomRepository\n 3. XmlRoomRepository"); int typeRepository = Convert.ToInt32(Console.ReadLine()); switch(typeRepository) { case 1: factory = new FakeRepositoryFactory(); break; case 2: factory = new SqlRepositoryFactory(); break; case 3: factory = new XmlRepositoryFactory(); break; default: Console.Write("Error"); break; } repository = factory.CreateRoomRepository(); TypeRoom[] entity = repository.getAll(); ShowRepository(entity); Console.Read(); }
public static GenotypingViewModel Create(IRepositoryFactory repositoryFactory, User user, JobType jobType = null, GenotypingPostModel postModel = null) { var viewModel = new GenotypingViewModel() { JobType = jobType, JobTypes = jobType == null ? repositoryFactory.JobTypeRepository.Queryable.Where(a => a.Genotyping).ToList() : new List<JobType>(), PostModel = postModel ?? new GenotypingPostModel() {NumPlates = 1} }; if (jobType != null) { var rid = postModel != null && postModel.RechargeAccount != null ? postModel.RechargeAccount.Id : -1; viewModel.RechargeAccounts = new SelectList(user.RechargeAccounts, "Id", "AccountNum", rid); var pts = new List<SelectListItem>(); pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.NinetySix).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.NinetySix) }); pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.ThreeEightyFour).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.ThreeEightyFour) }); viewModel.PlateTypes = new SelectList(pts, "Value", "Text"); var did = postModel != null && postModel.Dyes != null ? postModel.Dyes : new List<int>(); viewModel.Dyes = new MultiSelectList(repositoryFactory.DyeRepository.Queryable.Where(a => a.Genotyping), "Id", "Name", did); } return viewModel; }
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, IRepositoryFactory factory) : this(factory) { UserManager = userManager; SignInManager = signInManager; }
private bool CheckIfUserIsAdmin(ILocalPluginExecutionContext localContext, IRepositoryFactory repoFactory) { var generalRepository = repoFactory.Get <IBaseRepository>(); return(generalRepository.IsAdmin(localContext.Context.InitiatingUserId)); }
public KardStoreSession(IMemoryCache memoryCache, IRepositoryFactory repositoryFactory, IPrincipalAccessor principalAccessor) : base(principalAccessor) { _memoryCache = memoryCache; _repositoryFactory = repositoryFactory; }
public AppController(IRepositoryFactory db, IViewFactory view) { _db = db; _view = view; }
public UserSession(IRepositoryFactory repositoryFactory) { RepositoryFactory = repositoryFactory; }
public PerformanceService(IRepositoryFactory repositoryFactory, ILogService logService) { _logService = logService; _repository = repositoryFactory.GetMsSqlRepository(); }
/// <inheritdoc /> protected EntityService(IRepositoryFactory factory) { Factory = factory; }
public BaseRepositoryProvider(IRepositoryFactory repositoryFactory, IDataContext dataContext) { _repositoryFactory = repositoryFactory; _dataContext = dataContext; }
public PeopleManagementService(IPeopleContextFactory contextFactory, IRepositoryFactory repositoryFactory) { ContextFactory = contextFactory; RepositoryFactory = repositoryFactory; }
public ContractService( IRepositoryFactory repositoryFactory, IFilterStrategyFactory filterStrategyFactory) : base(repositoryFactory, filterStrategyFactory) { }
public void GenerateDisplayTable(ISearchService indexSearchService, IRepositoryFactory repositoryFactory, IWorkgroupService workgroupService, int workgroupId, DateTime month) { Check.Require(month.Day == 1); var endMonth = month.AddMonths(1); var workgroup = repositoryFactory.WorkgroupRepository.Queryable.Single(a => a.Id == workgroupId); var allChildWorkgroups = new List <int>(); allChildWorkgroups.Add(workgroupId); if (workgroup.Administrative) { allChildWorkgroups = workgroupService.GetChildWorkgroups(workgroupId); } Columns = new List <ReportProcessingColumns>(); var workgroups = repositoryFactory.WorkgroupRepository.Queryable.Where(a => allChildWorkgroups.Contains(a.Id)).ToList(); var matchingOrders = indexSearchService.GetOrdersByWorkgroups(workgroups, month, endMonth); foreach (var matchingOrder in matchingOrders.Where(a => a.IsComplete && a.StatusId != OrderStatusCode.Codes.Denied && a.StatusId != OrderStatusCode.Codes.Cancelled)) { var column = new ReportProcessingColumns(); var order = repositoryFactory.OrderRepository.Queryable.Single(a => a.Id == matchingOrder.OrderId); column.Organization = order.Workgroup.PrimaryOrganization.Id; column.Workgroup = order.Workgroup.Name; column.OrderRequestNumber = order.RequestNumber; column.OrderId = order.Id; var orderHistory = order.OrderTrackings.LastOrDefault(a => a.StatusCode.Id == OrderStatusCode.Codes.AccountManager && a.Description.StartsWith("approved")); if (orderHistory != null) { column.ArrivedAtPurchaser = orderHistory.DateCreated; } orderHistory = order.OrderTrackings.LastOrDefault(a => a.Description.StartsWith("rerouted to purchaser")); if (orderHistory != null) { column.ReroutedToPurchaserDate = orderHistory.DateCreated; column.ReRoutedToPurchaserBy = orderHistory.User.FullName; column.ReroutedToPurchaserName = orderHistory.Description.Substring(22); if (column.ArrivedAtPurchaser != null) { column.ReRoutTime = column.ReroutedToPurchaserDate.Value - column.ArrivedAtPurchaser.Value; } } else if (OnlyShowReRouted) { continue; } orderHistory = order.OrderTrackings.FirstOrDefault(a => a.StatusCode.IsComplete); if (orderHistory != null) { column.CompletedByPurchaserDate = orderHistory.DateCreated; column.CompletedByPurchaserName = orderHistory.User.FullName; if (column.ArrivedAtPurchaser != null && column.ReroutedToPurchaserDate != null) { column.CompletionTime = column.CompletedByPurchaserDate.Value - column.ReroutedToPurchaserDate.Value; } else if (column.ArrivedAtPurchaser != null && column.ReroutedToPurchaserDate == null) { column.CompletionTime = column.CompletedByPurchaserDate.Value - column.ArrivedAtPurchaser.Value; } } Columns.Add(column); } }
public MakeReservationController(IRepositoryFactory repositoryFactory) { _repositoryFactory = repositoryFactory; }
public SuperAdminService(IRepositoryFactory repositoryFactory) { _userRepositoryAsyncLazy = new AsyncLazy <IRepository <User> >(() => repositoryFactory.CreateRepositoryAsync <User>()); }
public UnitOfWork(HotelContext context, IRepositoryFactory repositoryFactory) { _context = context; _repositoryFactory = repositoryFactory; }
public OrderDetailServiceImpl(IRepositoryFactory sourceFactory) { _sourceFactory = sourceFactory; }
public TodoAppQuery(IRepositoryFactory repositoryFactory) { Name = "Query"; FieldAsync <NonNullGraphType <ListGraphType <NonNullGraphType <TaskType> > > >( "tasks", arguments: new QueryArguments( new QueryArgument <IdGraphType> { Name = "projectId" }, new QueryArgument <BooleanGraphType> { Name = "onlyTasksWithoutProject" } ), resolve: async context => { var taskRepository = repositoryFactory.Create <Task>(); var projectId = context.GetArgument <Guid?>("projectId"); if (projectId.HasValue) { return(await taskRepository.GetTasksByProjectIdAsync(projectId.Value)); } if (context.GetArgument("onlyTasksWithoutProject", false)) { return(await taskRepository.GetTasksByProjectIdAsync(null)); } return(await taskRepository.GetAllAsync()); } ); FieldAsync <NonNullGraphType <TaskType> >( "task", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => await repositoryFactory.Create <Task>().FindAsync(context.GetArgument <Guid>("id")) ); FieldAsync <NonNullGraphType <ListGraphType <NonNullGraphType <ProjectType> > > >( "projects", resolve: async context => await repositoryFactory.Create <Project>().GetAllAsync() ); FieldAsync <NonNullGraphType <ProjectType> >( "project", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => await repositoryFactory.Create <Project>().FindAsync(context.GetArgument <Guid>("id")) ); FieldAsync <NonNullGraphType <ListGraphType <NonNullGraphType <TagType> > > >( "tags", resolve: async context => await repositoryFactory.Create <Tag>().GetAllAsync() ); FieldAsync <NonNullGraphType <ListGraphType <NonNullGraphType <SearchResult> > > >( "search", arguments: new QueryArguments( new QueryArgument <StringGraphType> { Name = "searchString" } ), resolve: async context => { var searchString = context.GetArgument <string>("searchString"); if (string.IsNullOrWhiteSpace(searchString)) { return(new List <UnionGraphType>()); } var getTasksTask = repositoryFactory.Create <Task>().SearchTasksAsync(searchString); var getProjectsTask = repositoryFactory.Create <Project>().SearchProjects(searchString); await System.Threading.Tasks.Task.WhenAll(getTasksTask, getProjectsTask); var tasks = getTasksTask.Result as IEnumerable <object>; var projects = getProjectsTask.Result as IEnumerable <object>; return(Enumerable.Concat(tasks, projects)); } ); }
public WorkflowFactory(IRepositoryFactory repositoryFactory) { _crudContext = new EasyCrudContext(); _repositoryFactory = repositoryFactory; }
public static void MigrateDatabase(IRepositoryFactory repositoryFactory) { repositoryFactory.DbUnitOfWork.Database.Migrate(); }
public FilmPersonExtractor(IRepositoryFactory repofact) { _repofact = repofact; }
protected RepositoryController(IRepositoryFactory dataAccessFactory, ILogger logger) : base(dataAccessFactory, logger) { DataAccess = RepositoryFactory.GetRepository <TRecordType, TIndexType>(); }
public GenericHandler(IRepositoryFactory repositoryFactory) : base(repositoryFactory) { }
public LecturersController(UserManager <AppUser> userManager, IDataManager dataManager, IRepositoryFactory factory, IMapper mapper) { _userManager = userManager; _dataManager = dataManager; _repos = factory; _mapper = mapper; _watch = new Stopwatch(); }
public StockConverter(IDomainFactory domainFactory, IRepositoryFactory repositoryFactory) { this.domainFactory = domainFactory; this.repositoryFactory = repositoryFactory; }
static ManagerFactoryHelper() { DalManagerFactory = new DalManagerFactory(); RepositoryFactory = new RepositoryFactory(); }
public ProcessingStrategyFactory(IRepositoryFactory repoFactory) { this.repoFactory = repoFactory; }
public MongoUserStore(IRepositoryFactory repoFactory) { _users = repoFactory.GetRepository <User>(CollectionName); }
public BankService(IRepositoryFactory repositoryFactory) : base(repositoryFactory) { }
public Registrator(IRepositoryFactory repositoryFactory) { _repositoryFactory = repositoryFactory; }
public GenresController(IRepositoryFactory repositoryFactory, IServiceFactory serviceFactory) : base(repositoryFactory, serviceFactory) { }
public AccountController(IRepositoryFactory factory) { _factory = factory; }
public FetchHandler(ITracer tracer, IDeploymentManager deploymentManager, IDeploymentSettingsManager settings, IDeploymentStatusManager status, IOperationLock deploymentLock, IEnvironment environment, IEnumerable<IServiceHookHandler> serviceHookHandlers, IRepositoryFactory repositoryFactory, IAutoSwapHandler autoSwapHandler) { _tracer = tracer; _deploymentLock = deploymentLock; _environment = environment; _deploymentManager = deploymentManager; _settings = settings; _status = status; _serviceHookHandlers = serviceHookHandlers; _repositoryFactory = repositoryFactory; _autoSwapHandler = autoSwapHandler; _markerFilePath = Path.Combine(environment.DeploymentsPath, "pending"); // Prefer marker creation in ctor to delay create when needed. // This is to keep the code simple and avoid creation synchronization. if (!FileSystemHelpers.FileExists(_markerFilePath)) { try { FileSystemHelpers.WriteAllText(_markerFilePath, String.Empty); } catch (Exception ex) { tracer.TraceError(ex); } } }