private FurnitureManufacturerEngine(ICompanyFactory companyFactory, IFurnitureFactory furnitureFactory, IDataBase database, IRenderer renderer)
 {
     this.companyFactory   = companyFactory;
     this.furnitureFactory = furnitureFactory;
     this.database         = database;
     this.renderer         = renderer;
 }
예제 #2
0
        /// <summary>
        /// Aplicación principal.
        /// </summary>
        public void Main()
        {
            Console.WriteLine("\n*************** BRIDGE ***************");
            Console.WriteLine("Ingrese nombre del producto");
            string producto = Console.ReadLine()?.ToUpperInvariant();

            Console.WriteLine("\nSeleccione la paquetería de su preferencia." +
                              "\n1-DHL \n2-Fedex \n3-Estafeta");

            int option = Convert.ToInt32(Console.ReadLine());

            ICompanyFactory companyFactory = SelectCompanyFactory(option);

            if (companyFactory == null)
            {
                return;
            }

            ICompany      company       = companyFactory.CrearInstancia();
            Menu          menu          = new Menu(company);
            ITransport    transport     = menu.SelectTransport();
            ParcelService parcelService = new ParcelService(transport);

            parcelService.SendProduct(producto);
        }
예제 #3
0
 public CompanyService(ICompanyQuery companyQuery, ICompanyRepository companyRepository, ICompanyValidator companyValidator, ICompanyFactory companyFactory)
 {
     _companyQuery      = companyQuery;
     _companyRepository = companyRepository;
     _companyValidator  = companyValidator;
     _companyFactory    = companyFactory;
 }
예제 #4
0
 public CompanyApplicationService(ICompanyRepository repository, ICompanyFactory factory, ILocationService locationService, IIdentityResolver identityResolver, IDomainNotificationHandler domainNotificationHandler, IUnitOfWork <ILedgerCompanyDbAbstraction> unitOfWork, IIntegrationServiceBus integrationBus) : base(domainNotificationHandler, unitOfWork, integrationBus)
 {
     _repository       = repository;
     _factory          = factory;
     _locationService  = locationService;
     _identityResolver = identityResolver;
 }
예제 #5
0
 public RegisterNewCompanyCommand(ICompanyFactory factory, Notification notification,
                                  ICompanyRepository companies)
 {
     this.factory = factory;
     this.notification = notification;
     this.companies = companies;
 }
예제 #6
0
 public CreateCompanyCommand(ICompaniesRepository repository,
                             ICompanyFactory factory,
                             IUnitOfWork unitOfWork)
 {
     _repository = repository;
     _factory    = factory;
     _unitOfWork = unitOfWork;
 }
 private FurnitureManufacturerEngine()
 {
     this.companyFactory   = new CompanyFactory();
     this.furnitureFactory = new FurnitureFactory();
     this.companies        = new Dictionary <string, ICompany>();
     this.furnitures       = new Dictionary <string, IFurniture>();
     this.renderer         = new ConsoleRenderer();
 }
예제 #8
0
 public CompanyController(
     ICompanyRepository repository,
     ICompanyFactory factory
     )
 {
     _repository = repository;
     _factory    = factory;
 }
예제 #9
0
 private FurnitureManufacturerEngine()
 {
     this.companyFactory = new CompanyFactory();
     this.furnitureFactory = new FurnitureFactory();
     this.companies = new Dictionary<string, ICompany>();
     this.furnitures = new Dictionary<string, IFurniture>();
     this.renderer = new ConsoleRenderer();
 }
예제 #10
0
 public AddCompanyHandler(
     ICompanyFactory companyFactory,
     ICompanyRepository companyRepository,
     ICompanyDtoBuilder companyDtoBuilder)
 {
     this.companyFactory    = companyFactory;
     this.companyRepository = companyRepository;
     this.companyDtoBuilder = companyDtoBuilder;
 }
예제 #11
0
 public CompanyRepository(
     IContextFactory <Data.Contexts.FinancialContext> contextFactory,
     ICompanyFactory companyFactory,
     ICompanyEntityFactory entityFactory)
 {
     _contextFactory = contextFactory;
     _companyFactory = companyFactory;
     _entityFactory  = entityFactory;
 }
예제 #12
0
 public CompanyService(
     ICompanySearchService companySearchService,
     IAnnualReportService annualReportService,
     IScoreService scoreService,
     ICompanyFactory companyFactory)
 {
     this.companySearchService = companySearchService;
     this.annualReportService  = annualReportService;
     this.scoreService         = scoreService;
     this.companyFactory       = companyFactory;
 }
예제 #13
0
        // dependency injection

        public FurnitureManufacturerEngine
        (
            ICompanyFactory companyFactory,
            IFurnitureFactory furnitureFactory,
            IRenderer renderer
        )
        {
            this.companyFactory   = companyFactory;
            this.furnitureFactory = furnitureFactory;
            this.renderer         = renderer;
            this.companies        = new Dictionary <string, ICompany>();
            this.furnitures       = new Dictionary <string, IFurniture>();
        }
예제 #14
0
        internal static string CreateCompanyMethod(string name, string registrationNumber,
                                                   ICompanyFactory companyFactory, IDictionary <string, ICompany> companies)
        {
            if (companies.ContainsKey(name))
            {
                return(string.Format(EngineConstants.CompanyExistsErrorMessage, name));
            }

            var company = companyFactory.CreateCompany(name, registrationNumber);

            companies.Add(name, company);

            return(string.Format(EngineConstants.CompanyCreatedSuccessMessage, name));
        }
예제 #15
0
 public CompanyRepository(CompanyContext companyContext, ICompanyFactory companyFactory)
 {
     this.store          = companyContext;
     this.companyFactory = companyFactory;
     mapper = new CompanyMapper();
 }
예제 #16
0
 public CalculateController(ICompanyFactory companyFactory)
 {
     _companyFactory = companyFactory;
 }
예제 #17
0
 public CalculatorService(ICompanyFactory companyFactory) : this(companyFactory, null)
 {
 }
예제 #18
0
 public CalculatorService(ICompanyFactory companyFactory, Func <string, IShipCompany> serviceResolver)
 {
     _companyFactory = companyFactory;
     _shipCompany    = serviceResolver?.Invoke("postoffice");
 }
 public CreateCompanyCommand(IDataStore data, ICompanyFactory factory, Constants constants)
 {
     this.data      = data;
     this.factory   = factory;
     this.constants = constants;
 }
예제 #20
0
 public CreateCompanyCommand(IDataStore dataStore, ICompanyFactory companyFactory)
 {
     this.dataStore      = dataStore;
     this.companyFactory = companyFactory;
 }
예제 #21
0
 public CreateCompany(ICompanyFactory companyFactory, ICompanyRepository companyRepository)
 {
     this.companyFactory    = companyFactory;
     this.companyRepository = companyRepository;
 }
 public CompanyController(ICompanyFactory factory)
 {
     _factory = factory;
 }
예제 #23
0
 public CompanyService(ICompaniesRepository repository, ICompanyFactory factory)
 {
     _repository = repository;
     _factory    = factory;
 }