Пример #1
0
        /// <summary>
        /// 根据任务ID获取任务数据
        /// </summary>
        /// <param name="TaskNo"></param>
        /// <returns></returns>
        public BaseMessage_Model <T_InStockTaskDetailsInfo> GetInTaskDetailListByHeaderID(string TaskNo, UserModel user, List <T_InStockDetailInfo> lstModel)
        {
            int    HeadID    = 0;
            bool   bSucc     = false;
            string strErrMsg = string.Empty;
            BaseMessage_Model <T_InStockTaskDetailsInfo> baseMessage = new BaseMessage_Model <T_InStockTaskDetailsInfo>();
            T_InTaskDetails_DB   tdb       = new T_InTaskDetails_DB();
            T_InTaskDetails_Func tfunc     = new T_InTaskDetails_Func();
            T_AreaInfo           areaModel = new T_AreaInfo();
            T_Area_Func          areaFunc  = new T_Area_Func();

            HeadID = tdb.GetIDByTaskNo(TaskNo);
            List <T_InStockTaskDetailsInfo> lstTaskDetail = new List <T_InStockTaskDetailsInfo>();

            bSucc = tfunc.GetModelListByHeaderID(ref lstTaskDetail, HeadID, ref strErrMsg);
            if (bSucc == false)
            {
                baseMessage.HeaderStatus = "E";
                baseMessage.Message      = strErrMsg;
                return(baseMessage);
            }



            //任务表体数据
            foreach (var item in lstTaskDetail)
            {
                item.lstStockInfo = new List <T_StockInfo>();
                //根据任务表体数据查找收货数据,存在多行
                var lstInDetail = lstModel.FindAll(t => t.MaterialNo == item.MaterialNo);

                foreach (var itemInDetail in lstInDetail)
                {
                    areaFunc.GetAreaModelBySql(0, itemInDetail.lstSerialNo.FirstOrDefault().AreaNo, ref areaModel, ref strErrMsg);
                    foreach (var itemSerialNo in itemInDetail.lstSerialNo)
                    {
                        T_StockInfo stock = new T_StockInfo();
                        stock.SerialNo = itemSerialNo.SerialNo;
                        item.lstStockInfo.Add(stock);
                    }
                }
                item.AreaID      = areaModel.ID;
                item.WarehouseID = areaModel.WarehouseID;
                item.HouseID     = areaModel.HouseID;
                item.ScanQty     = item.lstStockInfo.Count;
            }

            string Result = tfunc.SaveModelListSqlToDBADF(JSONHelper.ObjectToJson <UserModel>(user), JSONHelper.ObjectToJson <List <T_InStockTaskDetailsInfo> >(lstTaskDetail));

            return(JSONHelper.JsonToObject <BaseMessage_Model <T_InStockTaskDetailsInfo> >(Result));
        }
Пример #2
0
        public bool GetAllT_InTaskDetailsByHeaderID(ref List <T_InStockTaskDetailsInfo> modelList, int headerID, ref string strError)
        {
            T_InTaskDetails_Func tfunc = new T_InTaskDetails_Func();

            return(tfunc.GetModelListByHeaderID(ref modelList, headerID, ref strError));
        }