Example #1
0
 public PaperCup(int type, int num) : base(type, num)
 {
     ProductName = "纸杯";
     Model.P_MaterialList m = new Model.P_MaterialList();
     m.StandId   = type;
     m.Num       = num;
     m.MType     = 3;
     m.Price     = DAL.Paper_Stand.GetPrice(type, num);
     m.StandName = "纸杯";
     AllMaterial = new List <Model.P_MaterialList>();
     AllMaterial.Add(m);
     ProductId = 8;
 }
Example #2
0
        /// <summary>
        /// 计算一个产品的材料清单。纸和版的数量。
        /// </summary>
        /// <returns></returns>
        public void  CaculationUnitMaterial(ProductUnit cover)
        {
            if (cover != null)
            {
                if (AllMaterial == null)
                {
                    AllMaterial = new List <Model.P_MaterialList>();
                }
                if (cover.PaperSource == 0)
                {
                    Model.P_MaterialList m1 = new Model.P_MaterialList();
                    m1.StandId     = cover.UserPaper.Id;
                    m1.StandName   = cover.UserPaper.PaperName;
                    m1.MType       = 1;
                    m1.UnitPrice   = cover.UserPaper.PaperPrice;
                    m1.GroupId     = cover.GroupId;
                    m1.ExtendNum   = cover.ExtendNum;
                    m1.ExtendRatio = cover.ExtendRatio;
                    m1.Num         = cover.PaperNum;
                    m1.Price       = Convert.ToInt32((m1.Num + m1.ExtendNum) * m1.UnitPrice);
                    m1.ListCode    = cover.UnitName;
                    AllMaterial.Add(m1);
                }

                if (cover.PrintPs != null)
                {
                    Model.P_MaterialList m2 = new Model.P_MaterialList();
                    if (cover.Color > 2)
                    {
                        m2.StandId = ConstantValue.Process.ColorPsid;
                    }
                    else
                    {
                        m2.StandId = ConstantValue.Process.BlackPsid;
                    }
                    m2.MType = 2;
                    int tie = cover.PrintPs.AllPsNum * 2 + cover.PrintPs.HalfPsNum + cover.PrintPs.QuarPsNum;
                    m2.Num       = tie * cover.PrintPs.Color;
                    m2.StandName = cover.PrintPs.PsName;
                    m2.UnitPrice = cover.PrintPs.UnitPrice;
                    m2.GroupId   = cover.GroupId;
                    m2.Price     = Convert.ToInt32(m2.Num * m2.UnitPrice);
                    m2.ListCode  = cover.UnitName;
                    AllMaterial.Add(m2);
                }
            }
        }