public TimerService(IConfigProvider configProvider, IDateTimeWrapper dateTimeWrapper, ILogger <TimerService> logger, ITariffService tariffService) { _config = configProvider.Get <TimerConfig>(); _dateTimeWrapper = dateTimeWrapper; _logger = logger; _tariffService = tariffService; }
public HostedSolution( IConfiguration configuration, ConnectionStringSettings connectionString, TariffServiceStorage tariffServiceStorage, IOptionsMonitor <ILog> options, TenantUtil tenantUtil, TenantDomainValidator tenantDomainValidator, TenantDbContext tenantDbContext, UserDbContext userDbContext, CoreDbContext coreDbContext, string region) { tenantService = new DbTenantService(tenantDbContext, tenantDomainValidator); var baseSettings = new CoreBaseSettings(configuration); coreSettings = new CoreSettings(tenantService, baseSettings, configuration); userService = new EFUserService(userDbContext); quotaService = new DbQuotaService(coreDbContext); tariffService = new TariffService(quotaService, tenantService, baseSettings, coreSettings, configuration, coreDbContext, tariffServiceStorage, options); clientTenantManager = new TenantManager(tenantService, quotaService, tariffService, null, baseSettings, coreSettings); settingsManager = new DbSettingsManager(connectionString); TenantUtil = tenantUtil; Region = region ?? string.Empty; }
public ClientPaymentManager(IConfigurationClient config, IQuotaService quotaService, ITariffService tariffService) { this.config = config; this.quotaService = quotaService; this.tariffService = tariffService; partnerUrl = (ConfigurationManager.AppSettings["core.payment-partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/'); partnerKey = (ConfigurationManager.AppSettings["core.machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF"); }
public PaymentManager(TenantManager tenantManager, ITariffService tariffService, IConfiguration configuration) { TenantManager = tenantManager; this.tariffService = tariffService; Configuration = configuration; partnerUrl = (Configuration["core:payment:partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/'); partnerKey = (Configuration["core:machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF"); }
public TariffPageController(IPlanService planService, IUniquePageService uniquepageService, IPageMessageSvc pageMessageSvc, IHelperService helperService, ITariffService tariffService, IProviderService Providersvc, IUserService userservice) { _uniquePageService = uniquepageService; _pageMessageSvc = pageMessageSvc; _helperSvc = helperService; _userservice = userservice; _tariffService = tariffService; _providerSvc = Providersvc; }
public TariffController(ICustomerService customerService, IAccountsService accountsService, IPackageService packageService, IDiscountService discountService, ITariffService tariffService) { _customerService = customerService; _accountsService = accountsService; _packageService = packageService; _discountService = discountService; _tariffService = tariffService; }
public HostedSolution(ConnectionStringSettings connectionString, string region) { tenantService = new DbTenantService(connectionString); userService = new DbUserService(connectionString); quotaService = new DbQuotaService(connectionString); tariffService = new TariffService(connectionString, quotaService, tenantService); clientTenantManager = new TenantManager(tenantService, quotaService, tariffService); Region = region ?? string.Empty; DbId = connectionString.Name; }
public TenantManager( ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService, IHttpContextAccessor httpContextAccessor, CoreBaseSettings coreBaseSettings, CoreSettings coreSettings) : this(tenantService, quotaService, tariffService, coreBaseSettings, coreSettings) { HttpContextAccessor = httpContextAccessor; }
public ClientTenantManager(ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService) { this.tenantService = tenantService; this.quotaService = quotaService; this.tariffService = tariffService; thisCompAddresses.Add("localhost"); thisCompAddresses.Add(Dns.GetHostName().ToLowerInvariant()); thisCompAddresses.AddRange(Dns.GetHostAddresses("localhost").Select(a => a.ToString())); thisCompAddresses.AddRange(Dns.GetHostAddresses(Dns.GetHostName()).Select(a => a.ToString())); }
public AdminController( ITariffService tariffService, ITariffOptionDescriptionService tariffOptionDescriptionService, ITariffOptionsService tariffOptionsService, IAdminBugReportsService bugReportsService) { _tariffService = tariffService; _tariffOptionDescriptionService = tariffOptionDescriptionService; _tariffOptionsService = tariffOptionsService; _bugReportsService = bugReportsService; }
public TenantManager(ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService) { this.tenantService = tenantService; this.quotaService = quotaService; this.tariffService = tariffService; thisCompAddresses.Add("localhost"); thisCompAddresses.Add(Dns.GetHostName().ToLowerInvariant()); thisCompAddresses.AddRange(Dns.GetHostAddresses("localhost").Select(a => a.ToString())); thisCompAddresses.AddRange(Dns.GetHostAddresses(Dns.GetHostName()).Select(a => a.ToString())); }
public TariffController(ITariffService tariffService, ICountryService countryService, ICurrencyService currencyService, IAgentService agentService, IRangeService rangeService) { _tariffService = tariffService; _countryService = countryService; _currencyService = currencyService; _agentService = agentService; _rangeService = rangeService; }
//private readonly INotificationHubService _notificationHubService; public ProviderService(ISession session, IUserService userservice, IHelperService helpersvc, IServicesService servicesvc, IPlanService plansvc, IUniquePageService uniquepage, ITariffService tariffservice, ICompanyService companyservice) { _session = session; _userService = userservice; _helpersvc = helpersvc; _servicevc = servicesvc; _plansvc = plansvc; _uniquePageService = uniquepage; _tariffService = tariffservice; _companyService = companyservice; //_notificationHubService = notificationHub; }
public TenantManager( ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService, CoreBaseSettings coreBaseSettings, CoreSettings coreSettings) { TenantService = tenantService; QuotaService = quotaService; TariffService = tariffService; CoreBaseSettings = coreBaseSettings; CoreSettings = coreSettings; }
private static void StartHotelReservation() { try { // Welcome Console.WriteLine("Welcome to Hotel Reservation"); Console.WriteLine(); // Client type string inputClientType; do { Console.WriteLine("Hello, what is your customer profile? (1 to REGULAR and 2 to FIDELIDADE)"); inputClientType = Console.ReadLine(); } while (!inputClientType.Equals("1") && !inputClientType.Equals("2")); ClientType clientType = inputClientType.Equals("1") ? ClientType.Regular : ClientType.Fidelidade; // Period: start date string inputStartDate; DateTime startDate; do { Console.WriteLine("Enter the start date: (DD/MM/YYYY)"); inputStartDate = Console.ReadLine(); } while (!inputStartDate.IsDateTime(out startDate)); // Period: end date string inputEndDate; DateTime endDate; do { Console.WriteLine("Enter the end date: (DD/MM/YYYY)"); inputEndDate = Console.ReadLine(); } while (!inputEndDate.IsDateTime(out endDate)); // Verify best hotel ITariffService tariffService = Service.GetService <ITariffService>(); Tariff bestTariff = tariffService.GetBestTariff(clientType, DateCommonService.GetPeriod(startDate, endDate)); // Output Console.WriteLine($"The cheapest hotel is {bestTariff.Hotel.Name}"); Console.WriteLine($"The price is R$ {bestTariff.Price}"); } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message} - InnserException: {ex.InnerException.Message}"); } }
public void Initialise() { _customerService = Substitute.For <ICustomerService>(); _packageService = Substitute.For <IPackageService>(); _discountService = Substitute.For <IDiscountService>(); _tariffService = Substitute.For <ITariffService>(); _accountsService = Substitute.For <IAccountsService>(); _controller = new TariffController(_customerService, _accountsService, _packageService, _discountService, _tariffService); _customerService.GetAccount(Arg.Any <string>()).Returns(new CustomerAccount()); _tariffService.GetTariffInfo(Arg.Any <string>()).Returns(new TariffInfo { Tariffs = new List <Tariff>() }); }
public TenantManager( ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService, IHttpContextAccessor httpContextAccessor, CoreBaseSettings coreBaseSettings, CoreSettings coreSettings) { TenantService = tenantService; QuotaService = quotaService; TariffService = tariffService; CoreBaseSettings = coreBaseSettings; CoreSettings = coreSettings; HttpContext = httpContextAccessor?.HttpContext; }
//private readonly INotificationHubService _notificationHubService; public ClaimService(ISession session, IUserService userservice, IHelperService helpersvc, IServicesService servicesvc, IPlanService plansvc, IUniquePageService uniquepage, ITariffService tariffservice, IRoleService roleService, ISystemConfigurationProvider systemConfigurationProvider, IProviderService providerSvc, IEmailSender emailSender, MailSettings mailSettings) { _session = session; _userService = userservice; _helpersvc = helpersvc; _servicevc = servicesvc; _plansvc = plansvc; _uniquePageService = uniquepage; _tariffService = tariffservice; _roleSvc = roleService; _systemConfigurationProvider = systemConfigurationProvider; _providersvc = providerSvc; _emailSender = emailSender; _mailSettings = mailSettings; //_notificationHubService = notificationHub; }
public void ReturnOneTariff() { // Arranje List <DateTime> period = new List <DateTime> { new DateTime(2020, 03, 16) }; // Act hotelRepository = new MockHotelRepository(); tariffService = new TariffService(hotelRepository); Tariff tariff = tariffService.GetBestTariff(ClientType.Fidelidade, period); // Assert Assert.NotNull(tariff); }
public void ReturnMarAtlantico240() { // Arranje List <DateTime> period = new List <DateTime> { new DateTime(2020, 03, 26), new DateTime(2020, 03, 27), new DateTime(2020, 03, 28), }; // Act hotelRepository = new MockHotelRepository(); tariffService = new TariffService(hotelRepository); Tariff tariff = tariffService.GetBestTariff(ClientType.Fidelidade, period); // Assert Tariff expctedTariff = new Tariff(hotelRepository.GetAll()[2], 240); Assert.Equal(JsonConvert.SerializeObject(expctedTariff), JsonConvert.SerializeObject(tariff)); }
public void ReturnJardimBotanico280() { // Arranje List <DateTime> period = new List <DateTime> { new DateTime(2020, 03, 20), new DateTime(2020, 03, 21), new DateTime(2020, 03, 22), }; // Act hotelRepository = new MockHotelRepository(); tariffService = new TariffService(hotelRepository); Tariff tariff = tariffService.GetBestTariff(ClientType.Regular, period); // Assert Tariff expctedTariff = new Tariff(hotelRepository.GetAll()[1], 280); Assert.Equal(JsonConvert.SerializeObject(expctedTariff), JsonConvert.SerializeObject(tariff)); }
public void ReturnParqueDasFlores330() { // Arranje List <DateTime> period = new List <DateTime> { new DateTime(2020, 03, 16), new DateTime(2020, 03, 17), new DateTime(2020, 03, 18), }; // Act hotelRepository = new MockHotelRepository(); tariffService = new TariffService(hotelRepository); Tariff tariff = tariffService.GetBestTariff(ClientType.Regular, period); // Assert Tariff expctedTariff = new Tariff(hotelRepository.GetAll()[0], 330); Assert.Equal(JsonConvert.SerializeObject(expctedTariff), JsonConvert.SerializeObject(tariff)); }
public ConnectCarePageController(IPlanService planService, IUniquePageService uniquepageService, IPageMessageSvc pageMessageSvc, IHelperService helperService, IServicesService serviceSvc, IProviderService Providersvc, ILogAdminService logger, ITariffService tariffService, ICompanyService companyService, IEnrolleeService enrolleeService, ISmsService smsSvc, IUserChat UserChat, IClaimService claimservice, IUserService userservice) { _planService = planService; _uniquePageService = uniquepageService; _pageMessageSvc = pageMessageSvc; _helperSvc = helperService; _serviceSvc = serviceSvc; _providerSvc = Providersvc; _logger = logger; _tariffSvc = tariffService; _companyService = companyService; _enrolleeService = enrolleeService; _smsservice = smsSvc; _chatservice = UserChat; _claimsvc = claimservice; _userservice = userservice; serv = new ServiceReference1.WebServiceSoapClient(); }
//TODO:fix public HostedSolution( IConfiguration configuration, TenantDomainValidator tenantDomainValidator, TimeZoneConverter timeZoneConverter, DbRegistry dbRegistry, ConnectionStringSettings connectionString, TariffServiceStorage tariffServiceStorage, IOptionsMonitor <ILog> options, string region) { tenantService = new DbTenantService(null, null, null); var baseSettings = new CoreBaseSettings(configuration); coreSettings = new CoreSettings(tenantService, baseSettings, configuration); userService = new DbUserService(null); quotaService = new DbQuotaService(null); tariffService = new TariffService(quotaService, tenantService, baseSettings, coreSettings, configuration, null, tariffServiceStorage, options); clientTenantManager = new TenantManager(tenantService, quotaService, tariffService, null, baseSettings, coreSettings); settingsManager = new DbSettingsManager(connectionString); Region = region ?? string.Empty; DbId = connectionString.Name; }
public PaymentManager(ITariffService tariffService) { this.tariffService = tariffService; partnerUrl = (ConfigurationManagerExtension.AppSettings["core.payment-partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/'); partnerKey = (ConfigurationManagerExtension.AppSettings["core.machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF"); }
public TariffController(ITariffService tariffService) { _tariffService = tariffService; }
public TariffServiceTest() { var cs = ConfigurationManager.ConnectionStrings["core"]; tariffService = new TariffService(cs, new DbQuotaService(cs), new DbTenantService(cs)); }
public TariffController(ITariffService tariffService, IMapper mapper) { _tariffService = tariffService; _mapper = mapper; }
public TariffServiceTests() { _mockProductService = new Mock <IProductService>(); _tariffService = new TariffService(_mockProductService.Object); }
public FrmTariff(ITariffService tariffService) { InitializeComponent(); this.tariffService = tariffService; frmTariff = this; }
public TariffServiceTest() { tariffService = new TariffService(null, null, null, null, null, (CoreDbContext)null, null, null); }