public JsonResult GetAllData(int rows, int page)
        {
            TinhThanhService service = new TinhThanhService();
            List<TinhThanhEntity> tinhthanhs= new List<TinhThanhEntity>();

            try
            {
                tinhthanhs= service.GetAll();
                return Json(PaginationHelper<TinhThanhEntity>.Execute(tinhthanhs, page, rows), JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }

            return Json(null);
        }
        public JsonResult GetAllDataWithoutPagination()
        {
            TinhThanhService service = new TinhThanhService();
            List<TinhThanhEntity> listTinhThanh = new List<TinhThanhEntity>();
            string result = null;
            try
            {
                listTinhThanh = service.GetAll();
                result = JsonConvert.SerializeObject(listTinhThanh);
                return Json(RenderResult.RequestCompleted(ViewData, result), JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }

            return Json(null);
        }
        // GET: TinhThanh
        public ActionResult Index()
        {
            TinhThanhService service = new TinhThanhService();
            List<TinhThanhEntity> tinhthanhs= new List<TinhThanhEntity>();
            string result = null;

            try
            {
                tinhthanhs= service.GetAll();
                result = JsonConvert.SerializeObject(tinhthanhs);
                RenderResult.RequestCompleted(ViewData, result);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
                RenderResult.RequestError(ViewData, "Lỗi hệ thống");
            }

            return View();
        }
 public JsonResult GetAllQuanHuyenTinhThanh()
 {
     string result = null;
     TinhThanhService service = new TinhThanhService();
     List<TinhThanhEntity> ttServices = new List<TinhThanhEntity>();
     try
     {
         ttServices = service.GetAll();
         result = JsonConvert.SerializeObject(ttServices);
         return Json(ttServices, JsonRequestBehavior.AllowGet);
     }
     catch (Exception e)
     {
         System.Console.WriteLine(e.ToString());
         return Json(null);
     }            
 }
        public JsonResult GetMaQuyDinh()
        {
            TinhThanhService service = new TinhThanhService();

            try
            {
                return Json(RenderResult.RequestCompleted(ViewData, GenKey.GenIncrementKey("DV", 3, service.GetAll().Count)), JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
                return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra"), JsonRequestBehavior.AllowGet);
            }
        }