示例#1
0
 public DonHangsController(MobileContext mb)
 {
     _mb       = mb;
     DonHangVM = new DonHangViewChiTiet()
     {
         ChiTietDonHangs = _mb.ChiTietDonHang.ToList(),
         DonHangs        = new Models.DonHang()
     };
 }
        public IActionResult ChiTietDonHang(int MaDH)
        {
            var ChiTietDHVM = new DonHangViewChiTiet()
            {
                DonHangs        = _db.DonHang.Include(dh => dh.KhachHang).Where(dh => dh.MaDH == MaDH).FirstOrDefault(),
                ChiTietDonHangs = _db.ChiTietDonHang.Include(ct => ct.DienThoai).ThenInclude(dt => dt.ModelDienThoai).Where(ct => ct.MaDH == MaDH).ToList()
            };

            return(View(ChiTietDHVM));
        }