|
/* ----------------------------------------------------------------------------
* Project ExpandPanelGridView
* Sample C# code to show details in an expandable panel inside a GridView
*
* Written by Amauri Rodrigues - September 2008
* email : rramauri@hotmail.com
*
* Feel free to modify this peace of code - It is a sample.
* Feel free to use in commercial and non-commercial projects.
*
* Requires Microsoft Ajax (http://www.asp.net/ajax)
*
* If you want to run this sample with data from AdventureWorks database :
* 1) Download from http: http://www.codeplex.com/MSFTDBProdSamples
* 2) Modify connectionString in Web.config :
* <connectionStrings>
* <add name="AdventureWorksConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=AdventureWorks;User ID=sa"
* providerName="System.Data.SqlClient" />
* </connectionStrings>
* ----------------------------------------------------------------------------
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace ExpandPanelGridView.Bll
{
/// <summary>
/// Fills a collection with simulated data, on top stores
/// </summary>
public static class TopStoreSimulated
{
/// <summary>
/// Get a collection of top stores (simulated)
/// </summary>
/// <returns>A collection of top stores</returns>
public static ReadOnlyCollection<BO.Store> GetData() {
/* AdventureWorks :
Select TOP 20 s.CustomerID,
s.Name as Store,
Sum(so.TotalDue) as Sales,
'stores.Add(new BO.Model(' +
Cast(s.CustomerID as VarChar(5)) + ',' +
'"' + s.Name + '", ' +
Cast(Sum(so.TotalDue) as VarChar(15)) + 'M) );'
From Sales.Store s
Inner Join Sales.SalesOrderHeader so on s.CustomerID = so.CustomerID
Group by s.CustomerID, s.Name
Order by Sum(so.TotalDue) DESC, s.Name
*/
List<BO.Store> stores = new List<BO.Store>(20);
stores.Add(new BO.Store(678, "Vigorous Exercise Company", 1179857.4657M));
stores.Add(new BO.Store(697, "Brakes and Gears", 1179475.8399M));
stores.Add(new BO.Store(170, "Excellent Riding Supplies", 1134747.4413M));
stores.Add(new BO.Store(328, "Totes & Baskets Company", 1084439.0265M));
stores.Add(new BO.Store(514, "Retail Mall", 1074154.3035M));
stores.Add(new BO.Store(155, "Corner Bicycle Supply", 1045197.0498M));
stores.Add(new BO.Store(72, "Outdoor Equipment Store (simulated: no models)", 1005539.7181M));
stores.Add(new BO.Store(227, "Health Spa. Limited", 984324.0473M));
stores.Add(new BO.Store(433, "Thorough Parts and Repair Services", 983871.933M));
stores.Add(new BO.Store(166, "Fitness Toy Store", 979881.3491M));
stores.Add(new BO.Store(146, "Latest Sports Equipment", 964134.7777M));
stores.Add(new BO.Store(670, "First Bike Store", 946105.7121M));
stores.Add(new BO.Store(506, "Great Bikes ", 937466.3027M));
stores.Add(new BO.Store(167, "Farthermost Bike Shop", 921582.9669M));
stores.Add(new BO.Store(546, "Field Trip Store", 903275.9454M));
stores.Add(new BO.Store(638, "Metropolitan Equipment", 864228.6038M));
stores.Add(new BO.Store(24, "Eastside Department Store", 863292.7317M));
stores.Add(new BO.Store(608, "Golf and Cycle Store", 839546.8838M));
stores.Add(new BO.Store(309, "The Gear Store", 821777.7287M));
stores.Add(new BO.Store(436, "Sheet Metal Manufacturing", 819823.3681M));
return new ReadOnlyCollection<ExpandPanelGridView.BO.Store>(stores);
}
}
}
|
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.
Born and lives in São Paulo - Brasil.
Programmer since 1982, and in 'tailor' mode since 1995, I had the oportunity to work for many kinds of business.
Today I create Windows Forms applications, Web projects and Palm OS applications.
My experience :
Languages : Cobol, Fortran, Basic, Clipper, Turbo Pascal, Data Flex, C, C++, Turbo C++, Borland C++ Builder, C#, Javascript.
DBMS : Adabas, DBF, Paradox, MS Access, DB2, Oracle, MS SQL Server.
I Know and experienced a little : Natural, Prolog, Lisp, Assembly IBM/370, Assembly Z80, Assembly 8080, MS Visual Basic (5/6).