Beispiel #1
0
 public ActionResult ReceiptWidget()
 {
     try
     {
         if (Request.Cookies["MemberLoginCookie"] != null)
         {
             HttpCookie          reqCookies = Request.Cookies["MemberLoginCookie"];
             ResponseMemberLogin login      = JsonConvert.DeserializeObject <ResponseMemberLogin>(reqCookies.Value.ToString().UrlDecode());
             var result = _memberReceiptInfo.GetByMember(login.ID);
             return(PartialView(result));
         }
         return(PartialView());
     }
     catch (Exception)
     {
         return(PartialView());
     }
 }
Beispiel #2
0
        public ActionResult Payment()
        {
            try
            {
                if (Request.Cookies["MemberLoginCookie"] == null)
                {
                    return(Redirect("/dang-nhap.html"));
                }
                HttpCookie          reqCookies = Request.Cookies["MemberLoginCookie"];
                ResponseMemberLogin login      = JsonConvert.DeserializeObject <ResponseMemberLogin>(reqCookies.Value.ToString().UrlDecode());
                if (login == null || login.ID == 0)
                {
                    return(Redirect("/dang-nhap.html"));
                }

                var receipts = _memberReceiptInfo.GetByMember(login.ID);
                if (receipts != null && receipts.Count() > 0)
                {
                    ViewBag.ReceiptInfo = receipts;
                }
                else
                {
                    return(Redirect("/dia-diem-giao-hang.html"));
                }

                if (Session["ListShoppingCart"] != null)
                {
                    List <Cart> carts = (List <Cart>)Session["ListShoppingCart"];
                    if (carts != null && carts.Count() > 0)
                    {
                        return(View(carts));
                    }
                }
                return(Redirect("/"));
            }
            catch (Exception)
            {
                return(Redirect("/"));
            }
        }