Esempio n. 1
0
 public ProductController(IProduct product, IProductComponent productComponent, IProductMaterial productMaterial, IProductPrice productPrice)
 {
     _product          = product;
     _productComponent = productComponent;
     _productMaterial  = productMaterial;
     _productPrice     = productPrice;
 }
Esempio n. 2
0
    public ProductPrice()
    {
        Application = System.Web.HttpContext.Current.Application;

        tools   = ToolsFactory.CreateTools();
        MyMem   = MemberFactory.CreateMember();
        Myprice = ProductPriceFactory.CreateProductPrice();
        Mygrade = MemberGradeFactory.CreateMemberGrade();
    }
Esempio n. 3
0
        public async void PrepareRepository()
        {
            if (dbContext.Database.GetPendingMigrations().Count() > 0)
            {
                await dbContext.Database.MigrateAsync();
            }

            if (ProductsRepository.GetSet().Count == 0)
            {
                var productsCategories = new IProductCategory[]
                {
                    ProductsCategoiesRepository.Create("Línea automotriz"),
                    ProductsCategoiesRepository.Create("Línea institucional"),
                    ProductsCategoiesRepository.Create("Línea porcelanato"),
                    ProductsCategoiesRepository.Create("Materias primas")
                };
                ProductsCategoiesRepository.AddSet(productsCategories);

                var product = ProductsRepository.Create("Ambientador Chicle", productsCategories[0]);
                ProductsRepository.Add(product);

                var productPrices = new IProductPrice[]
                {
                    ProductsPricesRepository.Create(MeasurementUnits.Galon, 21100, product),
                    ProductsPricesRepository.Create(MeasurementUnits.Garrafa, 99100, product)
                };
                ProductsPricesRepository.AddSet(productPrices);

                product = ProductsRepository.Create("Ambientador Gold", productsCategories[0]);
                ProductsRepository.Add(product);

                productPrices = new IProductPrice[]
                {
                    ProductsPricesRepository.Create(MeasurementUnits.Galon, 30200, product),
                    ProductsPricesRepository.Create(MeasurementUnits.Garrafa, 145000, product)
                };
                ProductsPricesRepository.AddSet(productPrices);

                product = ProductsRepository.Create("Aceite de transmisión sin IVA", productsCategories[3]);
                ProductsRepository.Add(product);

                var productPrice = ProductsPricesRepository.Create(MeasurementUnits.Kg, 4394, product);
                ProductsPricesRepository.Add(productPrice);

                Complete();
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var server = new Grpc.Core.Server
            {
                Services = { IProductPrice.BindService(new ProductPriceImpl()) },
                Ports    = { new ServerPort("0.0.0.0", port, ServerCredentials.Insecure) }
            };

            server.Start();

            Task.Run(() =>
            {
                ClientImpl();
            });

            while (true)
            {
                Console.WriteLine("hello the world!");
                Thread.Sleep(100);
            }
        }
Esempio n. 5
0
 public async Task AddAsync(IProductPrice productPrice)
 {
     await dbContext.ProductPrices.AddAsync(productPrice as ProductPrice);
 }
Esempio n. 6
0
 public void Add(IProductPrice productPrice)
 {
     dbContext.ProductPrices.Add(productPrice as ProductPrice);
 }