public IActionResult Index(string thongbao, int?pagenumber) { //Thông báo if (thongbao != null) { ViewBag.ThongBao = thongbao; } //Trang pageNumber = pagenumber ?? 1; //List GianHangBUS gianhang = new GianHangBUS(); List <GianHang> list = gianhang.GetGianHangs(pageNumber, pageSize); List <GianHang> tong = gianhang.GetGianHangs(); //ViewBag ViewBag.TongTrang = TongTrang(tong); ViewBag.TrangHienTai = pageNumber; ViewBag.TrangThai = "index"; return(View(list)); }
public IActionResult Sort(string sortorder, int?pagenumber) { pageNumber = pagenumber ?? 1; LichSuGianHangBUS gianhang = new LichSuGianHangBUS(); GianHangBUS gh = new GianHangBUS(); List <LichSuGianHang> list = gianhang.Sort(sortorder, pageSize, pageNumber); List <LichSuGianHang> tong = gianhang.Sort(sortorder); List <GianHang> listgh = gh.GetGianHangs(); ViewBag.TrangHienTai = pageNumber; ViewBag.TongTrang = TongTrang(tong); ViewBag.TrangThai = "sort"; ViewBag.Sort = sortorder; ViewBag.ListGianHang = listgh; return(View("Index", list)); }