Exemplo n.º 1
0
        public ActionResult Index()
        {
            IDataRepository dataRepository = _processLocator.GetProcessor <IDataRepository>();

            widgets = dataRepository.GetWigdets().ToList();
            return(View(widgets));
        }
Exemplo n.º 2
0
 //Initialize the singleInstance objects that are used in the methods
 //properties not needed for now
 public StockManager(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database       = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.modelValidator = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 3
0
 public ListClients(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.writer   = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 4
0
 public FireEmployee(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database      = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer        = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 5
0
 //constructor
 public Engine(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.CommandFactory = processorLocator.GetProcessor <ICommandFactory>() ?? throw new ArgumentNullException();
     this.writer         = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.reader         = processorLocator.GetProcessor <IReader>() ?? throw new ArgumentNullException();
 }
    public FullLocationHolder(IProcessorLocator locator)
    {
      _locator = locator;
       
      _locations      = locator.GetProcessor<LocationDataHolder>();
      _accessDevices  = locator.GetProcessor<AccessDeviceDataHolder>();
      _captureDevices = locator.GetProcessor<CaptureDeviceDataHolder>();

      _convertor = new ProtoMessageConvertor();
    }
    public FullVisitorHolder(IProcessorLocator locator)
    {
      _locator = locator;

      _visitors = locator.GetProcessor<VisitorDataHolder>();
      _photos   = locator.GetProcessor<PhotoDataHolder>();

      _convertor = new ProtoMessageConvertor();
      _utils     = new IOUtils();
    }
Exemplo n.º 8
0
 public WithdrawCashFromBank(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database      = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer        = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
    public FullPersonHolder( IProcessorLocator locator )
    {
      _locator = locator;

      _persons = locator.GetProcessor<PersonDataHolder>();
      _photos  = locator.GetProcessor<PhotoDataHolder>();
      _cards   = locator.GetProcessor<CardDataHolder>();

      _convertor = new ProtoMessageConvertor();
      _utils     = new IOUtils();
    }
Exemplo n.º 10
0
 public ListWarehouseItems(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database      = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer        = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.stockManager  = processorLocator.GetProcessor <IStockManager>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 11
0
 public RegisterSupplier(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database      = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.factory       = processorLocator.GetProcessor <IAutoServiceFactory>() ?? throw new ArgumentNullException();
     this.coreValidator = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer        = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 12
0
 public IssueInvoices(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database       = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator  = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.modelValidator = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
     this.writer         = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
 }
 public SellServiceToClientVehicle(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database           = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.coreValidator      = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer             = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.autoServiceFactory = processorLocator.GetProcessor <IAutoServiceFactory>() ?? throw new ArgumentNullException();
     this.modelValidator     = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }
Exemplo n.º 14
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _ProcessorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _ProcessorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _ProcessorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _ProcessorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");
        }
Exemplo n.º 15
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _processorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _processorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _processorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _processorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");


            // Named Instance
            _plugin.DoSomething();

            // Regular Usage
            //foreach (IPostOrderPlugin plugin in _Plugins)
            //{
            //    plugin.DoSomething();
            //}
        }
 //Constructor
 public OrderStockToWarehouse(IProcessorLocator processorLocator)
 {
     if (processorLocator == null)
     {
         throw new ArgumentNullException();
     }
     this.database           = processorLocator.GetProcessor <IDatabase>() ?? throw new ArgumentNullException();
     this.autoServiceFactory = processorLocator.GetProcessor <IAutoServiceFactory>() ?? throw new ArgumentNullException();
     this.coreValidator      = processorLocator.GetProcessor <IValidateCore>() ?? throw new ArgumentNullException();
     this.writer             = processorLocator.GetProcessor <IWriter>() ?? throw new ArgumentNullException();
     this.stockManager       = processorLocator.GetProcessor <IStockManager>() ?? throw new ArgumentNullException();
     this.modelValidator     = processorLocator.GetProcessor <IValidateModel>() ?? throw new ArgumentNullException();
 }