public JsonResult GetAllData(int rows, int page)
        {
            ThongTinLuongServices service = new ThongTinLuongServices();
            List<ThongTinLuongEntity> thongTinLuongEntitys = new List<ThongTinLuongEntity>();

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

            return Json(null);
        }
        /// only return json to client
        public ActionResult Create(ThongTinLuongEntity thongTinLuongEntity)
        {
            ThongTinLuongServices service = new ThongTinLuongServices();

            if (thongTinLuongEntity == null)
            {
                RenderResult.RequestError(ViewData, "Lỗi đối số không hợp lệ");
                return Json(JsonConvert.SerializeObject(ViewData));
            }

            if (service.Create(thongTinLuongEntity))
            {
                return Json(RenderResult.RequestCompleted(ViewData, "Thêm thông tin lương thành công"));
            }
            else
            {

                return Json(RenderResult.RequestCompleted(ViewData, "Lỗi khi thêm thông tin lương"));
            }
        }
        // GET: ThongTinLuong
        public ActionResult Index()
        {
            ThongTinLuongServices service = new ThongTinLuongServices();
            List<ThongTinLuongEntity> thongTinLuongEntity = new List<ThongTinLuongEntity>();
            string result = null;

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

            return View();
        }
        public ActionResult Edit(ThongTinLuongEntity thongTinLuongEntity)
        {
            ThongTinLuongServices service = new ThongTinLuongServices();

            if (thongTinLuongEntity == null)
            {
                return Json(RenderResult.RequestError(ViewData, "Lỗi đối số không hợp lệ"), JsonRequestBehavior.AllowGet);
            }

            try
            {
                if (service.Update(thongTinLuongEntity))
                    return Json(RenderResult.RequestCompleted(ViewData, "Chỉnh sửa thành công"));

                return Json(RenderResult.RequestCompleted(ViewData, "Chỉnh sửa không thành công"));
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());

                return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra"));
            }
        }
        public ActionResult Delete(ThongTinLuongEntity thongTinLuongEntity)
        {
            ThongTinLuongServices service = new ThongTinLuongServices();

            try
            {
                if (service.Delete(thongTinLuongEntity))
                    return Json(RenderResult.RequestCompleted(ViewData, "Xóa thành công"));

                return Json(RenderResult.RequestCompleted(ViewData, "Xóa không thành công"));
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
                return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra"));
            }

        }
        public ActionResult DeleteWithID(string id)
        {
            ThongTinLuongServices service = new ThongTinLuongServices();

            if (id == null)
                return Json(RenderResult.RequestError(ViewData, "Đối số không hợp lệ"));



            try
            {
                List<int> ids = StringUtility.SplitIdEntity(id);

                for (int i = 0; i < ids.Count; ++i)
                {
                    service.Delete(ids[i]);
                }


                return Json(RenderResult.RequestCompleted(ViewData, "Xóa thành công"));
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
                return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra"));
            }

        }