CEL_Payroll/Payroll.Report/UI/EERSReport.cs

92 lines
2.6 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Payroll.BO;
using Ease.CoreV35.Model;
using Ease.CoreV35;
using Microsoft.Reporting.WinForms;
using Ease.CoreV35.DataAccess;
namespace Payroll.Report
{
public partial class EERSReport : Form
{
EERS _eers = null;
public EERSReport()
{
InitializeComponent();
}
#region Forms Events
private void btnPreview_Click(object sender, EventArgs e)
{
try
{
Cursor.Current = Cursors.WaitCursor;
EERS oEERS = new EERS();
fReportViewer fViewer = new fReportViewer();
_eers = new EERS();
DataSet dsEERS = new DataSet();
DataTable dtEERS = new DataTable();
string RDLC = string.Empty;
dtEERS = oEERS.Get();
dsEERS.Tables.Add(dtEERS);
dsEERS.Tables[0].TableName = "PayrollDataSet_EERSData";
RDLC = "Payroll.Report.RDLC.EERS.rdlc";
if (dsEERS.Tables[0].Rows.Count > 0)
{
fViewer.ShowEERS(dsEERS, dsEERS.Tables[0].TableName, RDLC);
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
Cursor.Current = Cursors.Default;
}
private void btnGenerate_Click(object sender, EventArgs e)
{
}
private void btnExport_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
try
{
EERS r = new EERS();
if(r.ExportEERSFile())
MessageBox.Show("File successfully created.", "Created", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
MessageBox.Show("Please set ERRS file path.", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Cursor.Current = Cursors.Default;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
#endregion
private void EERSReport_Load(object sender, EventArgs e)
{
}
}
}