public ActionResult Details(List<SupplierGetModelSpecViewModel> items)
        {
            try
            {
                string userId = User.Identity.GetUserId();
                if (String.IsNullOrEmpty(userId))
                    return RedirectToAction("Error404", "Home");

                var user = db.Users.Where(x => x.Id == userId).FirstOrDefault();
                if (User.IsInRole("Customer") && user.ActivationCode == null)
                {
                    var cartData = Session["cartData"] as ModelToCartViewModel;
                    var cartList = new List<CartViewModel>();
                    List<CartViewModel> updatedCartList = Session["Cart"] as List<CartViewModel>;
                    if (updatedCartList == null)
                    {
                        var cartItem = new CartViewModel()
                        {
                            ModelId = cartData.ModelId,
                            SupplierId = cartData.SupplierId
                        };
                        cartList.Add(cartItem);
                        Session["Cart"] = cartList;
                    }
                    if (updatedCartList != null)
                    {
                        var cartItem = new CartViewModel()
                        {
                            ModelId = cartData.ModelId,
                            SupplierId = cartData.SupplierId
                        };
                        updatedCartList.Add(cartItem);
                        Session.Remove("Cart");
                        Session["Cart"] = updatedCartList;
                    }
                    return RedirectToAction("NavigateToCart");
                }

                return RedirectToAction("Login", "Account");
            }
            catch (Exception ex)
            {
                return new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.ToString());
            }
        }
        public JsonResult AddCartItem(int id)
        {
            try
            {
                var cartList = new List<CartViewModel>();
                List<CartViewModel> updatedCartList = Session["Cart"] as List<CartViewModel>;
                if (updatedCartList == null)
                {
                    var cartItem = new CartViewModel()
                    {
                        ModelId = id,
                        ModelName = (from m in db.Models
                                     where m.ModelId == id
                                     select m.ModelNumber).FirstOrDefault(),
                        ImageUrl = (from p in db.Photos
                                    join pm in db.PhotoModels on p.PhotoId equals pm.PhotoId
                                    join m in db.Models on pm.ModelId equals m.ModelId
                                    where m.ModelId == id
                                    select p.ImageUrl).FirstOrDefault(),

                        UnitPrice = (from m in db.Models
                                     where m.ModelId == id
                                     select m.Price).FirstOrDefault()
                    };
                    cartList.Add(cartItem);
                    Session["Cart"] = cartList;
                }
                if (updatedCartList != null)
                {
                    var cartItem = new CartViewModel()
                    {
                        ModelId = id,
                        ModelName = (from m in db.Models
                                     where m.ModelId == id
                                     select m.ModelNumber).FirstOrDefault(),
                        ImageUrl = (from p in db.Photos
                                    join pm in db.PhotoModels on p.PhotoId equals pm.PhotoId
                                    join m in db.Models on pm.ModelId equals m.ModelId
                                    where m.ModelId == id
                                    select p.ImageUrl).FirstOrDefault(),

                        UnitPrice = (from m in db.Models
                                     where m.ModelId == id
                                     select m.Price).FirstOrDefault()
                    };
                    updatedCartList.Add(cartItem);
                    Session.Remove("Cart");
                    Session["Cart"] = updatedCartList;
                }

                List<CartViewModel> Cart = Session["Cart"] as List<CartViewModel>;
                var carCount = Cart.Count();

                //var productList = db.Products.Where(p => p.CategoryId == id).ToList();
                return Json(new { Cart, carCount }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(new { ok = false, message = ex.Message });
            }
        }