Exemplo n.º 1
0
        public IActionResult RendelesVendeg()
        {
            if (!HttpContext.Request.Cookies.ContainsKey("RendelesCookie") || HttpContext.Request.Cookies["RendelesCookie"] == null || HttpContext.Request.Cookies["RendelesCookie"] == "")
            {
                string        cookieid      = Guid.NewGuid().ToString();
                CookieOptions cookieOptions = new CookieOptions();
                cookieOptions.Expires = new DateTimeOffset(DateTime.Now.AddDays(3));
                HttpContext.Response.Cookies.Append("RendelesCookie", cookieid, cookieOptions);
            }
            var items = _kocsi.GetKocsiItems();

            _kocsi.KocsiItems = items;
            if (items.Count == 0)
            {
                return(RedirectToAction("UresKocsi", "Kocsi"));
            }
            return(View());
        }
Exemplo n.º 2
0
        public IViewComponentResult Invoke()
        {
            var items = _kocsi.GetKocsiItems();

            _kocsi.KocsiItems = items;
            var KocsiWM = new KocsiViewModel
            {
                kocsi      = _kocsi,
                kocsiTotal = _kocsi.GetTotal()
            };

            return(View(KocsiWM));
        }
Exemplo n.º 3
0
        public ViewResult Index(string alert)
        {
            var items = _kocsi.GetKocsiItems();

            _kocsi.KocsiItems = items;
            var kocsiVM = new KocsiViewModel
            {
                kocsi      = _kocsi,
                kocsiTotal = _kocsi.GetTotal()
            };

            ViewBag.AlertClass = alert;
            return(View(kocsiVM));
        }