CEL_Payroll/Ease.UICreator/BasicReport.cs
2024-09-17 14:30:13 +06:00

54 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.Printing;
using Ease.Report;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Windows.Forms;
namespace Ease.UICreator
{
public class BasicReport
{
ListView.ListViewItemCollection _oCollections = null;
public BasicReport()
{
}
public DataTable CommonReport(ListView.ListViewItemCollection oLSVCollection)
{
DataTable oDT = new DataTable();
DataRow dr = null;
oDT = GetTableForCommon();
_oCollections = oLSVCollection;
try
{
foreach (ListViewItem oLVItem in _oCollections)
{
dr = oDT.NewRow();
dr["Code"] = oLVItem.SubItems[0].Text;
dr["Description"] = oLVItem.SubItems[1].Text;
oDT.Rows.Add(dr);
}
}
catch(Exception ex)
{
MessageBox.Show("Error: " + ex.Message, "For Devloper:");
}
return oDT;
}
private DataTable GetTableForCommon()
{
DataTable table = new DataTable();
table.Columns.AddRange(new DataColumn[] { new DataColumn("Code"),
new DataColumn("Description")});
return table;
}
}
}