Ejemplo n.º 1
0
        public ActionResult Delete(bool confirm, int idMH)
        {
            if (Session["TaiKhoan"] != null)
            {
                var tk = Session["TaiKhoan"] as KhachHang;


                if (tk.LoaiTK == "Khách Hàng")
                {
                    return(View("../Home/Index"));
                }
                else
                {
                    if (confirm == true)
                    {
                        KinhDAO dao = new KinhDAO();
                        if (Session["UpdateMH"] != null)
                        {
                            var mh = Session["UpdateMH"] as Kinh;
                            if (mh.MaKinh == idMH)
                            {
                                Session["UpdateMH"] = null;
                            }
                        }
                        dao.DeleteDoChoi(tk.MaKH, idMH);
                        Session["ListMH"] = dao.GetList();
                    }
                    return(View("Index"));
                }
            }
            else
            {
                return(View("../DangNhap/Index"));
            }
        }