예제 #1
0
 public ActionResult List(GridCommand command, ShipPlanGroupSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     ViewBag.PlanVersion = searchModel.PlanVersion;
     ViewBag.DateIndex = searchModel.DateIndex;
     ViewBag.ProductLine = searchModel.ProductLine;
     ViewBag.Item = searchModel.Item;
     return View();
 }
예제 #2
0
 public ActionResult _AjaxList(GridCommand command, ShipPlanGroupSearchModel searchModel)
 {
     ViewBag.PlanVersion = searchModel.PlanVersion;
     ViewBag.DateIndex = searchModel.DateIndex;
     ViewBag.ProductLine = searchModel.ProductLine;
     ViewBag.Item = searchModel.Item;
     SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);
     GridModel<MrpShipPlanGroup> MrpShipPlanGroupList = GetAjaxPageData<MrpShipPlanGroup>(searchStatementModel, command);
     foreach (var mrpShipPlanGroup in MrpShipPlanGroupList.Data)
     {
         mrpShipPlanGroup.ItemDescription = genericMgr.FindById<Item>(mrpShipPlanGroup.Item).Description;
     }
     return PartialView(MrpShipPlanGroupList);
 }
예제 #3
0
        private SearchStatementModel PrepareSearchStatement(GridCommand command, ShipPlanGroupSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            IList<object> param = new List<object>();

            HqlStatementHelper.AddEqStatement("PlanVersion", searchModel.PlanVersion, "m", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "m", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.ProductLine, "m", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("WindowTime", searchModel.DateIndex, "m", 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;
        }