Browse Source

调整。

master
yibo 7 years ago
parent
commit
1dfedb748c
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      WeighAndGrading/WeightGradePrint.cs

+ 14
- 3
WeighAndGrading/WeightGradePrint.cs View File

@ -54,10 +54,21 @@ namespace WeighAndGrading
dic.Add("$Goods_Name", entity.Goods_Name);
dic.Add("$Date", entity.Date.ToString("yyyy/MM/dd"));
var imgUrl = string.Format("TempImg\\_img{0}.png", id);
BwpClientPrint.BwpClientWebPrint.Create2DPic(entity._2DQRCode, imgUrl, 120);
try
{
BwpClientPrint.BwpClientWebPrint.Create2DPic(entity._2DQRCode, imgUrl, 120);
}
catch (Exception ex)
{
var name = string.Format("saveError{0:yyyyMMdd}.log", DateTime.Today);
if (!File.Exists(name))
File.Create(name);
File.AppendAllText(name, ex.Message);
throw;
}
dic.Add("$ImageUrl", imgUrl);
BwpClientPrint.BwpClientWebPrint.Print("GradeWeightPrint.html", dic);
if (id == 20)
if (id == 30)
id = 0;
id++;
AfterPrint();
@ -69,7 +80,7 @@ namespace WeighAndGrading
if (TempImage == null)
TempImage = new DirectoryInfo("TempImg");
var files = TempImage.GetFiles();
if (files.Length > 10)
if (files.Length > 20)
{
var last = files.OrderBy(x => x.CreationTime).First().FullName;
File.Delete(last);


Loading…
Cancel
Save