public ActionResult _AjaxList(GridCommand command, CreateDOSearchModel searchModel)
        {

            SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);
            GridModel<CreateDO> gridlist = GetAjaxPageData<CreateDO>(searchStatementModel, command);
            return PartialView(gridlist);
        }
        private SearchStatementModel PrepareSearchStatement(GridCommand command, CreateDOSearchModel searchModel)
        {
            string whereStatement = "";

            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("DoNo", searchModel.DoNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("LocationTo", searchModel.LocationTo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("LocationFrom", searchModel.LocationFrom, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "t", ref whereStatement, param);
            

            if (searchModel.CreateDateFrom != null & searchModel.CreateDateTo != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.CreateDateFrom, searchModel.CreateDateTo, "t", ref whereStatement, param);
            }
            else if (searchModel.CreateDateFrom != null & searchModel.CreateDateTo == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.CreateDateFrom, "t", ref whereStatement, param);
            }
            else if (searchModel.CreateDateFrom == null & searchModel.CreateDateTo != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.CreateDateTo, "t", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by t.CreateDate desc";
            }
            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = selectCountStatement;
            searchStatementModel.SelectStatement = selectStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
 public ActionResult List(GridCommand command, CreateDOSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.PageSize =100;
     return View();
 }