Skip to content

Commit c7efda5

Browse files
committed
修改了下载错误后的显示;增加了退出时的默认值;更改了后缀名设置
1 parent 90150b6 commit c7efda5

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

Printer/Printer/Form1.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ private void login_download_FormClosing(object sender, FormClosingEventArgs e)
448448
//注意判断关闭事件Reason来源于窗体按钮,否则用菜单退出时无法退出!
449449
if (e.CloseReason == CloseReason.UserClosing)
450450
{
451+
ensure_notifyIcon.Checked = true;
451452
exit_panel.Show();
452453
e.Cancel = true;
453454
//this.WindowState = FormWindowState.Minimized; //使关闭时窗口向右下角缩小的效果

Printer/Printer/ToJsonMy.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,20 @@ public string filename
5050
{
5151
string fileName = id + "_" + copies + "_" + double_side + "_" + student_number + "_" + name;
5252
string doc_extension = Path.GetExtension(fileName);
53-
if (doc_extension != ".pdf")
53+
//if (doc_extension != ".pdf")
54+
//{
55+
// fileName = fileName + ".pdf";
56+
//}
57+
switch (doc_extension)
5458
{
55-
fileName = fileName + ".pdf";
59+
case ".doc":
60+
case ".docx":
61+
case ".ppt":
62+
case ".pptx":
63+
fileName = fileName + ".pdf";
64+
break;
65+
default:
66+
break;
5667
}
5768
return fileName;
5869
}

Printer/Printer/download_class.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ void webClient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
9393
if (!database.jsonlist_err.Contains(file))
9494
{
9595
database.jsonlist_err.Add(file);
96+
display.display_single(form, this.file);
9697
}
9798

9899
}
@@ -130,7 +131,7 @@ private void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
130131
if (e.Error == null)//下载成功
131132
{
132133
MessageBox.Show("已下载完成\n请再次点击打印按钮");
133-
form.mydata.Rows[RowIndex].Cells["operation"].Value = "通知打印完成";
134+
form.mydata.Rows[RowIndex].Cells["operation"].Value = "确认打印完成";
134135
}
135136
else
136137
{
@@ -386,7 +387,7 @@ override public void webClient_DownloadFileCompleted(object sender, AsyncComplet
386387
form.notifyIcon1.Visible = true;
387388
form.notifyIcon1.ShowBalloonTip(10000);
388389
form.mydata.Rows[RowIndex].Cells["status"].Value = "已下载";
389-
form.mydata.Rows[RowIndex].Cells["operation"].Value = "通知打印完成";
390+
form.mydata.Rows[RowIndex].Cells["operation"].Value = "确认打印完成";
390391

391392
if (database.jsonlist_err.Contains(file))
392393
{

Printer/output/Printer.exe

512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)