public ActionResult _AjaxFlowDetailList(GridCommand command, FlowDetailSearchModel searchModel) { SearchStatementModel searchStatementModel = PrepareDetailFlowSearchStatement(command, searchModel); GridModel <FlowDetail> List = GetAjaxPageData <FlowDetail>(searchStatementModel, command); if (!string.IsNullOrEmpty(searchModel.Flow)) { FlowMaster flowMaster = base.genericMgr.FindById <FlowMaster>(searchModel.Flow); foreach (FlowDetail flowDetail in List.Data) { flowDetail.ManufactureParty = flowMaster.PartyFrom; flowDetail.LotNo = LotNoHelper.GenerateLotNo(); } foreach (FlowDetail flowDetail in List.Data) { Item item = base.genericMgr.FindById <Item>(flowDetail.Item); flowDetail.ItemDescription = item.Description; } } return(PartialView(List)); }
public ActionResult _FlowDetailList(GridCommand command, FlowDetailSearchModel searchModel) { TempData["FlowDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return(PartialView()); }
private SearchStatementModel PrepareDetailFlowSearchStatement(GridCommand command, FlowDetailSearchModel searchModel) { string whereStatement = string.Empty; IList <object> param = new List <object>(); HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "h", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "h", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectCountFlowStatement; searchStatementModel.SelectStatement = selectFlowStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray <object>(); return(searchStatementModel); }