private void CalculationPaper() { int page = PageNum; Size.Num = PageNum; if (page == 1) { page = 2; } PaperNum = NeedNum * (page / 2) / Size.Kaidu; PrintPs = new PrintSheet(Color, Size.Kaidu, PrintPaper.Kaidu, NeedNum, Size.Num, PrintPaper.Name); PrintNum = PrintPs.TotalPrintNum; int UserArea = Size.Height * Size.Length * Size.Kaidu; int PaperArea = PrintPaper.Height * PrintPaper.Length * PrintPaper.Kaidu; PaperUserRatio = (decimal)UserArea / (decimal)PaperArea; }
public List <Model.P_PrintList> GetPrintUnitByProduct(ProductUnit pu) { List <Model.P_PrintList> result = new List <Model.P_PrintList>(); Model.P_PrintList All; Model.P_PrintList Half; Model.P_PrintList Qur; PrintSheet ps = pu.PrintPs; int tie = ps.AllPsNum * 2 + ps.HalfPsNum + ps.QuarPsNum; if (ps.AllPsNum > 0) { All = new Model.P_PrintList(); All.PsMode = (int)ConstantValue.Process.PsMode.大翻; All.PsModeName = ConstantValue.Process.PsMode.大翻.ToString(); All.PrintHeight = pu.PrintPaper.Height; All.PsNum = ps.AllPsNum * 2; All.PrintLength = pu.PrintPaper.Length; All.PaperId = pu.PrintPaper.Id; All.PaperName = pu.UserPaper.PaperName; All.PrintPaperNum = ps.AllPrintNum; All.ProductHeight = pu.Size.Height; All.ProductLength = pu.Size.Length; All.BigPaperNum = ps.AllPrintNum / ps.PsKaidu; All.Color = pu.Color; All.PaperSource = pu.PaperSource; All.ExtendNum = pu.ExtendNum * ps.AllPsNum * 2 / tie; if (pu.Size.Num > 1) { All.DoubleSide = 2; } else { All.DoubleSide = 1; } All.GroupId = pu.GroupId; if (All.GroupId == 0) { All.UnitName = ProductName; } else { All.UnitName = ProductName + "第" + All.GroupId.ToString() + "个内页"; } result.Add(All); } if (ps.HalfPsNum > 0) { Half = new Model.P_PrintList(); Half.PsMode = (int)ConstantValue.Process.PsMode.正反自翻; Half.PsModeName = ConstantValue.Process.PsMode.正反自翻.ToString(); Half.PrintHeight = pu.PrintPaper.Height; Half.PrintLength = pu.PrintPaper.Length; Half.PaperId = pu.PrintPaper.Id; Half.PaperName = pu.UserPaper.PaperName; Half.PrintPaperNum = ps.HalfPrintNum * pu.PsKaidu; Half.BigPaperNum = ps.HalfPrintNum; Half.Color = pu.Color; Half.PsNum = 1; Half.ProductHeight = pu.Size.Height; Half.ProductLength = pu.Size.Length; Half.PaperSource = pu.PaperSource; Half.ExtendNum = pu.ExtendNum * ps.HalfPsNum / tie; if (pu.Size.Num > 1) { Half.DoubleSide = 2; } else { Half.DoubleSide = 1; } Half.GroupId = pu.GroupId; if (Half.GroupId == 0) { Half.UnitName = ProductName; } else { Half.UnitName = ProductName + "第" + Half.GroupId.ToString() + "个内页"; } result.Add(Half); } if (ps.QuarPsNum > 0) { Qur = new Model.P_PrintList(); Qur.PsMode = (int)ConstantValue.Process.PsMode.双拼自翻; Qur.PsModeName = ConstantValue.Process.PsMode.双拼自翻.ToString(); Qur.PrintHeight = pu.PrintPaper.Height; Qur.PrintLength = pu.PrintPaper.Length; Qur.PaperId = pu.UserPaper.Id; Qur.PaperName = pu.UserPaper.PaperName; Qur.PrintPaperNum = ps.QuarPrintNum * pu.PsKaidu; Qur.BigPaperNum = ps.QuarPrintNum; Qur.Color = pu.Color; Qur.ProductHeight = pu.Size.Height; Qur.ProductLength = pu.Size.Length; Qur.PaperSource = pu.PaperSource; Qur.PsNum = 1; Qur.ExtendNum = pu.ExtendNum * ps.QuarPsNum / tie; if (pu.Size.Num > 1) { Qur.DoubleSide = 2; } else { Qur.DoubleSide = 1; } Qur.GroupId = pu.GroupId; if (Qur.GroupId == 0) { Qur.UnitName = ProductName; } else { Qur.UnitName = ProductName + "第" + Qur.GroupId.ToString() + "个内页"; } result.Add(Qur); } return(result); }