Exemplo n.º 1
0
 public ActionResult _AjaxActiveOrderList(GridCommand command, ActiveOrderSearchModel searchModel)
 {
     if (searchModel.SnapTime == DateTime.MinValue)
     {
         return PartialView(new GridModel(new List<ActiveOrder>()));
     }
     SearchStatementModel searchStatementModel = this.PrepareActiveOrderSearchStatement(command, searchModel);
     var dataList = GetAjaxPageData<ActiveOrder>(searchStatementModel, command);
     foreach (var data in dataList.Data)
     {
         data.ItemDescription = itemMgr.GetCacheItem(data.Item).FullDescription;
     }
     return PartialView(dataList);
 }
Exemplo n.º 2
0
        private SearchStatementModel PrepareActiveOrderSearchStatement(GridCommand command, ActiveOrderSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("Location", searchModel.Location, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "i", ref whereStatement, param);

            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("SnapTime", searchModel.SnapTime, "i", ref whereStatement, param);
            if (searchModel.IsIndepentDemand)
            {
                HqlStatementHelper.AddEqStatement("IsIndepentDemand", searchModel.IsIndepentDemand, "i", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
Exemplo n.º 3
0
        public ActionResult ActiveOrderList(GridCommand command, ActiveOrderSearchModel 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();
        }