Пример #1
0
        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"));
        }