|
@@ -18,8 +18,10 @@ namespace UAS_PRINT
|
|
|
|
|
|
static List<Bitmap> bitmaps = new List<Bitmap>();
|
|
|
static DataTable dt = new DataTable();
|
|
|
-
|
|
|
|
|
|
+ static int code = 0;
|
|
|
+ static string first = "";
|
|
|
+ static string last = "";
|
|
|
public static void zplprint(string str, string PrinterName)
|
|
|
{
|
|
|
Dictionary<string, object> data = PrintHelper.ToDictionary(str);
|
|
@@ -185,6 +187,9 @@ namespace UAS_PRINT
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ code = 0;
|
|
|
+ first = "";
|
|
|
+ last = "";
|
|
|
foreach (var item in barcode)
|
|
|
{
|
|
|
int number = Settings.Default.Printnum;
|
|
@@ -226,32 +231,38 @@ namespace UAS_PRINT
|
|
|
else if (Sidc["LP_VALUETYPE"].ToString().Replace(" ", "").Replace("\"", "") == "barcode")
|
|
|
{
|
|
|
dr[itemc.Key] = itemc.Value.ToString().Replace("\"", "");
|
|
|
+ if (code == 0)
|
|
|
+ first = itemc.Value.ToString().Replace("\"", "");
|
|
|
+ if(code == barcode.Count -1)
|
|
|
+ last = itemc.Value.ToString().Replace("\"", "");
|
|
|
}
|
|
|
}
|
|
|
dt.Rows.Add(dr);
|
|
|
}
|
|
|
+ code++;
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
string logout_confirm = MessageBox.Show("打印" + dt.Rows.Count + "张条码,是否继续", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly).ToString();
|
|
|
+
|
|
|
if (logout_confirm == "Yes")
|
|
|
{
|
|
|
- Report.PrintSettings.ShowDialog = false;
|
|
|
- byte[] buffer = Encoding.GetEncoding("GB2312").GetBytes(chooseprintername);
|
|
|
- chooseprintername = Encoding.UTF8.GetString(buffer);
|
|
|
- Report.PrintSettings.Printer = chooseprintername.Replace("\\\\", "\\");
|
|
|
- foreach (DataRow dr in dt.Rows)
|
|
|
- {
|
|
|
- DataTable dta = dt.Clone();
|
|
|
- dta.Rows.Add(dr.ItemArray);
|
|
|
- Report.RegisterData(dta, label_type);
|
|
|
- Report.GetDataSource(label_type).Enabled = true;
|
|
|
- Report.Print();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ Report.PrintSettings.ShowDialog = false;
|
|
|
+ byte[] buffer = Encoding.GetEncoding("GB2312").GetBytes(chooseprintername);
|
|
|
+ chooseprintername = Encoding.UTF8.GetString(buffer);
|
|
|
+ Report.PrintSettings.Printer = chooseprintername.Replace("\\\\", "\\");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Report.RegisterData(dt, label_type);
|
|
|
+ Report.GetDataSource(label_type).Enabled = true;
|
|
|
+ Report.Print();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
catch(Exception ex)
|