Added Menu Item under help to Create Error Log Email

Put approved PDF in temporary folder for viewing
This commit is contained in:
Rich 2012-04-26 22:04:39 +00:00
parent c16424e008
commit f40cd6817b
2 changed files with 28 additions and 3 deletions

View File

@ -36,6 +36,7 @@ namespace VEPROMS
this.btnHelpAbout = new DevComponents.DotNetBar.ButtonItem(); this.btnHelpAbout = new DevComponents.DotNetBar.ButtonItem();
this.btnHelpVWeb = new DevComponents.DotNetBar.ButtonItem(); this.btnHelpVWeb = new DevComponents.DotNetBar.ButtonItem();
this.btnShortCuts = new DevComponents.DotNetBar.ButtonItem(); this.btnShortCuts = new DevComponents.DotNetBar.ButtonItem();
this.btnSendErrorLog = new DevComponents.DotNetBar.ButtonItem();
this.office2007StartButton1 = new DevComponents.DotNetBar.Office2007StartButton(); this.office2007StartButton1 = new DevComponents.DotNetBar.Office2007StartButton();
this.itemContainer1 = new DevComponents.DotNetBar.ItemContainer(); this.itemContainer1 = new DevComponents.DotNetBar.ItemContainer();
this.itemContainer2 = new DevComponents.DotNetBar.ItemContainer(); this.itemContainer2 = new DevComponents.DotNetBar.ItemContainer();
@ -188,7 +189,8 @@ namespace VEPROMS
this.btnHelpManual, this.btnHelpManual,
this.btnHelpAbout, this.btnHelpAbout,
this.btnHelpVWeb, this.btnHelpVWeb,
this.btnShortCuts}); this.btnShortCuts,
this.btnSendErrorLog});
this.btnHelp.Text = "Help"; this.btnHelp.Text = "Help";
// //
// btnHelpManual // btnHelpManual
@ -221,6 +223,13 @@ namespace VEPROMS
this.btnShortCuts.Text = "Shortcut List"; this.btnShortCuts.Text = "Shortcut List";
this.btnShortCuts.Click += new System.EventHandler(this.btnShortCuts_Click); this.btnShortCuts.Click += new System.EventHandler(this.btnShortCuts_Click);
// //
// btnSendErrorLog
//
this.btnSendErrorLog.Image = global::VEPROMS.Properties.Resources.EnvelopeHS;
this.btnSendErrorLog.Name = "btnSendErrorLog";
this.btnSendErrorLog.Text = "Send Error Log";
this.btnSendErrorLog.Click += new System.EventHandler(this.btnSendErrorLog_Click);
//
// office2007StartButton1 // office2007StartButton1
// //
this.office2007StartButton1.AutoExpandOnClick = true; this.office2007StartButton1.AutoExpandOnClick = true;
@ -1436,6 +1445,7 @@ namespace VEPROMS
private Volian.Controls.Library.DisplayHistory displayHistory; private Volian.Controls.Library.DisplayHistory displayHistory;
private DevComponents.DotNetBar.ButtonItem btnUpdateFormats; private DevComponents.DotNetBar.ButtonItem btnUpdateFormats;
private System.Windows.Forms.FolderBrowserDialog fbd; private System.Windows.Forms.FolderBrowserDialog fbd;
private DevComponents.DotNetBar.ButtonItem btnSendErrorLog;
} }
} }

View File

@ -231,10 +231,11 @@ namespace VEPROMS
buffer = PromsPrinter.WatermarkPDF(args.MyBuffer, args.MyWatermark); buffer = PromsPrinter.WatermarkPDF(args.MyBuffer, args.MyWatermark);
else else
buffer = args.MyBuffer; buffer = args.MyBuffer;
FileStream fs = new FileStream(args.MyFilename, FileMode.Create); string fileName = Volian.Base.Library.VlnSettings.TemporaryFolder + "\\" + args.MyFilename;
FileStream fs = new FileStream(fileName, FileMode.Create);
fs.Write(buffer, 0, buffer.Length); fs.Write(buffer, 0, buffer.Length);
fs.Close(); fs.Close();
System.Diagnostics.Process.Start(args.MyFilename); System.Diagnostics.Process.Start(fileName);
} }
void displayHistory_AnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem) void displayHistory_AnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem)
@ -1827,5 +1828,19 @@ namespace VEPROMS
bottomProgBar.Text = args.Status; bottomProgBar.Text = args.Status;
} }
private void btnSendErrorLog_Click(object sender, EventArgs e)
{
frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString());
if (frm.ShowDialog(this) == DialogResult.OK)
{
Properties.Settings.Default.OutlookEmail = frm.OutlookEmail;
Properties.Settings.Default.SMTPServer = frm.SMTPServer;
Properties.Settings.Default.SMTPUser = frm.SMTPUser;
Properties.Settings.Default.Save();
MessageBox.Show("PROMS Error Log successfully sent to Volian support");
}
}
} }
} }