public IActionResult GetPhiShip(string tendangnhap, string iddiachi) { string checktendangnhap = HttpContext.Session.GetString("TenDangNhap"); if (checktendangnhap != null && checktendangnhap != "") { List <DiaChi> listdiachi = new List <DiaChi>(); listdiachi = giohangbus.GetPhiShip(tendangnhap); DiaChi diachi = new DiaChi(); diachi = taikhoanbus.GetChoosenAddress(iddiachi); List <GiaShip> listgiaship = new List <GiaShip>(); listgiaship = giashipbus.GetGiaShips(); ViewBag.GiaShipNoiThanh = listgiaship.Where(gs => gs.Loai.Contains("Nội Thành")) .OrderByDescending(gs => gs.NgayCapNhat) .FirstOrDefault(); ViewBag.GiaShipNgoaiThanh = listgiaship.Where(gs => gs.Loai.Contains("Ngoại Thành")) .OrderByDescending(gs => gs.NgayCapNhat) .FirstOrDefault(); ViewBag.DiaChi = diachi; return(PartialView("pTienThanhToan", listdiachi)); } return(RedirectToAction("Index", "Home")); }
public IActionResult Index(string thongbao, int?pagenumber) { //Thông báo if (thongbao != null) { ViewBag.ThongBao = thongbao; } //Trang pageNumber = pagenumber ?? 1; //List GiaShipBUS GiaShip = new GiaShipBUS(); List <GiaShip> list = GiaShip.GetGiaShips(pageNumber, pageSize); List <GiaShip> tong = GiaShip.GetGiaShips(); //ViewBag ViewBag.TongTrang = TongTrang(tong); ViewBag.TrangHienTai = pageNumber; ViewBag.TrangThai = "index"; return(View(list)); }