public async Task <IActionResult> Index() { ViewBag.Account = HttpContext.Session.GetString("UserName"); List <ExportBill> cart = new List <ExportBill>(); if (SessionHelper.GetObjectFromJson <List <ExportBill> >(HttpContext.Session, "Cart") != null) { cart = SessionHelper.GetObjectFromJson <List <ExportBill> >(HttpContext.Session, "Cart"); foreach (var item in cart) { item.Shoes = await shoesDao.GetObject(item.ShoesId); } ViewBag.Total = cart.Sum(item => item.Price * item.Quantity); ViewBag.Cart = cart; } else { List <Sell> list = await exportBillDao.GetList(); ViewBag.Cart = cart; ViewBag.Total = 0; } return(View()); }
public async Task <IActionResult> ExportBill() { return(View(await exportBillDao.GetList())); }