Esempio n. 1
0
        public IActionResult Put([FromRoute] string controlPath, [FromBody] IAdjuster adjuster)
        {
            if (!systemTraverser.AllSettings.Any(s => s.Path == controlPath))
            {
                return(NotFound("Control path not found"));
            }

            if (adjusters.ContainsKey(controlPath))
            {
                adjusters[controlPath].Stop();
            }

            bool success = adjuster.Start(systemTraverser);

            if (success)
            {
                adjusters[controlPath] = adjuster;
            }
            else
            {
                if (adjusters.ContainsKey(controlPath))
                {
                    adjusters[controlPath].Start(systemTraverser);
                }
                return(BadRequest("The control could not be started"));
            }

            adjusterConfig.Adjusters = adjusters.Values.ToList();
            adjusterConfig.Save();
            return(Ok());
        }
Esempio n. 2
0
 public FileController(IFile fileBL, IAdjuster adjusterBL, IEmployer employerBL, IInsurer insurerBL, IInsurerBranch insurerBranchBL, IDepartment department, IInvoice invoice, IPayment payment, IStorageServices storageServices
                       , IARCommonServices arCommonService, IInvoiceNote invoiceNote, IPaymentRefund paymentRefund, IState state)
 {
     _fileBL          = fileBL;
     _adjusterBL      = adjusterBL;
     _employerBL      = employerBL;
     _insurerBL       = insurerBL;
     _insurerBranchBL = insurerBranchBL;
     _department      = department;
     _invoice         = invoice;
     _payment         = payment;
     _storageServices = storageServices;
     _arCommonService = arCommonService;
     _invoiceNote     = invoiceNote;
     _paymentRefund   = paymentRefund;
     _stateBL         = state;
 }
 public QualityRangeAdjuster(IAdjuster adjuster)
 {
     wrappedAdjuster = adjuster;
 }
Esempio n. 4
0
 public void AdjusterInitializer()
 {
     _adjusterRepository = new AdjusterRepository(new Core.Base.Data.SqlServer.Factory.BaseContextFactory <LMGEDI.Core.Data.SqlServer.LMGEDIDBContext>());
     _adjusterImplBL     = new AdjusterImpl(_adjusterRepository);
 }