|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// This will control the opertaion when user selects OrderDetail from the menu
/// </summary>
public class BIOrderMaster : Base
{
private DAccessOrder Orders = new DAccessOrder();
private DataSet dsParent = new DataSet();
public BIOrderMaster()
{
dsParent = Orders.getOrders();
}
public override void BindParentGrid(DataDigest.WebControls.GridView gvParent)
{
if (dsParent == null)
{
dsParent = Orders.getOrders();
}
string[] key = new string[1];
key[0] = "OrderID";
gvParent.DataSource = null;
gvParent.Columns.Clear();
//if (dsParent.Tables["TtlCoGeneral"].Rows.Count == 0)
//{
// AddDummyData(dsParent);
//}
gvParent.DataSource = dsParent;
gvParent.DataKeyNames = key;
BoundField TtlCoNm = new BoundField();
TtlCoNm.DataField = "OrderID";
TtlCoNm.HeaderText = "Order ID";
gvParent.Columns.Add(TtlCoNm);
TtlCoNm.ItemStyle.Width = 600;
gvParent.DataBind();
}
public override void BindChildGrid(DataDigest.WebControls.GridView gvChild, string ParentId)
{
string[] key = new string[1];
key[0] = "ProductID";
DataSet dsChild = Orders.getProducts(ParentId);
gvChild.SelectedIndex = -1;
gvChild.DataSource = null;
gvChild.Columns.Clear();
//if (dsBranch.Tables["TtlCoBranch"].Rows.Count == 0)
//{
// AddDummyData(dsBranch);
//}
gvChild.DataSource = dsChild;
gvChild.DataKeyNames = key;
BoundField BrName = new BoundField();
BrName.DataField = "ProductName";
BrName.HeaderText = "Product Name";
gvChild.Columns.Add(BrName);
BrName.ItemStyle.Width = 600;
gvChild.DataBind();
}
public override DataSet getParentData()
{
return dsParent;
}
public override DataSet getChildData(string Key)
{
return Orders.getProducts(Key);
}
//private void AddDummyData(DataSet ds)
//{
// // Add a dummy row
// DataTable dt = ds.Tables[0];
// DataRow newRow = dt.NewRow();
// dt.Rows.Add(newRow);
//}
}
|
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.
I have graduated from SirSyed university of engineering and technology in year 2005. Working on Microsoft Platform for 3 years.
I like to work on new technologies. Always keen to learn new orientation in software design. Design patterns is the area for which i am looking to work on.