public ActionResult DangXuat()
        {
            QUANTRIADMIN ad = (QUANTRIADMIN)Session["Admin"];

            if (ad != null)
            {
                Session["Admin"] = null;
                return(RedirectToAction("DangNhap"));
            }
            return(RedirectToAction("DangNhap"));
        }
        public PartialViewResult HienThiTKADPartial()
        {
            QUANTRIADMIN ad = (QUANTRIADMIN)Session["Admin"];

            if (ad == null)
            {
                Response.StatusCode = 404;
                return(null);
            }
            ViewBag.HoTen = ad.TenAD;
            return(PartialView());
        }
        //
        // GET: /Admin/QuanLyChiTietDonHang/
        public ActionResult Index(int?page)
        {
            QUANTRIADMIN qt = (QUANTRIADMIN)Session["Admin"];

            if (qt == null || qt.ToString() == "")
            {
                return(RedirectToAction("DangNhap", "Admin"));
            }
            int pageSize   = 10;
            int pageNumber = (page ?? 1);

            return(View(db.CTDATHANGs.OrderBy(m => m.SoDH).ToList().ToPagedList(pageNumber, pageSize)));
        }
        public ActionResult DangNhap(FormCollection f)
        {
            string       sTaiKhoan = f["txtTKAD"].ToString();
            string       sMatKhau  = f["txtMKAD"].ToString();
            QUANTRIADMIN qtad      = db.QUANTRIADMINs.SingleOrDefault(n => n.TaiKhoan == sTaiKhoan && n.MatKhau == sMatKhau);

            if (qtad != null)
            {
                Session["Admin"] = qtad;
                return(RedirectToAction("Index", "QuanLySanPham"));
            }
            ViewBag.ThongBao = "Sai tài khoản hoặc mật khẩu.Vui lòng đăng nhập lại.";
            return(View());
        }