public JsonResult searchData(FormCollection form)
        {
            HSCV_VANBANDIBusiness = Get <HSCV_VANBANDIBusiness>();
            var searchModel = SessionManager.GetValue("VbDaXlSearch") as HSCV_VANBANDI_SEARCH;

            searchModel.SOHIEU           = form["SOHIEU"];
            searchModel.TRICHYEU         = form["TRICHYEU"];
            searchModel.DOKHAN_ID        = form["DOKHAN_ID"].ToIntOrNULL();
            searchModel.DOUUTIEN_ID      = form["DOMAT_ID"].ToIntOrNULL();
            searchModel.LINHVUCVANBAN_ID = form["LINHVUCVANBAN_ID"].ToIntOrNULL();
            searchModel.LOAIVANBAN_ID    = form["LOAIVANBAN_ID"].ToIntOrNULL();
            //searchModel. = form["NGUOIKY"];
            SessionManager.SetValue("VanBanDenSearch", searchModel);
            var data = HSCV_VANBANDIBusiness.GetListProcessed(searchModel, searchModel.pageSize, 1);

            return(Json(data));
        }
        public ActionResult Index()
        {
            AssignUserInfo();
            DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>();
            VanBanDiVM           model       = new VanBanDiVM();
            HSCV_VANBANDI_SEARCH searchModel = new HSCV_VANBANDI_SEARCH();

            model.LstDoKhan        = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.DOQUANTRONG, 0);
            model.LstDoUuTien      = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.DOUUTIEN, 0);
            model.LstLoaiVanBan    = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.LOAI_VANBAN, 0);
            model.LstLinhVucVanBan = DM_DANHMUC_DATABusiness.DsByMaNhom(DMLOAI_CONSTANT.LINHVUCVANBAN, 0);
            HSCV_VANBANDIBusiness  = Get <HSCV_VANBANDIBusiness>();
            searchModel.USER_ID    = currentUser.ID;
            searchModel.ITEM_TYPE  = MODULE_CONSTANT.VANBANTRINHKY;
            model.ListResult       = HSCV_VANBANDIBusiness.GetListProcessed(searchModel, MaxPerpage);
            model.UserInfoBO       = currentUser;
            model.HasRoleThuHoi    = currentUser.ListThaoTac.Where(x => x.MA_THAOTAC == CODE_ROLE_THUHOIVANBAN).FirstOrDefault() != null;
            searchModel.pageSize   = MaxPerpage;
            SessionManager.SetValue("VbDaXlSearch", searchModel);

            #region lấy thông tin wf
            model.STATEBEGIN = 0;
            var WF_MODULEBusiness = Get <WF_MODULEBusiness>();
            var WFMODULEObj       = WF_MODULEBusiness.repository.All().Where(x => x.MODULE_CODE == MODULE_CONSTANT.VANBANTRINHKY).FirstOrDefault();
            if (WFMODULEObj != null)
            {
                var LstWFId           = WFMODULEObj.WF_STREAM_ID.ToListInt(',');
                var WF_STREAMBusiness = Get <WF_STREAMBusiness>();
                var WF_STATEBusiness  = Get <WF_STATEBusiness>();
                var CoCauBusiness     = Get <CCTC_THANHPHANBusiness>();
                var DeptObj           = CoCauBusiness.Find(currentUser.DM_PHONGBAN_ID);
                var StreamObj         = WF_STREAMBusiness.repository.All()
                                        .Where(x => LstWFId.Contains(x.ID) && x.LEVEL_ID == DeptObj.CATEGORY).FirstOrDefault();
                var StateBegin = WF_STATEBusiness.repository.All().Where(x => StreamObj.ID == x.WF_ID && true == x.IS_START).FirstOrDefault();
                if (StateBegin != null)
                {
                    model.STATEBEGIN = StateBegin.ID;
                    var WF_PROCESSBusiness = Get <WF_PROCESSBusiness>();
                    model.STARTSTATEBYUSER = WF_PROCESSBusiness.GetState(StateBegin.ID, currentUser);
                }
            }
            #endregion
            return(View(model));
        }
        public JsonResult getData(int indexPage, string sortQuery, int pageSize)
        {
            HSCV_VANBANDIBusiness = Get <HSCV_VANBANDIBusiness>();
            var searchModel = SessionManager.GetValue("VbDaXlSearch") as HSCV_VANBANDI_SEARCH;

            if (!string.IsNullOrEmpty(sortQuery))
            {
                if (searchModel == null)
                {
                    searchModel = new HSCV_VANBANDI_SEARCH();
                }
                searchModel.sortQuery = sortQuery;
                if (pageSize > 0)
                {
                    searchModel.pageSize = pageSize;
                }
                SessionManager.SetValue("VbChuaXlSearch", searchModel);
            }
            var data = HSCV_VANBANDIBusiness.GetListProcessed(searchModel, pageSize, indexPage);

            return(Json(data));
        }