Ejemplo n.º 1
0
 private void Init()
 {
     if (OldSize.Id > 0)
     {
         Model.ProductSize s1 = DAL.ProductSize.GetModel(OldSize.Id);
         if (s1 != null)
         {
             OldSize.Id     = s1.Id;
             OldSize.Length = s1.StandLength;
             OldSize.Height = s1.StandHeight;
             OldSize.Kaidu  = s1.Kaidu;
             //有原始尺寸ID,就去查找P_SHEET表,有开法就返回,没有开法继续找;
             if (GetPsSheet())
             {
                 Ratio = GetRatio(OldSize.Length, OldSize.Height, NewSize.Length, NewSize.Height) * OldSize.Kaidu / NewSize.Kaidu;
                 return;
             }
         }
     }
     //g根据原始尺寸的大小,去P_SHEET表中查找如果不成功,则继续手动计算;
     if (!GetPsSheet(OldSize.Length, OldSize.Height))
     {
         NewSize = GetNewSize(OldSize.Length, OldSize.Height);
         if (NewSize == null)
         {
             OldSize.Id    = 0;
             OldSize.Name  = "非标尺寸";
             OldSize.Kaidu = 2;
             NewSize       = OldSize;
         }
     }
     Ratio = GetRatio(OldSize.Length, OldSize.Height, NewSize.Length, NewSize.Height) * OldSize.Kaidu / NewSize.Kaidu;
     return;
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="psize">size.id 尺寸ID,size.Length长, size.Height高, size.MId纸的ID,size.Num页码数,
        /// psize.Status纸张来源,psize.b1 内容是否重复</param>
        /// <param name="ProNum">产品数量</param>
        /// <param name="color">颜色数</param>
        public papersheet(Model.recttange psize, int ProNum, int color)
        {
            rectang size = new rectang();

            size        = Common.GetRectByModle(psize);
            ProductSize = new rectang();
            if (size.Id > 0)
            {
                ProductSize.Id = size.Id;
                Model.ProductSize p = DAL.ProductSize.GetModel(size.Id);
                ProductSize.Length = p.StandLength;
                ProductSize.Height = p.StandHeight;
                ProductSize.Kaidu  = p.Kaidu;
                ProductSize.Name   = p.NickName;
            }
            else
            {
                ProductSize.Length = psize.length;
                ProductSize.Height = psize.height;
                FoldSheet fd = new FoldSheet(ProductSize.Length, ProductSize.Height);
                if (fd.OldSize != null)
                {
                    ProductSize.Kaidu = fd.OldSize.Kaidu;
                    ProductSize.Name  = fd.OldSize.Name;
                }
            }
            ProductNum     = ProNum;
            Cover          = new ProductUnit(size.Id, size.Length, size.Height, size.MId, color, size.Num, psize.Status, psize.b1, ProNum);
            Cover.GroupId  = 0;
            Cover.UnitName = ProductName;
            //UserRequest = "test!";
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 调整小幅度的非标尺寸到标准尺寸,用户原始输入的尺寸保存在UserSize,数据保存的标准尺寸保存到OldSize;
        /// </summary>
        /// <returns></returns>
        private bool AdjustOldSize(int l, int h)
        {
            bool sucess = false;

            Model.ProductSize psize = DAL.ProductSize.GetModel(l, h);
            if (psize != null)
            {
                OldSize.Id     = psize.Id;
                OldSize.Height = psize.StandHeight;
                OldSize.Length = psize.StandLength;
                OldSize.Kaidu  = psize.Kaidu;
                OldSize.Name   = psize.NickName;
                sucess         = true;
            }
            return(sucess);
        }