Example #1
0
        /// <summary>
        /// 对象转换
        /// </summary>
        /// <param name="srmPartReturnSheetInfo"></param>
        /// <returns></returns>
        private static BFDAPartReturnSheetInfo GetSrmPartReturnSheetInfo(SrmPartReturnSheetInfo srmPartReturnSheetInfo)
        {
            BFDAPartReturnSheetInfo info = new BFDAPartReturnSheetInfo();

            info.Plant        = srmPartReturnSheetInfo.Plant;                                                   ///工厂
            info.OrderCode    = srmPartReturnSheetInfo.Ordercode;                                               ///退货单号
            info.Dock         = srmPartReturnSheetInfo.Dock;                                                    ///道口
            info.PublishTime  = srmPartReturnSheetInfo.Publishtime.GetValueOrDefault().ToString(srmDateFormat); ///发单时间
            info.SupplierCode = srmPartReturnSheetInfo.Suppliercode;                                            ///供应商代码
            info.SupplierName = srmPartReturnSheetInfo.Suppliername;                                            ///供应商名称
            info.SourceZoneNo = srmPartReturnSheetInfo.Sourcezoneno;                                            ///来源存储区代码
            info.Keeper       = srmPartReturnSheetInfo.Keeper;                                                  ///保管员
            info.Remark       = srmPartReturnSheetInfo.Remark;                                                  ///备注
            info.DeleteFlag   = srmPartReturnSheetInfo.Deleteflag.GetValueOrDefault() ? "1" : "0";              ///删除标记

            ///
            info.DetailsInfo       = new BFDAPartReturnSheetDetailInfos();
            info.DetailsInfo.Parts = new List <BFDAPartReturnSheetDetailInfo>();
            ///获取详细的订单信息
            List <SrmPartReturnSheetDetailInfo> srmSheetDetailInfos = new SrmPartReturnSheetDetailDAL().GetList("[ORDER_FID] = N'" + srmPartReturnSheetInfo.Fid.GetValueOrDefault() + "'", string.Empty);

            foreach (SrmPartReturnSheetDetailInfo srmSheetDetailInfo in srmSheetDetailInfos)
            {
                info.DetailsInfo.Parts.Add(GetSrmPartReturnSheetDetailInfo(srmSheetDetailInfo));
            }
            return(info);
        }
        /// <summary>
        /// Create SrmPartReturnSheetInfo
        /// </summary>
        /// <param name="loginUser"></param>
        /// <returns>SrmPartReturnSheetInfo</returns>
        public static SrmPartReturnSheetInfo CreateSrmPartReturnSheetInfo(string loginUser)
        {
            SrmPartReturnSheetInfo info = new SrmPartReturnSheetInfo();

            ///ID
            info.Id = 0;
            ///FID
            info.Fid = Guid.NewGuid();
            ///LOG_FID
            info.LogFid = null;
            ///PLANT
            info.Plant = null;
            ///OrderCode
            info.Ordercode = null;
            ///DOCK
            info.Dock = null;
            ///PUBLISHTIME
            info.Publishtime = null;
            ///SUPPLIERCODE
            info.Suppliercode = null;
            ///SUPPLIERNAME
            info.Suppliername = null;
            ///SOURCEZONENO
            info.Sourcezoneno = null;
            ///KEEPER
            info.Keeper = null;
            ///REMARK
            info.Remark = null;
            ///DELETEFLAG
            info.Deleteflag = null;
            ///PARTDETAILS
            info.Partdetails = null;
            ///VALID_FLAG
            info.ValidFlag = 1;
            ///PROCESS_TIME
            info.ProcessTime = null;
            ///PROCESS_FLAG
            info.ProcessFlag = null;
            ///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);
        }
 /// <summary>
 /// InsertInfo
 /// </summary>
 /// <param name="info">对象</param>
 /// <returns></returns>
 public long InsertInfo(SrmPartReturnSheetInfo info)
 {
     return(dal.Add(info));
 }