|
|
@@ -187,49 +187,53 @@ namespace UAS_PRINT
|
|
|
}
|
|
|
foreach (var item in barcode)
|
|
|
{
|
|
|
- DataRow dr = dt.NewRow();
|
|
|
- foreach (var itemc in item)
|
|
|
+ int number = Settings.Default.Printnum;
|
|
|
+ for (int i = 0; i < number; i++)
|
|
|
{
|
|
|
- Dictionary<string, object> Sidc = parameter.Find(p => p["LP_NAME"].ToString().Replace(" ", "").Replace("\"", "").ToUpper() == itemc.Key.ToUpper());
|
|
|
- if (Sidc["LP_VALUETYPE"].ToString().Replace(" ", "").Replace("\"", "") == "text")
|
|
|
+ DataRow dr = dt.NewRow();
|
|
|
+ foreach (var itemc in item)
|
|
|
{
|
|
|
- string itemstr = "";
|
|
|
- if (itemc.Value != null)
|
|
|
+ Dictionary<string, object> Sidc = parameter.Find(p => p["LP_NAME"].ToString().Replace(" ", "").Replace("\"", "").ToUpper() == itemc.Key.ToUpper());
|
|
|
+ if (Sidc["LP_VALUETYPE"].ToString().Replace(" ", "").Replace("\"", "") == "text")
|
|
|
{
|
|
|
- itemstr = itemc.Value.ToString();
|
|
|
- while (itemstr.StartsWith("\f") || itemstr.StartsWith("\v") || itemstr.StartsWith("\t") || itemstr.StartsWith("\r") || itemstr.StartsWith("\n"))
|
|
|
- {
|
|
|
- itemstr = itemstr.Remove(0, 2);
|
|
|
- }
|
|
|
- if (itemstr.StartsWith("\""))
|
|
|
- {
|
|
|
- itemstr = itemstr.Remove(0, 1);
|
|
|
- }
|
|
|
- while (itemstr.EndsWith("\f") || itemstr.EndsWith("\v") || itemstr.EndsWith("\t") || itemstr.EndsWith("\r") || itemstr.EndsWith("\n"))
|
|
|
- {
|
|
|
- itemstr = itemstr.Remove(itemstr.Length - 2);
|
|
|
- }
|
|
|
- if (itemstr.EndsWith("\""))
|
|
|
- {
|
|
|
- itemstr = itemstr.Remove(itemstr.Length - 1);
|
|
|
- }
|
|
|
- if (itemstr.Contains("\\\""))
|
|
|
+ string itemstr = "";
|
|
|
+ if (itemc.Value != null)
|
|
|
{
|
|
|
- itemstr = itemstr.Replace("\\\"", "\"");
|
|
|
+ itemstr = itemc.Value.ToString();
|
|
|
+ while (itemstr.StartsWith("\f") || itemstr.StartsWith("\v") || itemstr.StartsWith("\t") || itemstr.StartsWith("\r") || itemstr.StartsWith("\n"))
|
|
|
+ {
|
|
|
+ itemstr = itemstr.Remove(0, 2);
|
|
|
+ }
|
|
|
+ if (itemstr.StartsWith("\""))
|
|
|
+ {
|
|
|
+ itemstr = itemstr.Remove(0, 1);
|
|
|
+ }
|
|
|
+ while (itemstr.EndsWith("\f") || itemstr.EndsWith("\v") || itemstr.EndsWith("\t") || itemstr.EndsWith("\r") || itemstr.EndsWith("\n"))
|
|
|
+ {
|
|
|
+ itemstr = itemstr.Remove(itemstr.Length - 2);
|
|
|
+ }
|
|
|
+ if (itemstr.EndsWith("\""))
|
|
|
+ {
|
|
|
+ itemstr = itemstr.Remove(itemstr.Length - 1);
|
|
|
+ }
|
|
|
+ if (itemstr.Contains("\\\""))
|
|
|
+ {
|
|
|
+ itemstr = itemstr.Replace("\\\"", "\"");
|
|
|
+ }
|
|
|
}
|
|
|
+ dr[itemc.Key] = itemstr;
|
|
|
+ }
|
|
|
+ else if (Sidc["LP_VALUETYPE"].ToString().Replace(" ", "").Replace("\"", "") == "barcode")
|
|
|
+ {
|
|
|
+ dr[itemc.Key] = itemc.Value.ToString().Replace("\"", "");
|
|
|
}
|
|
|
- dr[itemc.Key] = itemstr;
|
|
|
- }
|
|
|
- else if (Sidc["LP_VALUETYPE"].ToString().Replace(" ", "").Replace("\"", "") == "barcode")
|
|
|
- {
|
|
|
- dr[itemc.Key] = itemc.Value.ToString().Replace("\"", "");
|
|
|
}
|
|
|
+ dt.Rows.Add(dr);
|
|
|
}
|
|
|
- dt.Rows.Add(dr);
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
- string logout_confirm = MessageBox.Show("打印"+dt.Rows.Count+"张条码,是否继续", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly).ToString();
|
|
|
+ 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;
|
|
|
@@ -247,7 +251,7 @@ namespace UAS_PRINT
|
|
|
Report.RegisterData(dt, label_type);
|
|
|
Report.GetDataSource(label_type).Enabled = true;
|
|
|
Report.Print();
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
catch(Exception ex)
|