Exemplo n.º 1
0
 public ActionResult _AjaxIpDetailList(GridCommand command, IpDetailSearchModel searchModel)
 {
     if (string.IsNullOrEmpty(searchModel.IpNo))
     {
         return(PartialView(new GridModel(new List <IpDetail>())));
     }
     else
     {
         SearchStatementModel searchStatementModel = PrepareIpDetailSearchStatement(command, searchModel);
         GridModel <IpDetail> List = GetAjaxPageData <IpDetail>(searchStatementModel, command);
         foreach (IpDetail flow in List.Data)
         {
             IpMaster item = base.genericMgr.FindById <IpMaster>(flow.IpNo);
             flow.ManufactureParty = item.PartyFrom;
             flow.LotNo            = LotNoHelper.GenerateLotNo();
             flow.HuQty            = flow.Qty;
         }
         return(PartialView(List));
     }
 }
Exemplo n.º 2
0
        public ActionResult IpDetailList(GridCommand command, IpDetailSearchModel searchModel)
        {
            IpMaster Ipmaster = null;

            TempData["IpDetailSearchModel"] = searchModel;
            ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
            if (string.IsNullOrEmpty(searchModel.IpNo))
            {
                SaveErrorMessage("请根据送货单查询");
            }
            else
            {
                TempData["_AjaxMessage"] = "";
                try
                {
                    Ipmaster = base.genericMgr.FindById <IpMaster>(searchModel.IpNo);
                }
                catch (System.Exception)
                {
                    SaveErrorMessage("送货单号不存在,请重新输入!");
                }
            }
            return(PartialView());
        }
Exemplo n.º 3
0
        private SearchStatementModel PrepareIpDetailSearchStatement(GridCommand command, IpDetailSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList <object> param = new List <object>();

            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "h", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("IpNo", searchModel.IpNo, "h", ref whereStatement, param);


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

            SearchStatementModel searchStatementModel = new SearchStatementModel();

            searchStatementModel.SelectCountStatement = selectIpCountStatement;
            searchStatementModel.SelectStatement      = selectIpStatement;
            searchStatementModel.WhereStatement       = whereStatement;
            searchStatementModel.SortingStatement     = sortingStatement;
            searchStatementModel.Parameters           = param.ToArray <object>();

            return(searchStatementModel);
        }