コード例 #1
0
        internal void EmailReport(ref Grid rpt)
        {
            using (var ctx = new PayrollDB(Properties.Settings.Default.PayrollDB))
            {
                DataLayer.EmailTemplate etmp = ctx.EmailTemplate.FirstOrDefault(et => et.Key == "EmployeePayStub");
                if (CurrentEmployee.EmailAddress == null)
                {
                    MessageBox.Show("Please add employee's email address before proceding");
                    return;
                }
                if (etmp != null)
                {
                    string pdffile = WPF2PDF.CreatePDF(ref rpt, CurrentEmployee.DisplayName.Replace(" ", "-") + "-" + "PayStub");

                    MyOutlook.Mail.CreateDraft(etmp.FromEmailAddress, etmp.Subject, etmp.EmailBody,
                                               CurrentEmployee.EmailAddress, pdffile);
                }
                else
                {
                    MessageBox.Show("No email template found");
                    return;
                }
            }
        }
コード例 #2
0
 private void PrintNetSalary(object sender, MouseButtonEventArgs e)
 {
     WPF2PDF.CreateAndOpenPDF(ref NetSalaryGrd, "Net Salary");
 }
コード例 #3
0
 private void PrintReport(object sender, MouseButtonEventArgs e)
 {
     //FrameworkElement rpt = (FrameworkElement)DailyReportGD;
     //PrintClass.Print(ref rpt);
     WPF2PDF.CreateAndOpenPDF(ref DailyReportGD, "AccountSummary");
 }