|
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.Reports.DataAccessLayer;
using System.Collections;
namespace ASPNET.StarterKit.Reports.Components
{
public class TextReport
{
private string _employeeName;
private string _employeeNotes;
private string _employeeTitle;
private string _employeeExt;
private string _employeeAddress;
private string _employeeCity;
private string _employeeState;
private string _employeeZip;
public string EmployeeName
{
get { return _employeeName; }
set { _employeeName = value; }
}
public string EmployeeNotes
{
get { return _employeeNotes; }
set { _employeeNotes = value; }
}
public string EmployeeTitle
{
get { return _employeeTitle; }
set { _employeeTitle = value; }
}
public string EmployeeExt
{
get { return _employeeExt; }
set { _employeeExt = value; }
}
public string EmployeeAddress
{
get { return _employeeAddress; }
set { _employeeAddress = value; }
}
public string EmployeeCity
{
get { return _employeeCity; }
set { _employeeCity = value; }
}
public string EmployeeState
{
get { return _employeeState; }
set { _employeeState = value; }
}
public string EmployeeZip
{
get { return _employeeZip; }
set { _employeeZip = value; }
}
//*********************************************************************
//
// GetEmployees()
//
// This function calls the "GetEmployees" stored procedure, and for
// every row in the resulting DataSet, inserts an item into the
// thin class TextReportCollection. TextReportCollection is simply
// an ArrayList holding the public property values "EmployeeName",
// "EmployeeNotes", "EmployeeTitle", "EmployeeExt", "EmployeeAddress",
// "EmployeeCity", "EmployeeState", and "EmployeeZip".
//
//*********************************************************************
public static TextReportCollection GetEmployees()
{
DataSet dsData = DatabaseHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetEmployees");
TextReportCollection items = new TextReportCollection();
foreach(DataRow row in dsData.Tables[0].Rows)
{
TextReport item = new TextReport();
item.EmployeeName = row["EmployeeName"].ToString();
item.EmployeeNotes = row["EmployeeNotes"].ToString();
item.EmployeeTitle = row["EmployeeTitle"].ToString();
item.EmployeeExt = row["EmployeeExt"].ToString();
item.EmployeeAddress = row["EmployeeAddress"].ToString();
item.EmployeeCity = row["EmployeeCity"].ToString();
item.EmployeeState = row["EmployeeState"].ToString();
item.EmployeeZip = row["EmployeeZip"].ToString();
items.Add(item);
}
return items;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.