コード例 #1
0
        public QueryResult QueryProductInventory(InventoryQueryFilter queryFilter)
        {
            QueryResult result        = new QueryResult();
            int         getTotalCount = 0;

            if (null != queryFilter.PMQueryRightType)
            {
                List <int> pms = new List <int>();
                pms = new InentoryAppService().QueryPMListByRight(queryFilter.PMQueryRightType.Value, queryFilter.UserName, queryFilter.CompanyCode);
                if (pms != null && pms.Count > 0)
                {
                    foreach (var item in pms)
                    {
                        queryFilter.AuthorizedPMsSysNumber += "," + item;
                    }
                }
                if (queryFilter.AuthorizedPMsSysNumber.Contains(","))
                {
                    queryFilter.AuthorizedPMsSysNumber = queryFilter.AuthorizedPMsSysNumber.Remove(0, 1);
                }
            }

            //如果是查询总库存,则调用QueryInventory的service,否则调用QueryInventoryStock:
            if (queryFilter.IsShowTotalInventory.HasValue && queryFilter.IsShowTotalInventory.Value == true)
            {
                result.Data = ObjectFactory <IInventoryQueryDA> .Instance.QueryProductInventoryTotal(queryFilter, out getTotalCount);
            }
            else
            {
                result.Data = ObjectFactory <IInventoryQueryDA> .Instance.QueryProductInventoryByStock(queryFilter, out getTotalCount);
            }
            result.TotalCount = getTotalCount;
            return(result);
        }
コード例 #2
0
 private static void SetShiftRequestPMRequestRightFilter(ShiftRequestQueryFilter queryFilter)
 {
     if (null != queryFilter.PMQueryRightType)
     {
         List <int> pms = new List <int>();
         pms = new InentoryAppService().QueryPMListByRight(queryFilter.PMQueryRightType.Value, queryFilter.UserName, queryFilter.CompanyCode);
         if (pms != null && pms.Count > 0)
         {
             foreach (var item in pms)
             {
                 queryFilter.AuthorizedPMsSysNumber += "," + item;
             }
         }
         if (queryFilter.AuthorizedPMsSysNumber.Contains(","))
         {
             queryFilter.AuthorizedPMsSysNumber = queryFilter.AuthorizedPMsSysNumber.Remove(0, 1);
         }
     }
 }