Exemplo n.º 1
0
 public ActionResult ContinueSelect(CountModel count)
 {
     if (count.Products.Where(m => m.Selected).Count() > 1)  // Showing Average Details Of Multiple Product
     {
         var xEle = new XElement("Item",
             from item in count.Products.Where(m => m.Selected)
             select new XElement("Item", new XAttribute("Product", item.ProductKey),
                            new XAttribute("Store", item.StoreId),
                            new XAttribute("Price", item.Price)
                        )).ToString();
         var model = new ItemPEDDetailsModel(PEDService.GetMultipleItemPEDDetails(xEle));
         return View("Multiple-price-opt ", model);
     }
     else //Showing Single Product Price Optimization
     {
         string product = count.Products.Where(m => m.Selected).Select(o => new { o.ProductKey }).FirstOrDefault().ProductKey;
         string store = count.Products.Where(m => m.Selected).Select(o => new { o.StoreId }).FirstOrDefault().StoreId;
         return RedirectToAction("PriceOpt", new { id = product, store = store });
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get All The Product Details
        /// </summary>
        /// <returns></returns>
        public ActionResult ShowItems()
        {
            if (System.Web.HttpContext.Current.Cache["ItemDetails"] == null)
            {
                dashboardService.GetItemDetails();
            }
            var product = System.Web.HttpContext.Current.Cache["ItemDetails"] as ItemDetails;
            System.Web.HttpContext.Current.Cache["productListDetails"] = DBNull.Value;
            var model = new CountModel(product);

            int BlockSize = 25;
            model.Products = model.ProducListExtension(1, BlockSize);
            return View(model);
        }
Exemplo n.º 3
0
 public ActionResult ProductList(CountModel model)
 {
     return PartialView(model);
 }
Exemplo n.º 4
0
        public ActionResult Search(CountModel count)
        {
            string dept="",prod="";

              prod = Request.Form["ProductsList"];

              dept = Request.Form["DepartmentList"];

            if (System.Web.HttpContext.Current.Cache["ItemDetails"] == null)
            {
                dashboardService.GetItemDetails();
            }
            var product = System.Web.HttpContext.Current.Cache["ItemDetails"] as ItemDetails;
            var model = new CountModel(product);

            model.Products = product.ToSearchProduct(count.storeId, dept, prod, count.categoryId, count.znGrpId);
            int BlockSize = 25;
            model.Products = model.ProducListExtension(1, BlockSize);
            System.Web.HttpContext.Current.Cache["productListDetails"] = model;
            return View("ShowItems", model);
        }
Exemplo n.º 5
0
        public ActionResult InfinateScroll(int BlockNumber)
        {
            //////////////// THis line of code only for demo. Needs to be removed ///////////////
            System.Threading.Thread.Sleep(1000);
            ////////////////////////////////////////////////////////////////////////////////////////

            int BlockSize = 25;

            if (System.Web.HttpContext.Current.Cache["productListDetails"] != DBNull.Value)
            {
                var model= System.Web.HttpContext.Current.Cache["productListDetails"] as CountModel;
                model.Products = model.ProducListExtension(BlockNumber, BlockSize);
                JsonModel jsonModel = new JsonModel();
                jsonModel.NoMoreData = model.Products.Count < BlockSize;
                jsonModel.HTMLString = RenderPartialViewToString("ProductList", model);
                return Json(jsonModel);
            }
             else
             {
                 var product = System.Web.HttpContext.Current.Cache["ItemDetails"] as ItemDetails;
                 var model = new CountModel(product);
                 model.Products = model.ProducListExtension(BlockNumber, BlockSize);
                 JsonModel jsonModel = new JsonModel();
                 jsonModel.NoMoreData = model.Products.Count < BlockSize;
                 jsonModel.HTMLString = RenderPartialViewToString("ProductList", model);
                 return Json(jsonModel);
             }
        }