public BlokEmulationViewModel(IBlokEmitterFactory[] EmitterFactories, BlokEmulationParameters EmulationParameters, IMappingService MappingService)
        {
            _emitterFactories = EmitterFactories;

            ReactiveCommand<NavigationInformation> run =
                ReactiveCommand.CreateAsyncObservable(
                    _ => EmulationParameters.WhenAnyValue(x => x.Position,
                                                          x => x.Speed,
                                                          (position, speed) => new { position, speed })
                                            .CombineLatest(this.WhenAnyValue(x => x.Reliability),
                                                           (n, r) => new NavigationInformation(n.position, n.speed, r))
                                            .TakeUntil(_stop)
                                            .EmitThorough(SelectedEmitterFactory.CreatEmitter()));

            _stop = ReactiveCommand.Create();

            Run = run;
            Stop = _stop;

            this.WhenAnyValue(x => x.EmulationEnabled)
                .Where(running => running)
                .InvokeCommand(Run);
            this.WhenAnyValue(x => x.EmulationEnabled)
                .Where(running => !running)
                .InvokeCommand(Stop);

            this.WhenAnyValue(x => x.EmulationEnabled)
                .Select(e => !e)
                .ToProperty(this, x => x.CanChangeEmissionMethod, out _canChangeEmissionMethod, true);

            SelectedEmitterFactory = EmitterFactories.First();

            _positionPresenter = new PositionPresenter(MappingService,
                                                       EmulationParameters.WhenAnyValue(x => x.Position));
        }
示例#2
0
 public OrdersController(
     IQuartetClientFactory                       clientFactory,
     IMappingService<Order,    OrderViewModel>   orderMapping,
     IMappingService<Customer, HCardViewModel>   hcardMapping,
     IMappingService<Address,  AddressViewModel> addressMapping,
     IMailingService                             mailingService,
     IInvoicingService                           invoicingService,
     IFeaturesConfigService                      featuresConfigService,
     IAppSettings                                appSettings,
     IConsultantContext                          consultantContext,
     IConsultantDataServiceClientFactory         consultantDataServiceClientFactory,
     IPromotionService                           promotionService,
     IProductCatalogClientFactory                productCatalogClientFactory,
     IInventoryService                           inventoryService,
     ISubsidiaryAccessor                         subsidiaryAccessor
 )
 {
     _clientFactory                      = clientFactory;
     _orderMapping                       = orderMapping;
     _hcardMapping                       = hcardMapping;
     _addressMapping                     = addressMapping;
     _mailingService                     = mailingService;
     _invoicingService                   = invoicingService;
     _featuresConfigService              = featuresConfigService;
     _appSettings                        = appSettings;
     _consultantContext                  = consultantContext;
     _consultantDataServiceClientFactory = consultantDataServiceClientFactory;
     _promotionService                   = promotionService;
     _productCatalogClientFactory        = productCatalogClientFactory;
     _inventoryService                   = inventoryService;
     _subsidiaryAccessor                 = subsidiaryAccessor;
 }
 public ProfileController(
     IUsersService usersService,
     IMappingService mappingService)
     : base(usersService)
 {
     this.mappingService = mappingService;
 }
        public TrackingControlViewModel(ITrackPresenter TrackPresenter, IMappingService MappingService, TrackFormatterManager TrackFormatterManager)
        {
            _trackPresenter = TrackPresenter;
            _trackFormatterManager = TrackFormatterManager;
            _mappingService = MappingService;

            _track = new ReactiveList<EarthPoint>();
            _track.Changed
                  .Subscribe(_ => RefreshTrack());

            LoadTrack = ReactiveCommand.CreateAsyncTask(LoadTrackImpl);
            SaveTrack = ReactiveCommand.CreateAsyncTask(SaveTrackImpl);
            ReactiveCommand<object> clearCommand = ReactiveCommand.Create(_track.IsEmptyChanged.Select(e => !e));
            clearCommand.Subscribe(_ => _track.Clear());
            ClearTrack = clearCommand;

            IConnectableObservable<TrackPathRider> prp =
                _track.Changed
                      .Select(_ => new TrackPathRider(new GpsTrack(_track.ToList())))
                      .Publish();
            PathRider = prp;
            prp.Connect();

            _mappingService.Clicks
                           .Where(c => c.Action == MouseAction.LeftClick)
                           .Subscribe(c => AppendPointToTrack(c.Point));

            _mappingService.Clicks
                           .Where(c => c.Action == MouseAction.RightClick)
                           .Subscribe(c => _track.Remove(_track.LastOrDefault()));
        }
示例#5
0
 public ArticleFactory(IQueryRepository queryRepository, IValidator<Article> articleValidator,
     IValidator<Comment> commentValidator, IMappingService mappingService)
 {
     _queryRepository = queryRepository;
     _articleValidator = articleValidator;
     _commentValidator = commentValidator;
     _mappingService = mappingService;
 }
        public ConfigurationService(
            IMappingService mapper
            )
        {
            Mapper = mapper;

            Servers = new Lazy<IEnumerable<InternalCollectionServer>>(LoadCollectionServers);
        }
示例#7
0
 public TasksController(
     IQuartetClientFactory clientFactory,
     IMappingService<TaskListItem, TaskViewModel> taskMapping
 )
 {
     _clientFactory = clientFactory;
     _taskMapping = taskMapping;
 }
 public TaxaController(
     Lazy<ITaxa> Taxa,
     IMappingService Mapping
     )
     : base(Mapping)
 {
     this._Taxa = Taxa;
     this.Mapping = Mapping;
 }
 public MapLoaderControlViewModel(IMapLoadingService MapLoadingService, MapPresenter MapPresenter, IMappingService MappingService,
                                  ITrackSource TrackSource)
 {
     _mapLoadingService = MapLoadingService;
     _mapPresenter = MapPresenter;
     _mappingService = MappingService;
     _trackSource = TrackSource;
     _load = ReactiveCommand.CreateAsyncTask((_, c) => LoadMap());
 }
 public MappingUpdateViewModel(
     IEventAggregator eventAggregator, 
     IRegionManager regionManager, 
     IMappingService mappingService)
 {
     this.nexusId = this.NewMdmId();
     this.eventAggregator = eventAggregator;
     this.regionManager = regionManager;
     this.mappingService = mappingService;
 }
示例#11
0
 public DashboardController(
     IQuartetClientFactory clientFactory,
     IAppSettings appSettings,
     IMappingService<NotificationCounts, DashboardViewModel> dashboardMapping
 )
 {
     _clientFactory    = clientFactory;
     _appSettings      = appSettings;
     _dashboardMapping = dashboardMapping;
 }
示例#12
0
 public TaxonService(
     IMappingService Mapping,
     CollectionContext Collection,
     ApplicationUser user
     )
 {
     this.Mapping = Mapping;
     this.Collection = Collection;
     this.User = user;
 }
示例#13
0
        public EditCustomerViewModel(ICustomerRepository customerRepository, IImageCaptureService imageCaptureService, IMappingService mappingService)
        {
            _customerRepository = customerRepository;
            _imageCaptureService = imageCaptureService;
            _mappingService = mappingService;

            CaptureImageCommand = new DelegateCommand(CaptureImage);
            OpenMapsCommand = new DelegateCommand(OpenMaps);
            SaveCustomerCommand = new DelegateCommand(SaveCustomer);
        }
示例#14
0
        public TasksController(
			IQuartetClientFactory clientFactory,
            IMappingService<TaskListItem, CustomerTaskContent> taskMapping,
            IConsultantContext consultantContext
		)
        {
            _clientFactory = clientFactory;
            _taskMapping = taskMapping;
            _consultantContext = consultantContext;
        }
示例#15
0
 public SampleRequestController(
     IQuartetClientFactory clientFactory,
     IConsultantContext consultantContext,
     IMappingService<SampleRequest, SampleRequestViewModel> sampleRequestMappingService
 )
 {
     _clientFactory = clientFactory;
     _consultantContext = consultantContext;
     _sampleRequestMappingService = sampleRequestMappingService;
 }
示例#16
0
 public ActivitySummaryController(
     IQuartetClientFactory quartetClientFactory,
     IConsultantContext consultantContext,
     IMappingService<TaskListItem, Activity> taskMapping
 )
 {
     _quartetClientFactory = quartetClientFactory;
     _consultantContext    = consultantContext;
     _taskMapping          = taskMapping;
 }
示例#17
0
 public HomeController(IMappingService mappingService, IRestaurantTask restaurantTask,
     IRestaurantReviewTask restaurantReviewTask, IRestaurantRatingTask restaurantRatingTask,
     IRestaurantPhotoTask restaurantPhotoTask, ILookupTask lookupTask)
 {
     _mappingService = mappingService;
     _restaurantTask = restaurantTask;
     _restaurantReviewTask = restaurantReviewTask;
     _restaurantRatingTask = restaurantRatingTask;
     _restaurantPhotoTask = restaurantPhotoTask;
     _lookupTask = lookupTask;
 }
示例#18
0
        public FoodController(IFoodService foodService, IMappingService mappingService)
        {
            if (foodService == null)
                throw new ArgumentNullException("foodService");

            if (mappingService == null)
                throw new ArgumentNullException("mappingService");

            _foodService = foodService;
            _mappingService = mappingService;
        }
 public ProductsController(
     IProductsService productsService,
     IIdentifierProvider identifierProvider,
     IVotesService votesService,
     IMappingService mappingService)
 {
     this.productsService = productsService;
     this.votesService = votesService;
     this.identifierProvider = identifierProvider;
     this.mappingService = mappingService;
 }
示例#20
0
 public CustomerNotesController(
     IQuartetClientFactory clientFactory,
     IConsultantContext consultantContext,
     IMappingService<Customer, CustomerDetailViewModel> customerMappingService,
     IImportCustomerService importCustomer
 )
 {
     _clientFactory          = clientFactory;
     _consultantContext      = consultantContext;
     _customerMappingService = customerMappingService;
     _importCustomer         = importCustomer;
 }
 public MappingEditViewModel(
     IEventAggregator eventAggregator, 
     IMappingService mappingService, 
     IRegionManager regionManager, 
     INavigationService navigationService)
 {
     this.eventAggregator = eventAggregator;
     this.mappingService = mappingService;
     this.regionManager = regionManager;
     this.navigationService = navigationService;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
 }
        public MappingAddViewModel(
            IEventAggregator eventAggregator, 
            IMappingService mappingService, 
            INavigationService navigationService)
        {
            this.eventAggregator = eventAggregator;
            this.mappingService = mappingService;
            this.navigationService = navigationService;
            this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();

            this.SourceSystems = mappingService.GetSourceSystemNames().OrderBy(x => x).ToList();
            this.SourceSystems.Insert(0, string.Empty);
        }
示例#23
0
 public OrdersController(
     IAppSettings                            appSettings,
     IProductCatalogClientFactory            productCatalogClientFactory,
     IQuartetClientFactory                   clientFactory, 
     IMappingService<Order, OrderViewModel>  orderMapping,
     IFeaturesConfigService                  featuresConfigService
 )
 {
     _appSettings                 = appSettings;
     _productCatalogClientFactory = productCatalogClientFactory;
     _clientFactory               = clientFactory;
     _orderMapping                = orderMapping;
     _featuresConfigService       = featuresConfigService;
 }
示例#24
0
        public AccountController(IUserService userService, IMappingService mappingService, IAuthenticationService authenticationService)
        {
            if (userService == null)
                throw new ArgumentNullException("userService");

            if (mappingService == null)
                throw new ArgumentNullException("mappingService");

            if (authenticationService == null)
                throw new ArgumentNullException("authenticationService");

            _userService = userService;
            _mappingService = mappingService;
            _authenticationService = authenticationService;
        }
 public BrokerEditViewModel(
     IEventAggregator eventAggregator, 
     IMdmService entityService, 
     INavigationService navigationService, 
     IMappingService mappingService, 
     IApplicationCommands applicationCommands)
 {
     this.navigationService = navigationService;
     this.mappingService = mappingService;
     this.applicationCommands = applicationCommands;
     this.eventAggregator = eventAggregator;
     this.entityService = entityService;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.CanEdit = AuthorisationHelpers.HasEntityRights("Broker");
 }
 public SourceSystemEditCloneViewModel(
     IEventAggregator eventAggregator, 
     IMdmService entityService, 
     INavigationService navigationService, 
     IMappingService mappingService, 
     IApplicationCommands applicationCommands)
 {
     this.navigationService = navigationService;
     this.mappingService = mappingService;
     this.applicationCommands = applicationCommands;
     this.eventAggregator = eventAggregator;
     this.entityService = entityService;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.CanEdit = AuthorisationHelpers.HasEntityRights("SourceSystem");
     this.eventAggregator.Subscribe<MappingClonedEvent>(this.MappingCloned);
 }
示例#27
0
 public CCPaymentController(
     IAppSettings                            appSettings,
     IProductCatalogClientFactory            productCatalogClientFactory,
     IQuartetClientFactory                   clientFactory, 
     IMappingService<Order, OrderViewModel>  orderMapping,
     IFeaturesConfigService                  featuresConfigService,
     ICreditCardService                      creditCardService,
     IConsultantContext                      consultantContext
 )
 {
     _appSettings                        = appSettings;
     _productCatalogClientFactory        = productCatalogClientFactory;
     _clientFactory                      = clientFactory;
     _orderMapping                       = orderMapping;
     _featuresConfigService              = featuresConfigService;
     _creditCardService                  = creditCardService;
     _consultantContext                  = consultantContext;
 }
示例#28
0
 public ImportCustomer(
     IConfigService configService,
     IQuartetClientFactory clientFactory,
     IAppSettings appSettings,
     IConsultantContext consultantContext,
     IMappingService<UploadedCustomer, ImportedCustomer> customerMappingService,
     IFacebookAuthentication fbAuth,
     IMailingService emailService
 )
 {
     _configService          = configService;
     _quartetClientFactory   = clientFactory;
     _appSettings            = appSettings;
     _consultantContext      = consultantContext;
     _customerMappingService = customerMappingService;
     _fbAuth                 = fbAuth;
     _emailService           = emailService;
 }
        public LegalEntityEditViewModel(
            IEventAggregator eventAggregator, 
            IMdmService entityService, 
            INavigationService navigationService, 
            IMappingService mappingService, 
            IApplicationCommands applicationCommands, 
            IList<string> partystatusConfiguration)
        {
            this.navigationService = navigationService;
            this.mappingService = mappingService;
            this.applicationCommands = applicationCommands;
            this.eventAggregator = eventAggregator;
            this.entityService = entityService;
            this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
            this.CanEdit = AuthorisationHelpers.HasEntityRights("LegalEntity");

            this.PartyStatusConfiguration = partystatusConfiguration;
        }
        public SearchViewModel(
            IEventAggregator eventAggregator, 
            IApplicationCommands applicationCommands, 
            INavigationService navigationService, 
            IMappingService mappingService)
        {
            this.eventAggregator = eventAggregator;
            this.applicationCommands = applicationCommands;
            this.navigationService = navigationService;
            this.mappingService = mappingService;
            this.MenuItems = new ObservableCollection<MenuItemViewModel>();

            this.DisplayWelcome = true;
            this.AsOf = SystemTime.UtcNow().Date;

            this.SourceSystems = SourceSystemList(this.mappingService);

            this.SourceSystem = string.Empty;
        }
示例#31
0
 public UpdateBoardTaskCommandHandler(IDataContext dataContext, IMappingService mappingService)
 {
     this.dataContext    = dataContext;
     this.mappingService = mappingService;
 }
示例#32
0
 public LoginService(IMappingService mapper, ILoginRepository loginRepository) : base(mapper)
 {
     this.loginRepository = loginRepository;
 }
示例#33
0
 public BookController(IMappingService _mappingService)
 {
     mappingService = _mappingService;
 }
示例#34
0
 public CreateCarCommand(CommandContext context, IService <Car> service, IValidator validation, IMappingService mapping)
     : base(context, validation)
 {
     this.service = service;
     this.mapping = mapping;
 }
示例#35
0
 public DomainMappingService(ILogger <MappingService <DomainDefinition, Domain> > logger, IMappingService <SchemaDefinition, Schema> mappingService) : base(logger)
 {
     Result = (input, parentId) => new Domain
     {
         SystemId = parentId,
         Name     = new AsciiStringReference(input.Domain),
         Schemas  = input.Schemas?.Select(s => mappingService.Map(s)).ToList()
     };
 }
示例#36
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="searchCriteria"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="specification"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        /// <returns></returns>
        public AuditSearchVMDC SearchAudit(string currentUser, string user, string appID, string overrideID, AuditSearchCriteriaDC searchCriteria, int page, int pageSize,
                                           ISpecification <Audit> specification, IRepository <Audit> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == specification)
                {
                    throw new ArgumentOutOfRangeException("specification");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Evaluate search criteria if supplied
                    if (null != searchCriteria)
                    {
                        EvaluateSearchCriteria(searchCriteria, ref specification);
                    }

                    // Set default sort expression
                    System.Linq.Expressions.Expression <Func <Audit, Object> > sortExpression = x => new { x.TypeOfObject };

                    // Find all items that satisfy the specification created above.
                    IEnumerable <Audit> dataEntities = dataRepository.Find(specification, sortExpression, page, pageSize);

                    // Get total count of items for search critera
                    int itemCount = dataRepository.Count(specification);

                    AuditSearchVMDC results = new AuditSearchVMDC();

                    // Convert to data contracts
                    List <AuditSearchMatchDC> destinations = mappingService.Map <IEnumerable <Audit>, List <AuditSearchMatchDC> >(dataEntities);

                    results.MatchList      = destinations;
                    results.SearchCriteria = searchCriteria;
                    results.RecordCount    = itemCount;

                    return(results);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
示例#37
0
 public SubmitWorkflow(ISubmitService submitService, IMappingService mappingService, ISessionHelper sessionHelper)
 {
     _submitService  = submitService;
     _mappingService = mappingService;
     _sessionHelper  = sessionHelper;
 }
 public EfCourseRepository(StudentSystemDbContext studentSystemDbContext, IMappingService mapping)
 {
     _studentSystemDbContext = studentSystemDbContext;
     _mapping = mapping;
 }
示例#39
0
        /// <summary>
        /// Update a Audit
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="code"></param>
        /// <param name="lockID"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        public void DeleteAudit(string currentUser, string user, string appID, string overrideID, string code, string lockID, IRepository <Audit> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (string.IsNullOrEmpty(code))
                {
                    throw new ArgumentOutOfRangeException("code");
                }
                if (string.IsNullOrEmpty(lockID))
                {
                    throw new ArgumentOutOfRangeException("lockID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Convert string to guid
                    Guid codeGuid = Guid.Parse(code);

                    // Find item based on ID
                    Audit dataEntity = dataRepository.Single(x => x.Code == codeGuid);

                    // Delete the item
                    dataRepository.Delete(dataEntity);

                    // Commit unit of work
                    uow.Commit();
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);
            }
        }
示例#40
0
 public StudentRegisterController(IRepositoryService repositoryService, IMappingService mappingService, ILoggingService loggingService) : base(repositoryService, mappingService, loggingService)
 {
 }
示例#41
0
 public HomeController(IPostService postService, IMappingService mappingService, IPaginator paginator)
     : base(mappingService)
 {
     this.postService = postService ?? throw new ArgumentNullException();
     this.paginator   = paginator ?? throw new ArgumentNullException();
 }
示例#42
0
 public SourceTypeMapper(IMappingService service, IMappingServiceProvider serviceProvider) : base(service, serviceProvider)
 {
 }
示例#43
0
 public ServiceBase(IRequestContext requestContext)
 {
     context        = requestContext;
     mappingService = context.Factory.GetService <IMappingService>();
 }
示例#44
0
 public UserStore(IMappingService mappingService)
 {
     _mappingService = mappingService;
 }
 public ToDoItemController(IMappingService <EntityDbContext> service, ITodoItemService todoItemService)
 {
     this.service         = service;
     this.todoItemService = todoItemService;
 }
示例#46
0
 public MeetupService(IUnitOfWork unitOfWork, IMappingService mappingService)
 {
     _unitOfWork     = unitOfWork;
     _mappingService = mappingService;
 }
示例#47
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="specification"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        /// <returns></returns>
        public List <AuditDC> GetAllAudit(string currentUser, string user, string appID, string overrideID, ISpecification <Audit> specification, IRepository <Audit> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == specification)
                {
                    throw new ArgumentOutOfRangeException("specification");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Set default sort expression
                    System.Linq.Expressions.Expression <Func <Audit, Object> > sortExpression = x => new { x.TypeOfObject };

                    // Find all items that satisfy the specification created above.
                    IEnumerable <Audit> dataEntities = dataRepository.Find(specification, sortExpression);

                    // Convert to data contracts
                    List <AuditDC> destinations = mappingService.Map <IEnumerable <Audit>, List <AuditDC> >(dataEntities);

                    return(destinations);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
示例#48
0
 public EditCarExtraCommand(CommandContext context, IService <Extra> service, IValidator validation, IMappingService mapping)
     : base(context, validation)
 {
     this.service = service;
     this.mapping = mapping;
 }
示例#49
0
 public NominalService(IMappingService mapper, INominalRepository nominalRepository) : base(mapper)
 {
     this.nominalRepository = nominalRepository;
 }
示例#50
0
        /// <summary>
        /// Retrieve a Audit with associated lookups
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="code"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        /// <returns></returns>
        public AuditVMDC GetAudit(string currentUser, string user, string appID, string overrideID, string code, IUnitOfWork uow, IRepository <Audit> dataRepository
                                  , IExceptionManager exceptionManager, IMappingService mappingService)

        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    AuditDC destination = null;

                    // If code is null then just return supporting lists
                    if (!string.IsNullOrEmpty(code))
                    {
                        // Convert code to Guid
                        Guid codeGuid = Guid.Parse(code);

                        // Retrieve specific Audit
                        Audit dataEntity = dataRepository.Single(x => x.Code == codeGuid);

                        // Convert to data contract for passing through service interface
                        destination = mappingService.Map <Audit, AuditDC>(dataEntity);
                    }



                    // Create aggregate contract
                    AuditVMDC returnObject = new AuditVMDC();

                    returnObject.AuditItem = destination;

                    return(returnObject);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
示例#51
0
 public UserService(IMappingService mapper, IUserRepository userRepository) : base(mapper)
 {
     this.userRepository = userRepository;
 }
示例#52
0
        /// <summary>
        ///  Create a Audit
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="dc"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        public AuditVMDC CreateAudit(string currentUser, string user, string appID, string overrideID, AuditDC dc, IRepository <Audit> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dc)
                {
                    throw new ArgumentOutOfRangeException("dc");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Create a new ID for the Audit item
                    dc.Code = Guid.NewGuid();

                    // Map data contract to model
                    Audit destination = mappingService.Map <AuditDC, Audit>(dc);

                    // Add the new item
                    dataRepository.Add(destination);

                    // Commit unit of work
                    uow.Commit();

                    // Map model back to data contract to return new row id.
                    dc = mappingService.Map <Audit, AuditDC>(destination);
                }

                // Create aggregate data contract
                AuditVMDC returnObject = new AuditVMDC();

                // Add new item to aggregate
                returnObject.AuditItem = dc;

                return(returnObject);
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
示例#53
0
 public UserRepository(IMappingService mappingService, IUserService userService)
 {
     _mappingService = mappingService;
     _userService    = userService;
 }
示例#54
0
        /// <summary>
        /// Update a Referrer
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="dc"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        public ReferrerVMDC UpdateReferrer(string currentUser, string user, string appID, string overrideID, ReferrerDC dc, IRepository <Referrer> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dc)
                {
                    throw new ArgumentOutOfRangeException("dc");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Map data contract to model
                    Referrer destination = mappingService.Map <ReferrerDC, Referrer>(dc);

                    // Add the new item
                    dataRepository.Update(destination);

                    // Commit unit of work
                    uow.Commit();

                    // Map model back to data contract to return new row id.
                    dc = mappingService.Map <Referrer, ReferrerDC>(destination);
                }

                // Create new data contract to return
                ReferrerVMDC returnObject = new ReferrerVMDC();

                // Add new item to datacontract
                returnObject.ReferrerItem = dc;

                // Commit unit of work
                return(returnObject);
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
示例#55
0
 public TicketController(IMappingService mappingService, ITicketService ticketService) : base(mappingService)
 {
     this.ticketService = ticketService;
 }
 public CreateUserCommand(CommandContext context, IUserService service, IValidator validation, ICryptographyService cryptography, IMappingService mapping)
     : base(context, validation)
 {
     this.service      = service;
     this.cryptography = cryptography;
     this.mapping      = mapping;
 }
 public AuthController(IRepositoryService repositoryService, IMappingService mappingService, ILoggingService loggingService) : base(repositoryService, mappingService, loggingService)
 {
 }
 public CompetitionService(ICompetitionRepo competitionRepo, IChallengeRepo challengeRepo, IMappingService mappingService, IAdminRepo adminRepo, IParticipantRepo participantRepo)
 {
     _competitionRepo = competitionRepo;
     _challengeRepo   = challengeRepo;
     _mappingService  = mappingService;
     _adminRepo       = adminRepo;
     _participantRepo = participantRepo;
 }
示例#59
0
 public TestSuiteController(ITestSuiteService testSuiteService, ITagsService tagsService, IMappingService mappingService, IPositionService positionService, IUserService userService, Silicus.UtilityContainer.Services.Interfaces.IUserService containerUserService, CommonController commonController)
 {
     _testSuiteService     = testSuiteService;
     _tagsService          = tagsService;
     _mappingService       = mappingService;
     _positionService      = positionService;
     _userService          = userService;
     _containerUserService = containerUserService;
     _commonController     = commonController;
 }
        /// <summary>
        /// Retrieve a CustomerControlMeasure with associated lookups
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="code"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        /// <returns></returns>
        public CustomerControlMeasureVMDC GetCustomerControlMeasure(string currentUser, string user, string appID, string overrideID, string code, IUnitOfWork uow, IRepository <CustomerControlMeasure> dataRepository
                                                                    , IRepository <Customer> customerRepository
                                                                    , IRepository <ControlMeasure> controlMeasureRepository
                                                                    , IExceptionManager exceptionManager, IMappingService mappingService)

        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    CustomerControlMeasureDC destination = null;

                    // If code is null then just return supporting lists
                    if (!string.IsNullOrEmpty(code))
                    {
                        // Convert code to Guid
                        Guid codeGuid = Guid.Parse(code);

                        // Retrieve specific CustomerControlMeasure
                        CustomerControlMeasure dataEntity = dataRepository.Single(x => x.Code == codeGuid);

                        // Convert to data contract for passing through service interface
                        destination = mappingService.Map <CustomerControlMeasure, CustomerControlMeasureDC>(dataEntity);
                    }

                    IEnumerable <Customer>       customerList       = customerRepository.GetAll(x => new { x.Title });
                    IEnumerable <ControlMeasure> controlMeasureList = controlMeasureRepository.GetAll(x => new { x.ControlMeasureDescription });

                    List <CustomerDC>       customerDestinationList       = mappingService.Map <List <CustomerDC> >(customerList);
                    List <ControlMeasureDC> controlMeasureDestinationList = mappingService.Map <List <ControlMeasureDC> >(controlMeasureList);

                    // Create aggregate contract
                    CustomerControlMeasureVMDC returnObject = new CustomerControlMeasureVMDC();

                    returnObject.CustomerControlMeasureItem = destination;
                    returnObject.CustomerList       = customerDestinationList;
                    returnObject.ControlMeasureList = controlMeasureDestinationList;

                    return(returnObject);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }