Ejemplo n.º 1
0
        private void PopularTabelaTipoCartaoDeCredito(ECommerceContext context)
        {
            var tipoCartoesList = new EnumExtensions <TipoCartaoDeCreditoEnum>().ConvertToList();

            tipoCartoesList.ForEach(kvp => context.TipoCartoesDeCredito.AddOrUpdate(
                                        new TipoCartaoDeCredito()
            {
                Id = kvp.Key,
                //Value = kvp.Value
            }));
        }
Ejemplo n.º 2
0
        private void PopularTabelaStatusCompra(ECommerceContext context)
        {
            var statusCompraList = new EnumExtensions <StatusCompraEnum>().ConvertToList();

            statusCompraList.ForEach(kvp => context.StatusCompras.AddOrUpdate(
                                         new StatusCompra()
            {
                Id = kvp.Key,
                //Value = kvp.Value
            }));
        }
Ejemplo n.º 3
0
        private void PopularTabelaCategoria(ECommerceContext context)
        {
            var categoriaList = new EnumExtensions <CategoriaEnum>().ConvertToList();

            categoriaList.ForEach(kvp => context.Categorias.AddOrUpdate(
                                      new Categoria()
            {
                Id = kvp.Key,
                //Value = kvp.Value
            }));
        }
        void Download(string[] args)
        {
            new LoginForm(Selenium, @"http://www.westsiderentals.com/login", "username", "password", "//input[@class='btn_login']").Login("*****@*****.**", "dingd0ng111");
            const int MinPrice = 1500;
            const int MaxPrice = 3000;

            //const int MinPrice = 0;
            //const int MaxPrice = 1000;
            if (args.Length == 2)
            {
                _downloader.Download(Selenium, new SearchQuery(args[0].ToEnum <Region>(), args[1].ToEnum <StructureType>(), MinPrice, MaxPrice));
            }
            else
            {
                EnumExtensions.ForEach <StructureType>(typeof(StructureType), s => _downloader.Download(Selenium, new SearchQuery(Region.Hollywood, s, MinPrice, MaxPrice)));
            }
            _downloader.SaveReports();
        }