예제 #1
0
        public async Task <ActionResult> Create()
        {
            //HttpContext.Server.ScriptTimeout = 300000000;
            //var brandResult = await _brandBusinessService.RetrieveBrands();
            //var mobileResult = await _mobileBusinessService.RetrieveMobiles();
            //GetGoogleImages("nokia 6");
            //var number = 255;
            //var singleBrand = brandResult.Items.Where(e => e.BrandId == number).ToList();
            //foreach (var item in singleBrand)
            //{
            //    var newList = new List<Brand>() { item };
            //    var mobileList = CreateMobileData(newList);
            //    await _mobileBusinessService.CreateMobile(mobileList);
            //}

            //foreach (var item in brandResult.Items.Where(e => e.BrandId == 300).ToList())
            //{
            //    var brandMobile = mobileResult.Items.Where(e => e.BrandId == item.BrandId).ToList();
            //    var mobileImageList = CreateMobileImageData(item, brandMobile);
            //    await _mobileBusinessService.CreateMobileImage(mobileImageList);

            //}

            var brands = await _brandBusinessService.RetrieveBrands(e => true);

            var brandList = brands.Items.ToList();
            var viewModel = new MobileViewModel()
            {
                Mobile = new Business.Models.Mobile(),
                Brands = new SelectList(brandList, "BrandId", "Name")
            };

            return(View(viewModel));
        }
예제 #2
0
        public async Task <ActionResult> List(List <OrderBy> orderBy)
        {
            var data = await _brandBusinessService.RetrieveBrands(e => true, orderBy);

            return(this.JsonNet(data));
        }