|
|
@ -78,8 +78,8 @@ namespace formula_manage.Windows |
|
|
Template_M.Text = Temp_M;//传入保存的默认模板
|
|
|
Template_M.Text = Temp_M;//传入保存的默认模板
|
|
|
Template_S.Text = Temp_S;//
|
|
|
Template_S.Text = Temp_S;//
|
|
|
|
|
|
|
|
|
Template.ItemsSource = files_M; |
|
|
PrintTemplate.ItemsSource = files_M; |
|
|
Template.DisplayMemberPath = "Name"; |
|
|
PrintTemplate.DisplayMemberPath = "Name"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
|
|
|
@ -209,7 +209,7 @@ namespace formula_manage.Windows |
|
|
list.Add(xePrintName); |
|
|
list.Add(xePrintName); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -221,7 +221,7 @@ namespace formula_manage.Windows |
|
|
|
|
|
|
|
|
Prompt.Visibility = Visibility.Visible; //开启页面遮罩
|
|
|
Prompt.Visibility = Visibility.Visible; //开启页面遮罩
|
|
|
|
|
|
|
|
|
string Template_path = Print_path.Text + "/" + Template.Text; |
|
|
string Template_path = Print_path.Text + "/" + PrintTemplate.Text; |
|
|
string Template_DATA = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Report ScriptLanguage=\"CSharp\" ReportInfo.Created=\"12/12/2023 23:59:59\" ReportInfo.Modified=\"12/12/2023 23:59:59\" ReportInfo.CreatorVersion=\"2023.12.12.0\">\r\n <Dictionary/>\r\n <ReportPage Name=\"Page1\" Watermark.Font=\"宋体, 60pt\">\r\n <ReportTitleBand Name=\"ReportTitle1\" Width=\"718.2\" Height=\"37.8\"/>\r\n <PageHeaderBand Name=\"PageHeader1\" Top=\"41.8\" Width=\"718.2\" Height=\"28.35\"/>\r\n <DataBand Name=\"Data1\" Top=\"74.15\" Width=\"718.2\" Height=\"75.6\"/>\r\n <PageFooterBand Name=\"PageFooter1\" Top=\"153.75\" Width=\"718.2\" Height=\"18.9\"/>\r\n </ReportPage>\r\n</Report>"; |
|
|
string Template_DATA = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Report ScriptLanguage=\"CSharp\" ReportInfo.Created=\"12/12/2023 23:59:59\" ReportInfo.Modified=\"12/12/2023 23:59:59\" ReportInfo.CreatorVersion=\"2023.12.12.0\">\r\n <Dictionary/>\r\n <ReportPage Name=\"Page1\" Watermark.Font=\"宋体, 60pt\">\r\n <ReportTitleBand Name=\"ReportTitle1\" Width=\"718.2\" Height=\"37.8\"/>\r\n <PageHeaderBand Name=\"PageHeader1\" Top=\"41.8\" Width=\"718.2\" Height=\"28.35\"/>\r\n <DataBand Name=\"Data1\" Top=\"74.15\" Width=\"718.2\" Height=\"75.6\"/>\r\n <PageFooterBand Name=\"PageFooter1\" Top=\"153.75\" Width=\"718.2\" Height=\"18.9\"/>\r\n </ReportPage>\r\n</Report>"; |
|
|
|
|
|
|
|
|
if (File.Exists(Template_path)) //判断文件是否存在
|
|
|
if (File.Exists(Template_path)) //判断文件是否存在
|
|
|
@ -230,7 +230,7 @@ namespace formula_manage.Windows |
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (string.IsNullOrEmpty(Template.Text)) |
|
|
if (string.IsNullOrEmpty(PrintTemplate.Text)) |
|
|
{ |
|
|
{ |
|
|
System.Windows.MessageBox.Show("模板名不能为空"); |
|
|
System.Windows.MessageBox.Show("模板名不能为空"); |
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
@ -247,7 +247,7 @@ namespace formula_manage.Windows |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
PRINT_file(); ;//刷新模板列表
|
|
|
PRINT_file(); ;//刷新模板列表
|
|
|
Template.Text = null;//清空输入
|
|
|
PrintTemplate.Text = null;//清空输入
|
|
|
|
|
|
|
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
|
|
|
} |
|
|
} |
|
|
@ -256,7 +256,7 @@ namespace formula_manage.Windows |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
string Template_path = Print_path.Text + "/" + Template.Text; |
|
|
string Template_path = Print_path.Text + "/" + PrintTemplate.Text; |
|
|
File.Delete(Template_path); |
|
|
File.Delete(Template_path); |
|
|
} |
|
|
} |
|
|
catch |
|
|
catch |
|
|
@ -264,11 +264,11 @@ namespace formula_manage.Windows |
|
|
System.Windows.MessageBox.Show("删除失败"); |
|
|
System.Windows.MessageBox.Show("删除失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Template.Text = null; |
|
|
PrintTemplate.Text = null; |
|
|
DirectoryInfo di_M = new DirectoryInfo(Print_path.Text); //new文件夹
|
|
|
DirectoryInfo di_M = new DirectoryInfo(Print_path.Text); //new文件夹
|
|
|
FileInfo[] files_M = di_M.GetFiles("*.frx");//生成文件夹中的文件名合集
|
|
|
FileInfo[] files_M = di_M.GetFiles("*.frx");//生成文件夹中的文件名合集
|
|
|
Template.ItemsSource = files_M;//加载合集
|
|
|
PrintTemplate.ItemsSource = files_M;//加载合集
|
|
|
Template.DisplayMemberPath = "Name"; // 显示文件名
|
|
|
PrintTemplate.DisplayMemberPath = "Name"; // 显示文件名
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|