Beispiel #1
0
            public OrderDetail(PBM_OrderDetail m)
            {
                DetailID          = m.ID;
                Product           = m.Product;
                Price             = m.Price;
                DiscountRate      = m.DiscountRate;
                BookQuantity      = m.BookQuantity;
                ConfirmQuantity   = m.ConfirmQuantity;
                DeliveredQuantity = m.DeliveredQuantity;
                Remark            = m.Remark;

                PDT_Product p = new PDT_ProductBLL(Product).Model;

                if (p == null)
                {
                    return;
                }

                ProductName = p.ShortName;

                if (p.ConvertFactor == 0)
                {
                    p.ConvertFactor = 1;
                }
                ConvertFactor = p.ConvertFactor;

                if (p.Category > 0)
                {
                    CategoryName = PDT_CategoryBLL.GetFullCategoryName(p.Category);
                }

                #region 获取字典表名称
                try
                {
                    if (m.SalesMode > 0)
                    {
                        Dictionary_Data dic = DictionaryBLL.GetDicCollections("PBM_SalseMode")[m.SalesMode.ToString()];
                        if (dic != null)
                        {
                            SalesModeName = dic.Name;
                        }
                    }
                    if (p.TrafficPackaging > 0)
                    {
                        PackingName_T = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.TrafficPackaging.ToString()].ToString();
                    }
                    if (p.Packaging > 0)
                    {
                        PackingName_P = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.Packaging.ToString()].ToString();
                    }
                }
                catch (System.Exception err)
                {
                    LogWriter.WriteLog("MCSFramework.WSI.OrderDetail", err);
                }
                #endregion
            }
Beispiel #2
0
        public Inventory(INV_Inventory m)
        {
            Product   = m.Product;
            Quantity  = m.Quantity;
            LotNumber = m.LotNumber;
            CostPrice = m.Price;

            PDT_Product p = new PDT_ProductBLL(Product).Model;

            if (p == null)
            {
                return;
            }

            ProductName = p.ShortName;

            PDT_Brand b = new PDT_BrandBLL(p.Brand).Model;

            if (b != null)
            {
                BrandName = b.Name;
            }

            if (p.Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(p.Category);
            }

            if (p.TrafficPackaging > 0)
            {
                PackingName_T = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.TrafficPackaging.ToString()].ToString();
            }
            if (p.Packaging > 0)
            {
                PackingName_P = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.Packaging.ToString()].ToString();
            }

            if (PackingName_T == "")
            {
                PackingName_T = p.TrafficPackaging.ToString();
            }

            if (p.ConvertFactor == 0)
            {
                p.ConvertFactor = 1;
            }

            ConvertFactor = p.ConvertFactor;
            Quantity_T    = Quantity / p.ConvertFactor;
            Quantity_P    = Quantity % p.ConvertFactor;
        }
Beispiel #3
0
        private void FillModel(PDT_Product m, int TDP)
        {
            ID            = m.ID;
            FullName      = m.FullName;
            ShortName     = m.ShortName;
            Code          = m.Code;
            BarCode       = m.BarCode;
            BoxBarCode    = m.BoxBarCode;
            ConvertFactor = m.ConvertFactor;
            Spec          = m.Spec;
            Remark        = m.Remark;
            Grade         = m.Grade;
            Category      = m.Category;
            FactoryCode   = m.FactoryCode;
            FactoryName   = m.FactoryName;

            #region 获取商品的TDP扩展管理信息
            if (TDP != 0)
            {
                IList <PDT_ProductExtInfo> exts = PDT_ProductExtInfoBLL.GetModelList("Supplier=" + TDP.ToString() + " AND Product=" + m.ID.ToString());
                if (exts.Count > 0)
                {
                    TDPCode = exts[0].Code;
                    if (exts[0].Category != 0)
                    {
                        Category = exts[0].Category;
                    }
                    BuyPrice   = exts[0].BuyPrice;
                    SalesPrice = exts[0].SalesPrice;
                }
            }
            #endregion

            #region 获取品牌、系列、类别名称
            if (m.Brand > 0)
            {
                PDT_Brand brand = new PDT_BrandBLL(m.Brand).Model;
                if (brand != null)
                {
                    BrandName = brand.Name;
                }
            }
            if (m.Classify > 0)
            {
                PDT_Classify classify = new PDT_ClassifyBLL(m.Classify).Model;
                if (classify != null)
                {
                    ClassifyName = classify.Name;
                }
            }
            if (Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(Category);
            }
            #endregion

            #region 获取字典表名称
            try
            {
                if (m.Grade > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Grade")[m.Grade.ToString()];
                    if (dic != null)
                    {
                        GradeName = dic.Name;
                    }
                }

                if (m.TrafficPackaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.TrafficPackaging.ToString()];
                    if (dic != null)
                    {
                        TrafficPackagingName = dic.Name;
                    }
                }
                if (m.Packaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.Packaging.ToString()];
                    if (dic != null)
                    {
                        PackagingName = dic.Name;
                    }
                }
            }
            catch (System.Exception err)
            {
                LogWriter.WriteLog("MCSFramework.WSI.Product", err);
            }
            #endregion

            #region 获取首要图片
            string condition = " RelateType=11 AND RelateID=" + m.ID.ToString() + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',1)='Y'";
            IList <ATMT_Attachment> lists = ATMT_AttachmentBLL.GetModelList(condition);
            if (lists.Count > 0 && ATMT_AttachmentBLL.IsImage(lists[0].ExtName))
            {
                ImageGUID = lists[0].GUID;
            }
            #endregion

            #region 获取附件明细
            Atts = new List <Attachment>();
            IList <ATMT_Attachment> atts = ATMT_AttachmentBLL.GetAttachmentList(11, m.ID, new DateTime(1900, 1, 1), new DateTime(2100, 1, 1));
            foreach (ATMT_Attachment item in atts.OrderBy(p => p.Name))
            {
                Atts.Add(new Attachment(item));
            }
            #endregion
        }