コード例 #1
0
ファイル: Excel_Func.cs プロジェクト: shew990/TaiBang
        /// <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
ファイル: AndroidService.svc.cs プロジェクト: shew990/TaiBang
        /// <summary>
        /// 保存上架扫描数据
        /// </summary>
        /// <param name="UserJson"></param>
        /// <param name="ModelJson"></param>
        /// <returns></returns>
        public string SaveT_InStockTaskDetailADF(string UserJson, string ModelJson)
        {
            T_InTaskDetails_Func tfunc = new T_InTaskDetails_Func();

            return(tfunc.SaveModelListSqlToDBADF(UserJson, ModelJson));
        }