|
|
@@ -9,6 +9,7 @@ using System.Windows.Forms;
|
|
|
using System.Drawing.Printing;
|
|
|
using FastReport;
|
|
|
using System.Data;
|
|
|
+using System.Threading;
|
|
|
|
|
|
namespace UAS_Web.tool
|
|
|
{
|
|
|
@@ -19,7 +20,7 @@ namespace UAS_Web.tool
|
|
|
//打印图片集合
|
|
|
List<Bitmap> bitmaps = new List<Bitmap>();
|
|
|
|
|
|
- DataTable dt = new DataTable("VENDORBARCODE_VIEW");
|
|
|
+
|
|
|
|
|
|
Report Report = new Report();
|
|
|
|
|
|
@@ -122,13 +123,40 @@ namespace UAS_Web.tool
|
|
|
PrintType = data["data"].ToString().Replace("\"", "");
|
|
|
break;
|
|
|
case "vendorZplPrint.action":
|
|
|
+ DataTable dt = new DataTable();
|
|
|
RadioButton PRFR = (RadioButton)print.Controls["PRFR"];
|
|
|
RadioButton PRPIC = (RadioButton)print.Controls["PRPIC"];
|
|
|
+
|
|
|
+ string type;
|
|
|
+ bitmaps.Clear();
|
|
|
+ filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
|
|
|
+ str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
|
|
|
+ data = ToDictionary(str);
|
|
|
+ List<Dictionary<string, object>> parameter = new List<Dictionary<string, object>>();
|
|
|
+ List<Dictionary<string, object>> barcode = new List<Dictionary<string, object>>();
|
|
|
+ parameter = (List<Dictionary<string, object>>)data["parameter"];
|
|
|
+ barcode = (List<Dictionary<string, object>>)data["barcode"];
|
|
|
+ try
|
|
|
+ {
|
|
|
+ type = ((String)data["type"]).Replace("\"", "");
|
|
|
+ }
|
|
|
+ catch {
|
|
|
+ type = "no";
|
|
|
+ }
|
|
|
+
|
|
|
if (PRFR.Checked)
|
|
|
{
|
|
|
+ Thread.Sleep(800);
|
|
|
try
|
|
|
{
|
|
|
- Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + "GD.frx");
|
|
|
+ if (type == "box")
|
|
|
+ {
|
|
|
+ Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + "GD_box.frx");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + "GD.frx");
|
|
|
+ }
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
|
@@ -136,14 +164,6 @@ namespace UAS_Web.tool
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- bitmaps.Clear();
|
|
|
- filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
|
|
|
- str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
|
|
|
- data = ToDictionary(str);
|
|
|
- List<Dictionary<string, object>> parameter = new List<Dictionary<string, object>>();
|
|
|
- List<Dictionary<string, object>> barcode = new List<Dictionary<string, object>>();
|
|
|
- parameter = (List<Dictionary<string, object>>)data["parameter"];
|
|
|
- barcode = (List<Dictionary<string, object>>)data["barcode"];
|
|
|
int la_width = int.Parse(parameter.First()["LA_WIDTH"].ToString());
|
|
|
int la_height = int.Parse(parameter.First()["LA_HEIGHT"].ToString());
|
|
|
|
|
|
@@ -282,11 +302,25 @@ namespace UAS_Web.tool
|
|
|
}
|
|
|
if(PRFR.Checked)
|
|
|
{
|
|
|
- Report.RegisterData(dt, "VENDORBARCODE_VIEW");
|
|
|
- Report.GetDataSource("VENDORBARCODE_VIEW").Enabled = true;
|
|
|
- Report.PrintSettings.ShowDialog = false;
|
|
|
- Report.PrintSettings.Printer = PrinterName;
|
|
|
- Report.Print();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (type == "box")
|
|
|
+ {
|
|
|
+ Report.RegisterData(dt, "VENDORBARCODE_BOX_VIEW");
|
|
|
+ Report.GetDataSource("VENDORBARCODE_BOX_VIEW").Enabled = true;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Report.RegisterData(dt, "VENDORBARCODE_VIEW");
|
|
|
+ Report.GetDataSource("VENDORBARCODE_VIEW").Enabled = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ Report.PrintSettings.ShowDialog = false;
|
|
|
+ Report.PrintSettings.Printer = PrinterName;
|
|
|
+ Report.Print();
|
|
|
+ }
|
|
|
+ catch {
|
|
|
+ MessageBox.Show("程序打印出现错误,请检查标签文件格式");
|
|
|
+ }
|
|
|
dt.Clear();
|
|
|
}
|
|
|
break;
|