public ActionResult _AjaxTransitOrderList(GridCommand command, TransitOrderSearchModel searchModel)
        {

            if (searchModel.SnapTime == DateTime.MinValue)
            {
                return PartialView(new GridModel(new List<TransitOrder>()));
            }

            SearchStatementModel searchStatementModel = this.PrepareTransitOrderSearchStatement(command, searchModel);
            var dataList = GetAjaxPageData<TransitOrder>(searchStatementModel, command);
            foreach (var data in dataList.Data)
            {
                data.ItemDescription = itemMgr.GetCacheItem(data.Item).FullDescription;
            }
            return PartialView(dataList);
        }
        private SearchStatementModel PrepareTransitOrderSearchStatement(GridCommand command, TransitOrderSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("Location", searchModel.Location, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("IpNo", searchModel.IpNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("SnapTime", searchModel.SnapTime, "t", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);


            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = selectCountTransitOrderStatement;
            searchStatementModel.SelectStatement = selectTransitOrderStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
 public ActionResult TransitOrderList(GridCommand command, TransitOrderSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     if (searchModel.SnapTime == DateTime.MinValue)
     {
         SaveErrorMessage(Resources.EXT.ControllerLan.Con_SnapTimeCanNotBeEmpty);
     }
     return View();
 }