Exemplo n.º 1
0
        public PartialViewResult GetDetailsPartialView(int id/*, string param2*/)
        {
            //id=-1;
            try
            {
                var cloth = storeDB.GetClothesDetails(id).SingleOrDefault();
                var pictures = storeDB.GetPicturesForClothes(id).ToList();

                if (Request.IsAjaxRequest())
                {
                    var item = new ClothesDetailsWithPicturesViewModel()
                    {
                        ClothesDetails = cloth,
                        PicturesForClothes = pictures
                    };
                    IncrementDisplayCount(id);
                    return PartialView("_Details", item);
                }
                else
                {
                    return null;
                }
            }
            catch(Exception ex)
            {
                  TempData["Message"] = string.Format("Can't display details");
                  return null;
            }
        }
Exemplo n.º 2
0
        public ActionResult Details(int id)
        {
            var cloth = storeDB.GetClothesDetails(id).SingleOrDefault();
            var pictures = storeDB.GetPicturesForClothes(id).ToList();

            var item = new ClothesDetailsWithPicturesViewModel()
                   {
                        ClothesDetails=cloth,
                        PicturesForClothes=pictures
                   };
            IncrementDisplayCount(id);
            return View(item);
        }