|
<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> MasterDetailReport
<font color= "blue"> </font>{
<font color= "blue"> private </font>DateTime _orderDate;
<font color= "blue"> private </font>int _orderID;
<font color= "blue"> private </font>int _ordersShipped;
<font color= "blue"> private </font>int _quarter;
<font color= "blue"> private </font>decimal _sales;
<font color= "blue"></font>
<font color= "blue"> public </font>DateTime OrderDate
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _orderDate; }
<font color= "blue"> set</font> { _orderDate = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>int OrderID
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _orderID; }
<font color= "blue"> set</font> { _orderID = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>int OrdersShipped
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _ordersShipped; }
<font color= "blue"> set</font> { _ordersShipped = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>int Quarter
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _quarter; }
<font color= "blue"> set</font> { _quarter = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>decimal Sales
<font color= "blue"> </font>{
<font color= "blue"> get</font> { return _sales; }
<font color= "blue"> set</font> { _sales = value; }
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"></font>
<font color= "blue"> public </font>static MasterDetailReportCollection GetSummary(int year)
<font color= "blue"> </font>{
<font color= "blue"> </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetOrderSummary", year);
<font color= "blue"> </font>MasterDetailReportCollection items = new MasterDetailReportCollection();
<font color= "blue"></font>
<font color= "blue"> </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue"> </font>{
<font color= "blue"> </font>MasterDetailReport item = new MasterDetailReport();
<font color= "blue"> </font>item.Quarter = Convert.ToInt32(row["Quarter"]);
<font color= "blue"> </font>item.OrdersShipped = Convert.ToInt32(row["OrdersShipped"]);
<font color= "blue"> </font>item.Sales = Convert.ToDecimal(row["Sales"]);
<font color= "blue"> </font>items.Add(item);
<font color= "blue"> </font>}
<font color= "blue"> return</font> items;
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> public </font>static MasterDetailReportCollection GetDetails(int year, int quarter)
<font color= "blue"> </font>{
<font color= "blue"> </font>DataSet dsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings[Global.CfgKeyConnString], "Reports_GetOrdersAndDetails", year, quarter);
<font color= "blue"> </font>MasterDetailReportCollection items = new MasterDetailReportCollection();
<font color= "blue"></font>
<font color= "blue"> </font>foreach(DataRow row in dsData.Tables[0].Rows)
<font color= "blue"> </font>{
<font color= "blue"> </font>MasterDetailReport item = new MasterDetailReport();
<font color= "blue"> </font>item.OrderID = Convert.ToInt32(row["OrderID"]);
<font color= "blue"> </font>item.OrderDate = Convert.ToDateTime(row["OrderDate"]);
<font color= "blue"> </font>item.Sales = Convert.ToDecimal(row["Sales"]);
<font color= "blue"> </font>items.Add(item);
<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.