public ServiceController(IWorkContext workContext, IServicesService servicesService, IUploadService uploadService, BanobatDbContext dbContext) : base(workContext)
 {
     _workContext     = workContext;
     _servicesService = servicesService;
     _uploadService   = uploadService;
     _dbContext       = dbContext;
 }
Пример #2
0
        private void cboServices_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (cboServices.SelectedValue != null)
            {
                BackgroundWorker worker = new BackgroundWorker();
                loadingAnimation.Visibility = Visibility.Visible;

                worker.DoWork += delegate(object s, DoWorkEventArgs args)
                {
                    object[] data = args.Argument as object[];

                    IServicesService servicesService = ObjectLocator.GetInstance <IServicesService>();
                    Dictionary <License, List <LicenseSet> > _servicesData = servicesService.GetServiceLicenses((Service)data[0]);

                    args.Result = _servicesData;
                };

                worker.RunWorkerCompleted += delegate(object s, RunWorkerCompletedEventArgs args)
                {
                    servicesData = (Dictionary <License, List <LicenseSet> >)args.Result;
                    gridRemoteServices.ItemsSource = DataConverters.ConvertAllLicensesSetsToDisplay(servicesData);

                    loadingAnimation.Visibility = Visibility.Collapsed;
                };

                worker.RunWorkerAsync(new object[]
                {
                    cboServices.SelectedValue
                });
            }
        }
        public async Task Delete_WithOrderData_ShouldDeleteSuccessfully()
        {
            var errorMessagePrefix = "ServicesService DeleteByIdAsync() method does not work properly.";

            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            await this.SeedData(dbContext);

            await dbContext.ServiceOrders.AddAsync(new ServiceOrder
            {
                ServiceId = 1,
            });

            await dbContext.SaveChangesAsync();

            this.servicesService = new ServicesService(dbContext);

            var testId = dbContext.Services.First().To <ServicesServiceModel>().Id;

            await this.servicesService.DeleteByIdAsync(testId);

            var expectedCount = 1;
            var actualCount   = dbContext.Services.Count();

            Assert.True(expectedCount == actualCount, errorMessagePrefix);
        }
Пример #4
0
        public DataTable GetServicesInfo()
        {
            _services = new ServicesService(_scope, _options);
            var serviceNamesList = _services.GetAllServices();

            return(CreateExcelFile.ListToDataTable(serviceNamesList, "Services"));
        }
        public async Task GetAllServices_WithDummyData_ShouldReturnCorrectResult()
        {
            MapperInitializer.InitializeMapper();

            var errorMessagePrefix = "ServicesService GetAllServicesAsync() method does not work properly.";

            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            await this.SeedData(dbContext);

            this.servicesService = new ServicesService(dbContext);

            var actualResult = await this.servicesService.GetAllServicesAsync <ServicesServiceModel>().ToListAsync();

            var expectedResult = this.GetDummyData().To <ServicesServiceModel>().ToList();

            Assert.True(actualResult.Count == expectedResult.Count, errorMessagePrefix);

            // TODO:
            // for (int i = 0; i < expectedResult.Count; i++)
            // {
            //     var expectedEntry = expectedResult[i];
            //     var actualEntry = actualResult[i];
            //     Assert.True(expectedEntry.Name == actualEntry.Name, errorMessagePrefix + " " + "Name is not return  properly.");
            //     Assert.True(expectedEntry.Description == actualEntry.Description, errorMessagePrefix + " " + "Description is  not return properly.");
            //     Assert.True(expectedEntry.Picture == actualEntry.Picture, errorMessagePrefix + " " + "Picture is not return  properly.");
            //     Assert.True(expectedEntry.ProductType.Name == actualEntry.ProductType.Name, errorMessagePrefix + " " +  "ProductType Name is not return properly.");
            // }
        }
Пример #6
0
        public ServicesServiceTests()
        {
            //create InMemory DbContext
            var builder = new DbContextOptionsBuilder <AlgDbContext>();

            builder.UseInMemoryDatabase("ServicesServiceTests")
            .EnableSensitiveDataLogging();
            var options = builder.Options;
            var context = new AlgDbContext(options);

            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            _usersRepository = new UsersRepository(context);

            //create UsersService
            _servicesRepository = new ServicesRepository(context);
            var config = new MapperConfiguration(c =>
            {
                c.AddProfile <ServicesMapProfile>();
            });

            _mapper = config.CreateMapper();

            _settings = new PagingSettings
            {
                PageSize = 4
            };
            _servicesService = new ServicesService(_servicesRepository, _mapper,
                                                   Microsoft.Extensions.Options.Options.Create(_settings));

            //seed with initial data
            new UsersSeeds(context).Seed();
            new ServicesSeeds(context).Seed();
        }
Пример #7
0
 public ServicesPageController(IServicesService serviceService, IUniquePageService uniquepageService, INotificationHubService notificationHubService, IPageMessageSvc pageMessageSvc)
 {
     _serviceService         = serviceService;
     _uniquePageService      = uniquepageService;
     _notificationHubService = notificationHubService;
     _pageMessageSvc         = pageMessageSvc;
 }
Пример #8
0
 public InvoicesService(
     IDeletableEntityRepository <Invoice> invoicesRepository,
     IServicesService servicesService)
 {
     this.invoicesRepository = invoicesRepository;
     this.servicesService    = servicesService;
 }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServicesController" /> class.
        /// </summary>
        /// <param name="servicesService">The services service.</param>
        public ServicesController(IServicesService servicesService)
            : base(new VisualStudioService(), new ReadMeService(), new SettingsService())
        {
            TraceService.WriteLine("ServicesController::Constructor");

            this.servicesService = servicesService;
        }
Пример #10
0
 public ServiceController(IStringLocalizer <ServiceController> localzier, IBuildingService buildingService, IServicesService servicesService)
     : base(buildingService)
 {
     _localzier       = localzier;
     _buildingService = buildingService;
     _servicesService = servicesService;
 }
Пример #11
0
        // GET: Task
        public TaskController(IHelperService helperService, ISmsService smsSvc, IEnrolleeService enrolleeService, ILogAdminService loggersvc, IProviderService providersvc, ISession session, IEmailSender emailSender, SiteSettings siteSettings, Site site, IPlanService planService, IUniquePageService uniquepageService, IPageMessageSvc pageMessageSvc, IServicesService serviceSvc, IProviderService Providersvc, ILogAdminService logger, ICompanyService companyService, UserService userService, IRoleService roleService, MailSettings mailSettings, Services.ClaimService claimserv)
        {
            _helperSvc       = helperService;
            _enrolleeService = enrolleeService;
            _smsservice      = smsSvc;
            _logger          = loggersvc;
            _providerservice = providersvc;

            _session           = session;
            _emailSender       = emailSender;
            _siteSettings      = siteSettings;
            _site              = site;
            _planService       = planService;
            _uniquePageService = uniquepageService;
            _pageMessageSvc    = pageMessageSvc;

            _serviceSvc  = serviceSvc;
            _providerSvc = Providersvc;
            _logger      = logger;
            _companySvc  = companyService;
            _userservice = userService;
            _rolesvc     = roleService;

            _mailSettings = mailSettings;

            _claimservice = claimserv;
        }
Пример #12
0
 public OrdersController(IOrdersService ordersService, IServicesService servicesService, IFilesService filesService, UserManager <ApplicationUser> userManager)
 {
     this.ordersService   = ordersService;
     this.servicesService = servicesService;
     this.filesService    = filesService;
     this.userManager     = userManager;
 }
Пример #13
0
        public TurnsController(ITurnsService turnsService,
                               IDoctorServiceManager doctorServiceManager,
                               IAppointmentService appointmentService,
                               IServiceSupplyService serviceSupplyService,
                               IServicesService servicesService,
                               IBlockedMobileService blockedMobileService,
                               IIPAsManager iPAsManager,
                               IPersonService userService,
                               IAppointmentsManager appointmentsManager,
                               INotificationService notificationService,
                               IOfferRepository offerRepository)
        {
            _turnsService         = turnsService;
            _doctorServiceManager = doctorServiceManager;
            _userService          = userService;
            _appointmentsManager  = appointmentsManager;
            _notificationService  = notificationService;
            _servicesService      = servicesService;
            _blockedMobileService = blockedMobileService;
            _iPAsManager          = iPAsManager;
            _appointmentService   = appointmentService;
            _serviceSupplyService = serviceSupplyService;
            _offerRepository      = offerRepository;

            logger = LogManager.GetCurrentClassLogger();
        }
        public void GetAllServicesCount_WithNoData_ShoultThrowArgumentNullException()
        {
            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            this.servicesService = new ServicesService(dbContext);

            Assert.Throws <ArgumentNullException>(() => this.servicesService.GetCountServices());
        }
Пример #15
0
		public NewServiceWindow()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			servicesService = ObjectLocator.GetInstance<IServicesService>();
		}
Пример #16
0
        public NewServiceWindow()
        {
            InitializeComponent();

            WindowHelper.CheckAndApplyTheme(this);

            servicesService = ObjectLocator.GetInstance <IServicesService>();
        }
Пример #17
0
 public BusinessmanServicesViewModel(IMvxLogProvider logProvider
                                     , IMvxNavigationService navigationService
                                     , IServicesService servicesServices)
     : base(logProvider, navigationService)
 {
     _servicesServices = servicesServices;
     _servicesServices.MyServicesListChanged += ServicesServicesOnMyServicesListChanged;
 }
Пример #18
0
 public ServicesController(ILogger <AdminController> logger,
                           IServicesService serviceService,
                           IMortgageService mortgageService)
 {
     _logger          = logger;
     _serviceService  = serviceService;
     _mortgageService = mortgageService;
 }
 public OrdersController(
     IOrdersService ordersService,
     IProductsService productsService,
     IServicesService servicesService)
 {
     this.ordersService   = ordersService;
     this.productsService = productsService;
     this.servicesService = servicesService;
 }
Пример #20
0
		public ViewServicesWindow()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			_servicesService = ObjectLocator.GetInstance<IServicesService>();
			gridServices.ItemsSource = _servicesService.GetAllServices();
		}
Пример #21
0
        public ViewServicesWindow()
        {
            InitializeComponent();

            WindowHelper.CheckAndApplyTheme(this);

            _servicesService         = ObjectLocator.GetInstance <IServicesService>();
            gridServices.ItemsSource = _servicesService.GetAllServices();
        }
Пример #22
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="servicesService">Services service.</param>
 /// <param name="serviceHealthService">Searvices health service.</param>
 /// <param name="consensusContext">Context of consensus protocol.</param>
 public ServicesController(
     IServicesService servicesService,
     IServiceHealthService serviceHealthService,
     IConsensusContext consensusContext)
 {
     _servicesService      = servicesService;
     _serviceHealthService = serviceHealthService;
     _consensusContext     = consensusContext;
 }
Пример #23
0
        public NewServiceWindow()
        {
            InitializeComponent();

            WindowHelper.CheckAndApplyTheme(this);

            servicesService = ObjectLocator.GetInstance<IServicesService>();
            gridServices.DataSource = servicesService.GetAllNonInitializedNonTestedServices();
        }
        public async Task Create_WithNull_ShouldThrowArgumentNullException()
        {
            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            this.servicesService = new ServicesService(dbContext);

            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                             await this.servicesService.CreateServiceAsync(null));
        }
Пример #25
0
 public LogReplicationHandler(
     IServiceHealthService serviceHealthService,
     IServicesService servicesService,
     IKvPropertyService kvPropertyService)
 {
     _serviceHealthService = serviceHealthService;
     _servicesService      = servicesService;
     _kvPropertyService    = kvPropertyService;
 }
Пример #26
0
 public ServicesController(
     ICategoriesService categoriesService,
     IServicesService servicesService,
     ICloudinaryService cloudinaryService)
 {
     this.categoriesService = categoriesService;
     this.servicesService   = servicesService;
     this.cloudinaryService = cloudinaryService;
 }
Пример #27
0
 public CardController(UserManager <AppUser> userManager, ICardService cardService,
                       IUserService userService, IPacientService pacientService, IServicesService servicesService)
 {
     _userManager     = userManager;
     _cardService     = cardService;
     _userService     = userService;
     _pacientService  = pacientService;
     _servicesService = servicesService;
 }
Пример #28
0
 public BusinessmanProfileViewModel(IMvxNavigationService navigationService,
                                    IProfileService profileService,
                                    ISubscribeService subscribeService,
                                    IServicesService servicesService)
 {
     _navigationService = navigationService;
     _profileService    = profileService;
     _subscribeService  = subscribeService;
     _servicesService   = servicesService;
 }
		public UploadProductsWindow()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			_servicesService = ObjectLocator.GetInstance<IServicesService>();
			_licenseSetService = ObjectLocator.GetInstance<ILicenseSetService>();
			_licenseService = ObjectLocator.GetInstance<ILicenseService>();
		}
Пример #30
0
        public ServicesServiceTests()
        {
            this.services = new List <Service>();

            var servicesRepository = new EfDeletableEntityRepository <Service>(this.DbContext);

            this.service = new ServicesService(servicesRepository);

            this.InitializeRepositoriesData();
        }
Пример #31
0
 public ScheduleController(IScheduleService scheduleService
                           , IPersonnelService personnelService
                           , IUserService userService
                           , IServicesService servicesService)
 {
     _scheduleService  = scheduleService;
     _personnelService = personnelService;
     _userService      = userService;
     _servicesService  = servicesService;
 }
        public async Task Delete_WithNonExistentServiceId_ShouldThrowArgumentNullException()
        {
            var dbContext = ApplicationDbContextInMemoryFactory.InitializeContext();

            await this.SeedData(dbContext);

            this.servicesService = new ServicesService(dbContext);

            await Assert.ThrowsAsync <ArgumentNullException>(async() => await this.servicesService.DeleteByIdAsync(3));
        }
Пример #33
0
        public UploadProductsWindow()
        {
            InitializeComponent();

            WindowHelper.CheckAndApplyTheme(this);

            _servicesService   = ObjectLocator.GetInstance <IServicesService>();
            _licenseSetService = ObjectLocator.GetInstance <ILicenseSetService>();
            _licenseService    = ObjectLocator.GetInstance <ILicenseService>();
        }
Пример #34
0
 public BusinessController(IBusinessService businessService
                           , IPersonnelService personnelService
                           , IServicesService servicesService
                           , IUserService userService)
 {
     _businessService  = businessService;
     _personnelService = personnelService;
     _servicesService  = servicesService;
     _userService      = userService;
 }
		public ServiceInitializationWindow()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			_eventAggregator = ObjectLocator.GetInstance<IEventAggregator>();
			_eventAggregator.AddListener<ServiceTestingEvent>(x => ServiceTestingAndInitialization(x));

			_servicesService = ObjectLocator.GetInstance<IServicesService>();
		}
Пример #36
0
		public ServicesScreen()
		{
			InitializeComponent();

			WindowHelper.CheckAndApplyTheme(this);

			_servicesService = ObjectLocator.GetInstance<IServicesService>();
			_eventAggregator = ObjectLocator.GetInstance<IEventAggregator>();

			_eventAggregator.AddListener<ServicesUpdatedEvent>(x => gridServices.ItemsSource = _servicesService.GetAllServices());
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="ServicesController" /> class.
        /// </summary>
        /// <param name="configurationService">The configuration service.</param>
        /// <param name="servicesService">The services service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="resolverService">The resolver service.</param>
        public ServicesController(
            IConfigurationService configurationService,
            IServicesService servicesService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            IReadMeService readMeService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IResolverService resolverService)
            : base(configurationService,
            visualStudioService, 
            readMeService, 
            settingsService, 
            messageBoxService,
            resolverService)
        {
            TraceService.WriteLine("ServicesController::Constructor");

            this.servicesService = servicesService;
            this.nugetService = nugetService;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ServicesController" /> class.
        /// </summary>
        /// <param name="servicesService">The services service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="formsService">The forms service.</param>
        public ServicesController(
            IServicesService servicesService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            IReadMeService readMeService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IDialogService dialogService,
            IFormsService formsService)
            : base(visualStudioService, 
            readMeService, 
            settingsService, 
            messageBoxService,
            dialogService,
            formsService)
        {
            TraceService.WriteLine("ServicesController::Constructor");

            this.servicesService = servicesService;
            this.nugetService = nugetService;
        }
Пример #39
0
 public ServicesController(IServicesService servicesService)
 {
     _servicesService = servicesService;
 }
 public RegistratedServicesController(IServicesService servicesService)
 {
     _servicesService = servicesService;
 }
Пример #41
0
 public ServicesController(IServicesService servicesService,ISettingsService settingsService)
 {
     _servicesService = servicesService;
     _settingsService = settingsService;
 }
Пример #42
0
 public ServicesRepository(IServicesService servicesService)
 {
     _servicesService = servicesService;
 }