📄 visualreport.cs
字号:
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.Reports.DataAccessLayer;
using System.Collections;
namespace ASPNET.StarterKit.Reports.Components
{
//*********************************************************************
//
// VisualReport Class
//
// The VisualReport class is used to represent a data item for Visual
// Report.
//
//*********************************************************************
public class VisualReport
{
private string _categoryName;
private decimal _sales;
public string CategoryName
{
get { return _categoryName; }
set { _categoryName = value; }
}
public decimal Sales
{
get { return _sales; }
set { _sales = value; }
}
//*********************************************************************
//
// GetCategorySales method retrieves the total of all category sales
// from the database and transforms the result to a VisualReportCollection
// custom colletion before returning it to the calling function
//
//*********************************************************************
public static VisualReportCollection GetCategorySales()
{
DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetCategorySales");
VisualReportCollection items = new VisualReportCollection();
foreach(DataRow row in dsData.Tables[0].Rows)
{
VisualReport item = new VisualReport();
item.CategoryName = row["CategoryName"].ToString();
item.Sales = Convert.ToDecimal(row["Sales"]);
items.Add(item);
}
return items;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -