コード例 #1
0
ファイル: SettingsLookup.cs プロジェクト: dbartels13/Common
        /// <summary>
        /// Retrieves a setting
        /// </summary>
        /// <param name="services">The collection of lookup services</param>
        /// <param name="name">The name of the setting to retrieve</param>
        /// <param name="defaultValue">If the setting is not found, or there is an error retrieving the setting, this will be returned instead</param>
        /// <returns>The string setting (If you need to convert to something else, that will be done outside this call)</returns>
        public static string Get(ILookupServices <T, TS> services, string name, string defaultValue)
        => SafeTry.IgnoreException(
            () =>
        {
            var service = services.Service;
            if (service.Key == null)
            {
                return(defaultValue);
            }

            var cachingSeconds = CachingSeconds(service);

            // Get the collection of settings inside a Lock (this is possibly recursive, so can't use semaphore locking)
            var settingsCollection = NamedLocker.Lock($"{service.Key}_Locker",
                                                      num => num > 1
                            ? null // If recursive (will be allowed in lock again), the default value will be used instead of a real lookup
                            : GetItems(cachingSeconds, service, services.Cache));

            // If the above failed to find anything (eg. no settings, or a recursive call)
            if (settingsCollection.IsDefault())
            {
                return(defaultValue);
            }

            // Return the setting value (or default if no setting exists)
            var setting = service.GetItem(settingsCollection, name);
            return(setting.IsDefault() ? defaultValue : service.GetValue(setting));
        },
            defaultValue
            );
コード例 #2
0
 public InventoryTransactionController(ICoreOrderService orderService, IPurchaseOrderService purchaseOrderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IProductServices productServices, IProductLookupService productLookupService) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _productServices      = productServices;
     _productLookupService = productLookupService;
     _lookupServices       = lookupServices;
     _purchaseOrderService = purchaseOrderService;
 }
コード例 #3
0
 public BaseController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices)
 {
     OrderService    = orderService;
     PropertyService = propertyService;
     AccountServices = accountServices;
     LookupServices  = lookupServices;
 }
コード例 #4
0
 public AccountController(ICoreOrderService orderService, IMarketServices marketServices, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IUserService userService, IInvoiceService invoiceService)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _marketServices = marketServices;
     _userService    = userService;
     _invoiceService = invoiceService;
     _lookupServices = lookupServices;
 }
コード例 #5
0
 public RecruitmentController(HrmsDbContext context,
                              IHostingEnvironment environment,
                              ILookupServices lookup)
 {
     _context     = context;
     _environment = environment;
     _lookup      = lookup;
 }
コード例 #6
0
ファイル: HomeViewModel.cs プロジェクト: Yaocalli/GymSystem
        public HomeViewModel(
            ILookupServices lookupServices,
            IEventAggregator eventAggregator)
        {
            _lookupServices  = lookupServices;
            _eventAggregator = eventAggregator;

            MenuItems = new ObservableCollection <NavigationItemViewModel>();
        }
コード例 #7
0
 public HomeController(ICoreOrderService orderService, IProductServices productServices, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IUserService userService, IActivityServices activityServices, ITenantsServices tenantServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _lookupServices   = lookupServices;
     _userService      = userService;
     _activityServices = activityServices;
     _tenantServices   = tenantServices;
     _productServices  = productServices;
 }
コード例 #8
0
 public TenantConfigsController(ITenantsServices tenantsServices, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IUserService userService, IInvoiceService invoiceService)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _userService     = userService;
     _invoiceService  = invoiceService;
     _lookupServices  = lookupServices;
     _accountServices = accountServices;
     _tenantsServices = tenantsServices;
 }
コード例 #9
0
 public ApiOrdersSyncController(ITerminalServices terminalServices, IPurchaseOrderService purchaseOrderService,
                                ITenantLocationServices tenantLocationServices, IOrderService orderService,
                                IProductServices productServices, IUserService userService, ILookupServices lookupService, IProductServices productService) :
     base(terminalServices, tenantLocationServices, orderService, productServices, userService)
 {
     _lookupService        = lookupService;
     _purchaseOrderService = purchaseOrderService;
     _productService       = productService;
 }
コード例 #10
0
 /// <summary>
 /// UsersController Constructor 
 /// </summary>
 /// <param name="oICommonServicesInitializer"></param>
 public CommonController(
                         IUserServices oIUserServicesInitializer,
                         ICommonServices oICommonServicesInitializer,
                         ILookupServices oILookupServicesInitializer
     )
 {
     this.oIUserServices = oIUserServicesInitializer;
     this.oICommonServices = oICommonServicesInitializer;
     this.oILookupServices = oILookupServicesInitializer;
 }
コード例 #11
0
 public TimeLogController(IEmployeeShiftsServices employeeShiftsServices, IEmployeeShiftsStoresServices employeeShiftsStoresServices,
                          IEmployeeServices employeeServices, ITenantLocationServices tenantLocationsServices, IShiftsServices shiftsServices, ICoreOrderService orderService, IPropertyService propertyService,
                          IAccountServices accountServices, ILookupServices lookupServices, IActivityServices activityServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeShiftsServices       = employeeShiftsServices;
     _employeeShiftsStoresServices = employeeShiftsStoresServices;
     _employeeServices             = employeeServices;
     _tenantLocationsServices      = tenantLocationsServices;
     _shiftsServices   = shiftsServices;
     _activityServices = activityServices;
 }
コード例 #12
0
 public PurchaseOrdersController(ITenantLocationServices tenantLocationServices, ICoreOrderService orderService, IStockTakeApiService stockTakeApiService, IPropertyService propertyService, IAccountServices accountServices,
                                 ILookupServices lookupServices, IAppointmentsService appointmentsService, IProductServices productServices, IProductLookupService productLookupService, IGaneConfigurationsHelper ganeConfigurationHelper,
                                 IEmailServices emailServices, ICommonDbServices commonDbServices, ITenantLocationServices tenantLocationservices, ISalesOrderService salesOrderService, ITenantsServices tenantsServices)
     : base(orderService, propertyService, accountServices, lookupServices, appointmentsService, ganeConfigurationHelper, emailServices, tenantLocationservices, tenantsServices)
 {
     StockTakeApiService     = stockTakeApiService;
     _productServices        = productServices;
     _productLookupService   = productLookupService;
     _orderService           = orderService;
     _tenantLocationServices = tenantLocationServices;
     _salesServices          = salesOrderService;
     _accountServices        = accountServices;
     _commonDbServices       = commonDbServices;
 }
コード例 #13
0
        public NavigationViewModel(
            IEventAggregator eventAggregator,
            ILookupServices lookupService)
        {
            _lookupService   = lookupService;
            _eventAggregator = eventAggregator;
            _eventAggregator.GetEvent <AfterNavigationEvent>()
            .Subscribe(OnAfterNavigationEnvet);

            MenuItems = new ObservableCollection <LookupItem>();
            Options   = new ObservableCollection <LookupItem>();

            NavCommand = new DelegateCommand(OnSelectLocation);
        }
コード例 #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientDocumentController"/> class.
        /// </summary>
        /// <param name="patientDocumentIt2Manager">
        /// <param name="officeNumber">
        /// The office number.
        /// </param>
        public PatientDocumentController(
            ILookupServices lookupServices,
            IMiscellaneousServices miscellaneousServices,
            IPatientServices patientServices,
            IPatientDocumentServices patientDocumentServices,
            PatientDocumentIt2Manager patientDocumentIt2Manager,
            DocumentIt2Manager documentIt2Manager,
            string officeNumber)
        {
            this.lookupServices            = lookupServices;
            this.miscellaneousServices     = miscellaneousServices;
            this.patientServices           = patientServices;
            this.patientDocumentServices   = patientDocumentServices;
            this.patientDocumentIt2Manager = patientDocumentIt2Manager;

            this.documentManager = documentIt2Manager;
        }
コード例 #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientController"/> class.
        /// </summary>
        public PatientDocumentController()
        {
            this.lookupServices          = Container.Resolve <ILookupServices>();
            this.miscellaneousServices   = Container.Resolve <IMiscellaneousServices>();
            this.patientServices         = Container.Resolve <IPatientServices>();
            this.patientDocumentServices = Container.Resolve <IPatientDocumentServices>();

            this.patientDocumentIt2Manager = new PatientDocumentIt2Manager(this.lookupServices, this.miscellaneousServices, this.patientServices, this.patientDocumentServices);
            this.documentManager           = new DocumentIt2Manager();

            if (!this.User.Identity.IsAuthenticated)
            {
                return;
            }

            var authorizationTicketHelper = new AuthorizationTicketHelper();

            this.practiceLocationId = authorizationTicketHelper.GetPracticeLocationId();
        }
コード例 #16
0
 public ResourceRequestsController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IEmployeeServices employeeServices, IUserService userService) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeServices = employeeServices;
     _userService      = userService;
 }
コード例 #17
0
 public AttendanceController(HrmsDbContext context, ILookupServices lookup)
 {
     _context = context;
     _lookup  = lookup;
 }
コード例 #18
0
 public TenantController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, ITenantsServices tenantServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _tenantServices = tenantServices;
 }
コード例 #19
0
 public ReceiveGoodsController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
 }
コード例 #20
0
 public ProductAttributesController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IProductServices productServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _productServices = productServices;
 }
コード例 #21
0
 public GroupsController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IGroupsServices groupServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _groupsServices = groupServices;
 }
コード例 #22
0
 public StockTakesController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IStockTakeApiService stockTakeService, ITenantsServices tenantServices, ITenantLocationServices tenantLocationServices, IProductServices productServices, IGaneConfigurationsHelper configHelper)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     TenantLocationServices = tenantLocationServices;
     _stockTakeService      = stockTakeService;
     _tenantServices        = tenantServices;
     _productServices       = productServices;
     _configHelper          = configHelper;
 }
コード例 #23
0
 public VehicleInspectionController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IVehicleInspectionService inspectionService, IMarketServices marketServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _inspectionService = inspectionService;
     _marketServices = marketServices;
 }
コード例 #24
0
 public JobTypesController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IEmployeeServices employeeServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeServices = employeeServices;
 }
コード例 #25
0
 public EmailTemplatesController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices,
                                 IEmailNotificationService emailNotificationService, EmailServices emailServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _emailNotificationService = emailNotificationService;
     _emailServices            = emailServices;
 }
コード例 #26
0
 public PalletsController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, ITenantsServices tenantsServices, IPalletingService palletingService, IMarketServices marketServices, IEmployeeServices employeeServices, IGaneConfigurationsHelper helper) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _palletingService = palletingService;
     _marketServices   = marketServices;
     _employeeServices = employeeServices;
     _helper           = helper;
     _tenantServices   = tenantsServices;
 }
コード例 #27
0
 public ShiftsController(IShiftsServices shiftsServices, ITenantLocationServices storesServices, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IEmployeeServices employeeServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _shiftsServices   = shiftsServices;
     _storesServices   = storesServices;
     _employeeServices = employeeServices;
 }
コード例 #28
0
 public EmployeeShiftsController(IEmployeeShiftsServices employeeShiftsServices, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IEmployeeServices employeeServices, ITerminalServices terminalServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeShiftsServices = employeeShiftsServices;
     _employeeServices       = employeeServices;
     _terminalServices       = terminalServices;
 }
コード例 #29
0
 public OrderProcessDetailController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
 }
コード例 #30
0
ファイル: PayrollsController.cs プロジェクト: kokodda/Hrms
 public PayrollsController(HrmsDbContext context, ILookupServices lookup)
 {
     _context = context;
     _lookup  = lookup;
 }