Ejemplo n.º 1
0
        public ActionResult UserCartCount()
        {
            if (Session["Login"] != null)
            {
                AppUsers gelenuser = (AppUsers)Session["Login"];
                int      gelenid   = gelenuser.UserID;

                ViewBag.UserCartCount = usercartoperation.GetUserCartCount(gelenid);


                return(PartialView());
            }
            else
            {
                return(RedirectToAction("LoginUser", "Home"));
            }
        }
        // GET: UserCart
        public ActionResult Index()
        {
            if (Session["Login"] != null)
            {
                AppUsers gelenuser = (AppUsers)Session["Login"];

                int gelenid = gelenuser.UserID;


                if (gelenuser.FirstName == null && gelenuser.LastName == null)
                {
                    return(RedirectToAction("EditUserInformation", "Home"));
                }
                else
                {
                    if (UsercartManagement.UserCartAnyControl(gelenid))
                    {
                        UsercartManagement.ProductActiveControl(gelenid);

                        ViewBag.Sepet = UsercartManagement.GetUserCart(gelenid);
                        UserCartModelList model = new UserCartModelList();

                        model.Count = UsercartManagement.GetUserCartCount(gelenid);
                        model.Pay   = UsercartManagement.GetUserCartPay(gelenid);

                        return(View(model));
                    }
                    else
                    {
                        ViewBag.Hatali = "Sepetenizde Hiç Ürün Bulunmuyor.";
                        return(View());
                    }
                }
            }
            else
            {
                return(RedirectToAction("LoginUser", "Home"));
            }
        }