|
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">using</font> System;
<font color= "blue">using</font> System.Data;
<font color= "blue">using</font> System.Configuration;
<font color= "blue">using</font> ASPNET.StarterKit.Reports.DataAccessLayer;
<font color= "blue">using</font> System.Collections;
<font color= "blue"></font>
<font color= "blue">namespace</font> ASPNET.StarterKit.Reports.Components
<font color= "blue"></font>{
<font color= "blue"> public class</font> TextReport
<font color= "blue"> </font>{
<font color= "blue"> private </font>string _employeeName;
<font color= "blue"> private </font>string _employeeNotes;
<font color= "blue"> private </font>string _employeeTitle;
<font color= "blue"> private </font>string _employeeExt;
<font color= "blue"> private </font>string _employeeAddress;
<font color= "blue"> private </font>string _employeeCity;
<font color= "blue"> private </font>string _employeeState;
<font color= "blue"> private </font>string _employeeZip;
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeName
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeName; }
<font color= "blue"> set</font> { _employeeName = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeNotes
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeNotes; }
<font color= "blue"> set</font> { _employeeNotes = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeTitle
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeTitle; }
<font color= "blue"> set</font> { _employeeTitle = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeExt
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeExt; }
<font color= "blue"> set</font> { _employeeExt = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeAddress
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeAddress; }
<font color= "blue"> set</font> { _employeeAddress = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeCity
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeCity; }
<font color= "blue"> set</font> { _employeeCity = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeState
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeState; }
<font color= "blue"> set</font> { _employeeState = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>string EmployeeZip
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _employeeZip; }
<font color= "blue"> set</font> { _employeeZip = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "green"> //*********************************************************************</font>
<font color= "green"> //</font>
<font color= "green"> // GetEmployees()</font>
<font color= "green"> //</font>
<font color= "green"> // This function calls the "GetEmployees" stored procedure, and for </font>
<font color= "green"> // every row in the resulting DataSet, inserts an item into the </font>
<font color= "green"> // thin class TextReportCollection. TextReportCollection is simply</font>
<font color= "green"> // an ArrayList holding the public property values "EmployeeName", </font>
<font color= "green"> // "EmployeeNotes", "EmployeeTitle", "EmployeeExt", "EmployeeAddress",</font>
<font color= "green"> // "EmployeeCity", "EmployeeState", and "EmployeeZip".</font>
<font color= "green"> //</font>
<font color= "green"> //*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue"> public </font>static TextReportCollection GetEmployees()
<font color= "blue"> </font>{
<font color= "blue"> </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetEmployees");
<font color= "blue"> </font>TextReportCollection items = new TextReportCollection();
<font color= "blue"></font>
<font color= "blue"> </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue"> </font>{
<font color= "blue"> </font>TextReport item = new TextReport();
<font color= "blue"> </font>item.EmployeeName = row["EmployeeName"].ToString();
<font color= "blue"> </font>item.EmployeeNotes = row["EmployeeNotes"].ToString();
<font color= "blue"> </font>item.EmployeeTitle = row["EmployeeTitle"].ToString();
<font color= "blue"> </font>item.EmployeeExt = row["EmployeeExt"].ToString();
<font color= "blue"> </font>item.EmployeeAddress = row["EmployeeAddress"].ToString();
<font color= "blue"> </font>item.EmployeeCity = row["EmployeeCity"].ToString();
<font color= "blue"> </font>item.EmployeeState = row["EmployeeState"].ToString();
<font color= "blue"> </font>item.EmployeeZip = row["EmployeeZip"].ToString();
<font color= "blue"></font>
<font color= "blue"> </font>items.Add(item);
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> return</font> items;
<font color= "blue"> </font>}
<font color= "blue"> </font>}
<font color= "blue"></font>}
</pre>
|
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.