📄 simplereport.cs
字号:
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.Reports.DataAccessLayer;
using System.Collections;
namespace ASPNET.StarterKit.Reports.Components
{
//*********************************************************************
//
// SimpleReport Class
//
// The SimpleReport class is used to represent a data item for Simple Report
// and is mainly used to retrieve data from the database.
//
//*********************************************************************
public class SimpleReport
{
private string _city;
private string _companyName;
private string _contactName;
private string _contactTitle;
private string _phone;
public string City
{
get { return _city; }
set { _city = value; }
}
public string CompanyName
{
get { return _companyName; }
set { _companyName = value; }
}
public string ContactName
{
get { return _contactName; }
set { _contactName = value; }
}
public string ContactTitle
{
get { return _contactTitle; }
set { _contactTitle = value; }
}
public string Phone
{
get { return _phone; }
set { _phone = value; }
}
//*********************************************************************
//
// GetCustomerContacts method retrieves all the necessary customer contacts
// information from the database and transforms the result to a SimpleReportCollection
// custom colletion before returning it to the calling function
//
//*********************************************************************
public static SimpleReportCollection GetCustomerContacts()
{
DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetCustomerContacts");
SimpleReportCollection items = new SimpleReportCollection();
foreach(DataRow row in dsData.Tables[0].Rows)
{
SimpleReport item = new SimpleReport();
item.City = row["City"].ToString();
item.CompanyName = row["CompanyName"].ToString();
item.ContactName = row["ContactName"].ToString();
item.ContactTitle = row["ContactTitle"].ToString();
item.Phone = row["Phone"].ToString();
items.Add(item);
}
return items;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -