private void ApproveBTN_Click(object sender, EventArgs e) { if (ApproveBTN.Text.Equals("APPROVE")) { if (_pay.NetPay < 0) { RylMessageBox.ShowDialog( "Payroll net pay cannot be negative. Please make necessary adjustments", "Approve Payroll", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { _pay.Approve(); LoadDetails(); LoadComputations(); CheckButtons(); Reference.PayLoadEmployeeList(); } } else { try { var view = new ReportsPreview { Location = Location, Names = EmpListGRD.SelectedRows[0].Cells[1].Value.ToString(), Mode = 5, Pay = _pay, PayrollPeriod = PeriodCMBX.Text }; view.ShowDialog(); } catch (Exception exception) { Console.WriteLine(exception); } } }
private void Export() { var rp = new ReportsPreview(); var r = new Reports(); /*String fullFilePath; * if (Mode == 's') r.ExportPayslipPDF(); * else */ rp.FormatPDF(Mode); if (Mode == 'g') { Main.GuardsLoadReport(); } else if (Mode == 'c') { Main.ClientsLoadSummary(); } else if (Mode == 'd') { Main.SchedLoadReport(); } else if (Mode == 's') { Main.PayLoadReport(); } this.Close(); //else if (Mode == 'p') /* * if (Mode == 'g' || Mode == 'c') * { * fullFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\MSAMIS Reports\\" + Reports.GetFileName(Mode); * * if (!System.IO.File.Exists(fullFilePath)) * { * label69.Text = "Something went wrong!"; * label68.Text = "The file was not created. Please try again."; * } * else * { * label69.Text = "Exporting Success!"; * label68.Text = "Your file has been successfuly exported."; * } * FadeOutTMR.Start(); * } * else * { * FadeOutTMR.Start(); * } */ }
private void ExportClientsSummaryBTN_Click(object sender, EventArgs e) { var rp = new ReportsPreview(); /* * srp.FormatPDF('s');1 * rp.FormatPDF('g'); * rp.FormatPDF('c'); * */ var r = new Reports(); r.PrintPayslipPDF(); rp.FormatPDF('s'); // //r.ExportToPayslipPDF(Payroll.GetApprovedPayrollsList()); }