Exemple #1
0
        /// <summary>
        /// 对象转换
        /// </summary>
        /// <param name="srmPullingOrderInfo"></param>
        /// <returns></returns>
        private static BFDAPullingOrderInfo GetSrmPullingOrderInfo(SrmPullingOrderInfo srmPullingOrderInfo)
        {
            BFDAPullingOrderInfo pullingOrderInfo = new BFDAPullingOrderInfo();

            pullingOrderInfo.OrderCode = srmPullingOrderInfo.OrderNo.ToString();

            ///单据类型
            pullingOrderInfo.OrderType = srmPullingOrderInfo.OrderType.GetValueOrDefault().ToString();
            ///道口
            pullingOrderInfo.Dock = srmPullingOrderInfo.Dock;
            ///发单时间
            pullingOrderInfo.PublishTime = srmPullingOrderInfo.PublishTime.GetValueOrDefault().ToString(srmDateFormat);
            ///零件类代码
            pullingOrderInfo.PartBoxCode = srmPullingOrderInfo.PartBoxCode;
            ///零件类名称
            pullingOrderInfo.PartBoxName = srmPullingOrderInfo.PartBoxName;
            ///供应商代码
            pullingOrderInfo.SupplierCode = srmPullingOrderInfo.SupplierNum;
            ///供应商名称
            pullingOrderInfo.SupplierName = srmPullingOrderInfo.SupplierName;
            ///来源存储区代码
            pullingOrderInfo.SourceZoneNo = srmPullingOrderInfo.SourceZoneNo;
            ///目标存储区代码
            pullingOrderInfo.TargetZoneNo = srmPullingOrderInfo.TargetZoneNo;
            ///保管员
            pullingOrderInfo.Keeper = srmPullingOrderInfo.Keeper;
            ///预计发货时间
            pullingOrderInfo.PlanShippingTime = srmPullingOrderInfo.PlanShippingTime.GetValueOrDefault().ToString(srmDateFormat);
            ///预计到货时间
            pullingOrderInfo.PlanDeliveryTime = srmPullingOrderInfo.PlanDeliveryTime.GetValueOrDefault().ToString(srmDateFormat);
            ///备注
            pullingOrderInfo.Remark = srmPullingOrderInfo.Remark;
            ///是否允许编辑ASN
            pullingOrderInfo.AsnFlag = srmPullingOrderInfo.AsnFlag.GetValueOrDefault().ToString() == "true"?"1" : "0";
            ///是否紧急
            pullingOrderInfo.EmergencyFlag = srmPullingOrderInfo.EmergencyFlag.GetValueOrDefault().ToString() == "true" ? "1" : "0";
            ///删除标记
            pullingOrderInfo.DeleteFlag = string.Empty;
            ///工厂代码
            pullingOrderInfo.Plant = srmPullingOrderInfo.Plant;
            ///物料明细
            pullingOrderInfo.OrderDetail      = new BFDAPullingOrderDetailInfos();
            pullingOrderInfo.OrderDetail.list = new List <BFDAPullingOrderDetailInfo>();
            ///获取详细的物料信息
            List <SrmPullingOrderDetailInfo> srmPullingOrderDetailInfos = new SrmPullingOrderDetailBLL().GetList("[ORDER_FID] = N'" + srmPullingOrderInfo.Fid.GetValueOrDefault() + "'", string.Empty);

            foreach (SrmPullingOrderDetailInfo srmPullingOrderDetailInfo in srmPullingOrderDetailInfos)
            {
                pullingOrderInfo.OrderDetail.list.Add(GetSrmPullingOrderDetailInfo(srmPullingOrderDetailInfo));
            }
            return(pullingOrderInfo);
        }
 /// <summary>
 /// InsertInfo
 /// </summary>
 /// <param name="info">对象</param>
 /// <returns></returns>
 public long InsertInfo(SrmPullingOrderInfo info)
 {
     return(dal.Add(info));
 }
        /// <summary>
        /// Create SrmPullingOrderInfo
        /// </summary>
        /// <param name="loginUser"></param>
        /// <returns>SrmPullingOrderInfo</returns>
        public static SrmPullingOrderInfo CreateSrmPullingOrderInfo(string loginUser)
        {
            SrmPullingOrderInfo info = new SrmPullingOrderInfo();

            ///ID
            info.Id = 0;
            ///FID
            info.Fid = Guid.NewGuid();
            ///ORDER_NO
            info.OrderNo = null;
            ///PLANT
            info.Plant = null;
            ///SUPPLIER_NUM
            info.SupplierNum = null;
            ///SOURCE_ZONE_NO
            info.SourceZoneNo = null;
            ///KEEPER
            info.Keeper = null;
            ///TARGET_ZONE_NO
            info.TargetZoneNo = null;
            ///DOCK
            info.Dock = null;
            ///PART_BOX_CODE
            info.PartBoxCode = null;
            ///ORDER_TYPE
            info.OrderType = null;
            ///PUBLISH_TIME
            info.PublishTime = null;
            ///PART_BOX_NAME
            info.PartBoxName = null;
            ///SUPPLIER_NAME
            info.SupplierName = null;
            ///PLAN_SHIPPING_TIME
            info.PlanShippingTime = null;
            ///PLAN_DELIVERY_TIME
            info.PlanDeliveryTime = null;
            ///REMARK
            info.Remark = null;
            ///ASN_FLAG
            info.AsnFlag = null;
            ///EMERGENCY_FLAG
            info.EmergencyFlag = null;
            ///INSPECT_FLAG
            info.InspectFlag = null;
            ///PROCESS_FLAG
            info.ProcessFlag = null;
            ///PROCESS_TIME
            info.ProcessTime = null;
            ///LOG_FID
            info.LogFid = null;
            ///VALID_FLAG
            info.ValidFlag = true;
            ///CREATE_USER
            info.CreateUser = loginUser;
            ///CREATE_DATE
            info.CreateDate = DateTime.Now;
            ///MODIFY_USER
            info.ModifyUser = null;
            ///MODIFY_DATE
            info.ModifyDate = null;
            ///COMMENTS
            info.Comments = null;
            return(info);
        }