public JsonResult searchData(FormCollection form) { HSCV_CONGVIECBusiness = Get <HSCV_CONGVIECBusiness>(); var searchModel = SessionManager.GetValue("ProcessedJobSearchModel") as HSCV_CONGVIEC_SEARCH; if (searchModel == null) { searchModel = new HSCV_CONGVIEC_SEARCH(); searchModel.pageSize = MaxPerpage; } string TENCONGVIEC = form["TENCONGVIEC"]; string NGAYBATDAU_FROM = form["NGAYBATDAU_FROM"]; string NGAYBATDAU_TO = form["NGAYBATDAU_TO"]; string NGAYKETTHUC_FROM = form["NGAYKETTHUC_FROM"]; string NGAYKETTHUC_TO = form["NGAYKETTHUC_TO"]; string DOKHAN_ID = form["DOKHAN_ID"]; string DOMAT_ID = form["DOMAT_ID"]; #region Gán giá trị if (!string.IsNullOrEmpty(TENCONGVIEC)) { searchModel.TENCONGVIEC = TENCONGVIEC.Trim(); } searchModel.NGAYBATDAU_FROM = NGAYBATDAU_FROM.ToDateTime(); searchModel.NGAYBATDAU_TO = NGAYBATDAU_TO.ToDateTime(); searchModel.NGAYKETTHUC_FROM = NGAYKETTHUC_FROM.ToDateTime(); searchModel.NGAYKETTHUC_TO = NGAYKETTHUC_TO.ToDateTime(); if (!string.IsNullOrEmpty(DOKHAN_ID)) { searchModel.DOKHAN = DOKHAN_ID.ToLongOrNULL(); } if (!string.IsNullOrEmpty(DOMAT_ID)) { searchModel.DO_UUTIEN = DOMAT_ID.ToLongOrNULL(); } #endregion SessionManager.SetValue("ProcessedJobSearchModel", searchModel); var data = HSCV_CONGVIECBusiness.GetListProcessedJob(searchModel, searchModel.pageSize, 1); SessionManager.SetValue("ProcessedJobSearch", data.ListItem); return(Json(data)); }
//private CCTC_THANHPHANBusiness CCTC_THANHPHANBusiness; public ActionResult Index() { CongViecIndexViewModel model = new CongViecIndexViewModel(); HSCV_CONGVIECBusiness = Get <HSCV_CONGVIECBusiness>(); HSCV_CONGVIEC_SEARCH searchModel = new HSCV_CONGVIEC_SEARCH(); AssignUserInfo(); searchModel.USER_ID = currentUser.ID; searchModel.pageSize = MaxPerpage; SessionManager.SetValue("ProcessedJobSearchModel", searchModel); var ListCongViec = HSCV_CONGVIECBusiness.GetListProcessedJob(searchModel, MaxPerpage); model.ListResult = ListCongViec; DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>(); model.ListDoKhan = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.DOQUANTRONG, 0); model.ListDoUuTien = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.DOUUTIEN, 0); model.UserInfo = currentUser; SessionManager.SetValue("ProcessedJobSearch", ListCongViec.ListItem); return(View(model)); }
public JsonResult getData(int indexPage, string sortQuery, int pageSize) { HSCV_CONGVIECBusiness = Get <HSCV_CONGVIECBusiness>(); var searchModel = SessionManager.GetValue("ProcessedJobSearchModel") as HSCV_CONGVIEC_SEARCH; if (!string.IsNullOrEmpty(sortQuery)) { if (searchModel == null) { searchModel = new HSCV_CONGVIEC_SEARCH(); } searchModel.sortQuery = sortQuery; if (pageSize > 0) { searchModel.pageSize = pageSize; } SessionManager.SetValue("ProcessedJobSearchModel", searchModel); } var data = HSCV_CONGVIECBusiness.GetListProcessedJob(searchModel, pageSize, indexPage); SessionManager.SetValue("ProcessedJobSearch", data.ListItem); return(Json(data)); }