public JsonResult GetAllData(int rows, int page)
        {
            NgachCongChucServices service = new NgachCongChucServices();
            List<NgachCongChucEntity> ngachCongChucs = new List<NgachCongChucEntity>();

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

            return Json(null);
        }
        // GET: NgachCongChuc
        public ActionResult Index()
        {
            NgachCongChucServices service = new NgachCongChucServices();
            List<NgachCongChucEntity> ngachCongChucs = new List<NgachCongChucEntity>();
            string result = null;

            try
            {
                ngachCongChucs = service.GetAll();
                result = JsonConvert.SerializeObject(ngachCongChucs);
                RenderResult.RequestCompleted(ViewData, result);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
                RenderResult.RequestError(ViewData, "Lỗi hệ thống");
            }
            return View();
        }
        public JsonResult GetAllDataWithoutPagination()
        {
            NgachCongChucServices service = new NgachCongChucServices();
            List<NgachCongChucEntity> entities = new List<NgachCongChucEntity>();
            string result = null;
            try
            {
                entities = service.GetAll();
                result = JsonConvert.SerializeObject(entities);
                return Json(RenderResult.RequestCompleted(ViewData, result), JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }

            return Json(null);
        }
        public JsonResult GetMaQuyDinh()
        {
            NgachCongChucServices service = new NgachCongChucServices();

            try
            {
                return Json(RenderResult.RequestCompleted(ViewData, GenKey.GenIncrementKey("NCC", 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);
            }
        }