public JobController(IAzureBlobService azureBlobService, IOptions <ApplicationSettings> appSetting, AuthenticationContext context, IJobService jobService)
 {
     _azureBlobService = azureBlobService;
     _appSetting       = appSetting.Value;
     _dbContext        = context;
     _jobService       = jobService;
 }
Beispiel #2
0
        private async Task SearchProductAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var message = await result as Activity;

            using (var scope = WebApiApplication.Container.BeginLifetimeScope())
            {
                ID365Service d356Service = scope.Resolve <ID365Service>(new TypedParameter(typeof(IDialogContext), context));

                var products = await d356Service.GetProducts(message.Text);

                if (products.Count > 5)
                {
                    await context.PostAsync(string.Format(Resource.Retry_More_Than_x_Items, 5));

                    context.Wait(SearchProductAsync);
                }
                else
                {
                    Activity reply = message.CreateReply();
                    reply.AttachmentLayout = "carousel";
                    reply.Attachments      = new List <Attachment>();

                    foreach (var product in products)
                    {
                        IAzureBlobService blobService = scope.Resolve <IAzureBlobService>();

                        var imageUrl = blobService.Upload(product.Image, product.Number);
                        List <CardImage> cardImages = new List <CardImage>();
                        cardImages.Add(new CardImage(url: imageUrl));

                        List <CardAction> cardButtons = new List <CardAction>();

                        CardAction plButton = new CardAction()
                        {
                            //Value = $"ms-dynamicsxrm://?pagetype=create&etn=appointment",
                            Value = $"{ConfigurationManager.AppSettings["D365Url"]}/m/ef.aspx?etn=product&id=%7b{product.Id}%7d",
                            Type  = "openUrl",
                            Title = Resource.Detail
                        };

                        cardButtons.Add(plButton);

                        ThumbnailCard plCard = new ThumbnailCard()
                        {
                            Title    = product.Name,
                            Subtitle = product.Description,
                            Images   = cardImages,
                            Buttons  = cardButtons
                        };

                        Attachment plAttachment = plCard.ToAttachment();
                        reply.Attachments.Add(plAttachment);
                    }

                    await context.PostAsync(reply);

                    context.Done(true);
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StudentService"/> class.
 /// </summary>
 /// <param name="emailService">The emailService<see cref="IEmailService"/>.</param>
 /// <param name="tableStorage">The tableStorage<see cref="ITableStorage"/>.</param>
 /// <param name="mapper">The mapper<see cref="IMapper"/>.</param>
 /// <param name="azureBlobService">The azureBlobService<see cref="IAzureBlobService"/>.</param>
 public StudentService(IEmailService emailService, ITableStorage tableStorage, IMapper mapper, IAzureBlobService azureBlobService)
 {
     _tableStorage     = tableStorage;
     _mapper           = mapper;
     _emailService     = emailService;
     _azureBlobService = azureBlobService;
 }
Beispiel #4
0
 public AccountController(CMSShoppingContext db, IMapper mapper, IConfiguration configuration, IAzureBlobService azureBlobService)
 {
     _db               = db;
     _mapper           = mapper;
     _configuration    = configuration;
     _azureBlobService = azureBlobService;
 }
 public PersonController(IPersonRepository personRepository,
                         IMapper mapper, IAzureBlobService azureBlobService)
 {
     _personRepository = personRepository;
     _mapper           = mapper;
     _azureBlobService = azureBlobService;
 }
Beispiel #6
0
 public Service(IEmailService emailService,
                IIdentityService identityService,
                IRabbitMQService rabbitMQService,
                IAzureBlobService azureBlobService,
                IAnnotationService annotationService,
                IAnswerService answerService,
                IEssayExerciseService essayExerciseService,
                ILogService logService,
                IMultipleChoicesExerciseService multipleChoicesExerciseService,
                IStudentService studentService,
                ITestService testService,
                IMultipleChoicesAnswerService multipleChoicesAnswerService,
                IEssayAnswerService essayAnswerService)
 {
     EmailService                   = emailService;
     IdentityService                = identityService;
     RabbitMQService                = rabbitMQService;
     AzureBlobService               = azureBlobService;
     AnnotationService              = annotationService;
     AnswerService                  = answerService;
     EssayExerciseService           = essayExerciseService;
     LogService                     = logService;
     MultipleChoicesExerciseService = multipleChoicesExerciseService;
     StudentService                 = studentService;
     TestService                    = testService;
     EssayAnswerService             = essayAnswerService;
     MultipleChoicesAnswerService   = multipleChoicesAnswerService;
 }
Beispiel #7
0
 public UserController(IUserService userService, IConfiguration configuration, IAzureBlobService azureBlobService, GoogleHttpService googleHttpService, FacebookHttpService facebookHttpService)
 {
     _userService         = userService;
     _configuration       = configuration;
     _azureBlobService    = azureBlobService;
     _googleHttpService   = googleHttpService;
     _facebookHttpService = facebookHttpService;
 }
Beispiel #8
0
 public UploadFileController(IAzureBlobService azureBlobService,
                             ITutorialStepService tutorialStepService,
                             ITutorialService tutorialService)
 {
     _azureBlobService    = azureBlobService;
     _tutorialStepService = tutorialStepService;
     _tutorialService     = tutorialService;
 }
 public HomeController(IEmployeeRepository emp,
                       IHostingEnvironment hostingEnvironment, IConfiguration configuration, IAzureBlobService azureBlobService)
 {
     _employeerepository      = emp;
     this._hostingEnvironment = hostingEnvironment;
     Configuration            = configuration;
     AzureBlobService         = azureBlobService;
 }
Beispiel #10
0
 public BlobController(IAzureBlobService azureBlobService, IOptions <AppSettings> options, IAdminRepositoryDb adminRepositoryDb, IFileManager fileManager)
     : base(adminRepositoryDb, options)
 {
     this.azureBlobService  = azureBlobService;
     this.options           = options;
     this.fileManager       = fileManager;
     this.adminRepositoryDb = adminRepositoryDb;
 }
Beispiel #11
0
 public BlobController(IAzureBlobService azureBlobService, IConfiguration config, ILogger <AdminController> logger, IOptions <AppSettings> appSettings)
 {
     _azureBlobService = azureBlobService;
     Configuration     = config;
     CS.Business.Database.Configuration = config;
     JwtSecurity.Configuration          = config;
     Logger       = logger;
     _appSettings = appSettings.Value;
 }
        public Seeder(IServiceProvider serviceProvider, IConfiguration configuration)
        {
            var connectionString = configuration.GetConnectionString("DefaultConnection");

            this.context = new ApplicationDbContext(connectionString);

            //Set up blob service client
            this.blobServiceClient = new BlobServiceClient(configuration["AzureBlobStorage:ConnectionString"]);

            //Set up azure blob service
            this.azureBlobService = new AzureBlobService(this.blobServiceClient);

            //Set up gender service
            this.genderService = new GenderService(context);

            //Set up roleService
            var roleManager = serviceProvider.GetRequiredService <RoleManager <Role> >();

            this.roleService = new RoleService(context, roleManager);

            //Set up automapper
            var mapperConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddMaps(typeof(UserProfile));
            });

            this.mapper = mapperConfig.CreateMapper();

            //Set up userService
            var userManager = serviceProvider.GetRequiredService <UserManager <User> >();

            this.userService = new UserService(context, this.roleService as RoleService, this.genderService as GenderService, userManager, this.mapper);

            //Set up productImageService
            this.productImageService = new ProductImageService(context, this.azureBlobService);

            //Set up categoryService
            this.categoryService = new CategoryService(context);

            //Set up productService
            this.productService = new ProductService(context, this.mapper, this.productImageService, this.categoryService);

            //Set up productCommentService
            this.productCommentService = new ProductCommentService(context);

            //Set up countryService
            this.countryService = new CountryService(context);

            //Set up countryService
            this.paymentMethodService = new PaymentMethodService(context);

            //Set up sales service
            this.saleService = new SaleService(context);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CognitiveService"/> class.
        /// </summary>
        /// <param name="faceClient">The faceClient<see cref="IFaceClient"/>.</param>
        /// <param name="azureBlobService">The azureBlobService<see cref="IAzureBlobService"/>.</param>
        /// <param name="tableStorage">The tableStorage<see cref="ITableStorage"/>.</param>
        /// <param name="studentService">The studentService<see cref="IStudentService"/>.</param>
        public CognitiveService(IFaceClient faceClient, IAzureBlobService azureBlobService, ITableStorage tableStorage, IStudentService studentService)
        {
            _faceClient       = faceClient;
            _azureBlobService = azureBlobService;
            _tableStorage     = tableStorage;
            _studentService   = studentService;

            if (Uri.IsWellFormedUriString(SettingConfigurations.CognitiveServiceEndPoint, UriKind.Absolute))
            {
                faceClient.Endpoint = SettingConfigurations.CognitiveServiceEndPoint;
            }
        }
 public GameSlateRepository(IGameRepository gameRepository,
                            ITeamRepository teamRepository,
                            IGameTeamRepository gameTeamRepository,
                            IStadiumRepository stadiumRepository,
                            IAzureBlobService azureBlobService)
 {
     _gameRepository     = gameRepository;
     _teamRepository     = teamRepository;
     _gameTeamRepository = gameTeamRepository;
     _stadiumRepository  = stadiumRepository;
     _azureBlobService   = azureBlobService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SecaoArquivoAppService"/> class.
 ///     Construtor padrão de <see cref="SecaoArquivoAppService"/>.
 /// </summary>
 /// <param name="uow">
 ///     Contrato do Unit of Work. Veja <see cref="IUnitOfWork"/>.
 /// </param>
 /// <param name="mapper">
 ///     Contrato do AutoMapper. Veja <see cref="IMapper"/>.
 /// </param>
 /// <param name="repository">
 ///     O repositório da entidade Recurso. Veja <see cref="ISecaoArquivoRepository"/>.
 /// </param>
 public SecaoArquivoAppService(
     IUnitOfWork uow,
     IMapper mapper,
     ISecaoArquivoRepository repository,
     ITagAppService tagService,
     ISecaoArquivoTagAppService secaoArquivoTagService,
     IAzureBlobService azureBlobService,
     IDocumentService documentService)
     : base(uow, mapper, repository)
 {
     this.tagService             = tagService;
     this.secaoArquivoTagService = secaoArquivoTagService;
     this.azureBlobService       = azureBlobService;
     this.documentService        = documentService;
 }
 public ProductsController
     (IProductService productService, IMapper mapper, IProductCommentService productCommentService, IUserService userService,
     JavaScriptEncoder javaScriptEncoder, UserManager <User> userManager, SendGridEmailSender sendGridEmailSender,
     HtmlEncoder htmlEncoder, ICategoryService categoryService, IProductImageService productImageService,
     BlobServiceClient blobServiceClient, IAzureBlobService azureBlobService)
 {
     this.productService        = productService;
     this.mapper                = mapper;
     this.productCommentService = productCommentService;
     this.userService           = userService;
     this.javaScriptEncoder     = javaScriptEncoder;
     this.userManager           = userManager;
     this.sendGridEmailSender   = sendGridEmailSender;
     this.htmlEncoder           = htmlEncoder;
     this.categoryService       = categoryService;
     this.productImageService   = productImageService;
     this.blobServiceClient     = blobServiceClient;
     this.azureBlobService      = azureBlobService;
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PropostaAppService"/> class.
 ///     Construtor padrão de <see cref="PropostaAppService"/>.
 /// </summary>
 /// <param name="uow">
 ///     Contrato do Unit of Work. Veja <see cref="IUnitOfWork"/>.
 /// </param>
 /// <param name="mapper">
 ///     Contrato do AutoMapper. Veja <see cref="IMapper"/>.
 /// </param>
 /// <param name="repository">
 ///     O repositório da entidade Proposta. Veja <see cref="IPropostaRepository"/>.
 /// </param>
 public PropostaAppService(
     IUnitOfWork uow,
     IMapper mapper,
     IPropostaRepository repository,
     ITemplateSecaoRepository templateSecaoRepository,
     IRecursoRepository recursoRepository,
     IClienteRepository clienteRepository,
     IAzureBlobService azureBlobService,
     IDocumentService documentService,
     ISecaoArquivoTagRepository secaoArquivoTagRepository)
     : base(uow, mapper, repository)
 {
     this.templateSecaoRepository   = templateSecaoRepository;
     this.recursoRepository         = recursoRepository;
     this.clienteRepository         = clienteRepository;
     this.azureBlobService          = azureBlobService;
     this.documentService           = documentService;
     this.secaoArquivoTagRepository = secaoArquivoTagRepository;
 }
Beispiel #18
0
 public AdminRecipeService(MLDevelopmentContext db, IMapper mapper, IAzureBlobService azureBlobService)
 {
     _db               = db;
     _mapper           = mapper;
     _azureBlobService = azureBlobService;
 }
Beispiel #19
0
 public AdminController(BarberSOnlineContext context, IAzureBlobService azureBlobService)
 {
     _context          = context;
     _azureBlobService = azureBlobService;
 }
 public FGGroupRoleService(IUnitOfWork <DbContext> unitOfWork, IAzureBlobService cloudService) : base(unitOfWork, cloudService)
 {
 }
Beispiel #21
0
 public DocumentService(IAzureBlobService azureBlobService)
 {
     this.azureBlobService = azureBlobService;
 }
 public FGRoleEquipmentService(IUnitOfWork <DbContext> unitOfWork, IAzureBlobService cloudService, IConfiguration configuration) : base(unitOfWork, cloudService)
 {
     _containerName = configuration.GetValue <string>(ConfigurationKeyConstant.FGRoleEquipmentContainer);
 }
 public ProfileActionsController(IAzureBlobService azureBlobService)
 {
     _azureBlobService = azureBlobService;
 }
Beispiel #24
0
 public IssueItemService(IUnitOfWork <DbContext> unitOfWork, IAzureBlobService cloudService, IConfiguration configuration) : base(unitOfWork, cloudService)
 {
     _containerName = configuration.GetValue <string>(ConfigurationKeyConstant.IssueItemContainer);
 }
Beispiel #25
0
 public BlobController(IAzureBlobService azureBlobService)
 {
     _azureBlobService = azureBlobService;
 }
 public FGChapterComicService(IUnitOfWork <DbContext> unitOfWork, IAzureBlobService cloudService, IConfiguration configuration) : base(unitOfWork, cloudService)
 {
     _containerName = configuration.GetValue <string>(ConfigurationKeyConstant.FGSeasonChapterComicContainer);
 }
 public DownloadSalariesCommandHandler(ILogger <DownloadSalariesCommandHandler> logger, IOpenReddingDbContext context, IAzureBlobService blobService) =>
 (_logger, _context, _blobService) = (logger, context, blobService);
Beispiel #28
0
 public UserService(IUnitOfWork <DbContext> unitOfWork, IAzureBlobService cloudService) : base(unitOfWork, cloudService)
 {
 }
Beispiel #29
0
 public ImageGalleryController(IAzureBlobService azureBlobService)
 {
     _azureBlobService = azureBlobService;
 }
 public DeleteProductsImagesBlobs(IProductImageService productImageService, IAzureBlobService azureBlobService)
 {
     this.productImageService = productImageService;
     this.azureBlobService    = azureBlobService;
 }