コード例 #1
0
        public JsonResult searchData(FormCollection form)
        {
            LOAITAILIEU_THUOCTINHBusiness = Get <LOAITAILIEU_THUOCTINHBusiness>();
            var searchModel = SessionManager.GetValue("thuoctinhSearch") as TAILIEU_THUOCTINH_SEARCH;

            if (searchModel == null)
            {
                searchModel          = new TAILIEU_THUOCTINH_SEARCH();
                searchModel.pageSize = 20;
            }

            searchModel.LOAI_TAILIEU  = form["LOAI_TAILIEU"].ToIntOrZero();
            searchModel.TEN_THUOCTINH = form["TEN_THUOCTINH"];
            if (!string.IsNullOrEmpty(form["TRANGTHAI"]))
            {
                searchModel.TRANGTHAI = form["TRANGTHAI"].Equals("1");
            }
            else
            {
                searchModel.TRANGTHAI = null;
            }
            SessionManager.SetValue("thuoctinhSearch", searchModel);
            var data = LOAITAILIEU_THUOCTINHBusiness.GetDaTaByPage(searchModel, 1, searchModel.pageSize);

            return(Json(data));
        }
コード例 #2
0
        public ActionResult Index()
        {
            LOAITAILIEU_THUOCTINHBusiness = Get <LOAITAILIEU_THUOCTINHBusiness>();
            SessionManager.SetValue("thuoctinhSearch", null);
            var data = LOAITAILIEU_THUOCTINHBusiness.GetDaTaByPage(null);
            TaiLieuThuocTinhModel model = new TaiLieuThuocTinhModel();

            model.ListLoaiTaiLieu = initDanhMuc();
            model.ListResult      = data;
            return(View(model));
        }
コード例 #3
0
        public JsonResult getData(int indexPage, string sortQuery, int pageSize)
        {
            LOAITAILIEU_THUOCTINHBusiness = Get <LOAITAILIEU_THUOCTINHBusiness>();
            var searchModel = SessionManager.GetValue("thuoctinhSearch") as TAILIEU_THUOCTINH_SEARCH;

            if (!string.IsNullOrEmpty(sortQuery))
            {
                if (searchModel == null)
                {
                    searchModel = new TAILIEU_THUOCTINH_SEARCH();
                }
                searchModel.sortQuery = sortQuery;
                if (pageSize > 0)
                {
                    searchModel.pageSize = pageSize;
                }
                SessionManager.SetValue("thuoctinhSearch", searchModel);
            }
            var data = LOAITAILIEU_THUOCTINHBusiness.GetDaTaByPage(searchModel, indexPage, pageSize);

            return(Json(data));
        }