コード例 #1
0
        public ActionResult List(GridCommand command, PartySearchModel searchModel)
        {
            SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);

            ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
            return(View());
        }
コード例 #2
0
        private SearchStatementModel PrepareSearchStatement(GridCommand command, PartySearchModel searchModel)
        {
            string         whereStatement = string.Empty;
            IList <object> param          = new List <object>();

            HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Start, "s", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Name", searchModel.Name, HqlStatementHelper.LikeMatchMode.Start, "s", ref whereStatement, param);
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            SearchStatementModel searchStatementModel = new SearchStatementModel();

            searchStatementModel.SelectCountStatement = selectCountStatement;
            searchStatementModel.SelectStatement      = selectStatement;
            searchStatementModel.WhereStatement       = whereStatement;
            searchStatementModel.SortingStatement     = sortingStatement;
            searchStatementModel.Parameters           = param.ToArray <object>();
            return(searchStatementModel);
        }
コード例 #3
0
        public void ExportSupplierXLS(PartySearchModel searchModel)
        {
            string hql = " select u from Supplier  as u where 1=1";

            if (!string.IsNullOrWhiteSpace(searchModel.Code))
            {
                hql += string.Format(" and u.ReferenceCode like '{0}%' ", searchModel.Code);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.ShortCode))
            {
                hql += string.Format(" and u.ShortCode like '{0}%' ", searchModel.ShortCode);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.Name))
            {
                hql += string.Format(" and u.Name like '{0}%' ", searchModel.Name);
            }
            hql += " order by u.CreateDate asc ";
            IList <Supplier> exportSupplierList = this.genericMgr.FindAll <Supplier>(hql);

            ExportToXLS <Supplier>("ExportSupplierXLS", "xls", exportSupplierList);
        }
コード例 #4
0
        public ActionResult _AjaxList(GridCommand command, PartySearchModel searchModel)
        {
            SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);

            return(PartialView(GetAjaxPageData <Plant>(searchStatementModel, command)));
        }