Пример #1
0
        public ActionResult DaGiao(bool confirm, int idHD)
        {
            if (Session["TaiKhoan"] != null)
            {
                var tk = Session["TaiKhoan"] as KhachHang;


                if (tk.LoaiTK == "Khách Hàng")
                {
                    return(View("../Home/Index"));
                }
                else
                {
                    HoaDonDAO dao = new HoaDonDAO();
                    if (confirm == true)
                    {
                        if (dao.DaGiaoHang(idHD, tk.MaKH) == false)
                        {
                            ViewBag.Err = "Không thể chuyển sang trạng thái giao hàng thành công";
                            return(View("../HoaDon/Index"));
                        }
                        else
                        {
                            Session["HoaDonAdmin"] = dao.GetHD(idHD);
                        }
                    }
                    return(View("Index"));
                }
            }
            else
            {
                return(View("../DangNhap/Index"));
            }
        }