Create ASP.NET Web Application project in Visual Studio. First of all, we will create a DTO class to hold some data that we can display in a gridview
. For this demo, I have created a DTO class of outstanding orders that contains some properties and some dummy data.
[Serializable]
public class Outstanding
{
public string Item { get; set; }
public string Order { get; set; }
public int Line { get; set; }
public int Status { get; set; }
public string ToLocation { get; set; }
public decimal Qty { get; set; }
public DateTime RegDate { get; set; }
public string Location { get; set; }
public decimal AllocQty { get; set; }
public List<Outstanding> GetOutstanding()
{
List<Outstanding> lstOrders = new List<Outstanding>();
lstOrders.Add(new Outstanding() { Item = "CocaCola",
Order = "000101", Line = 1, Status = 20,
ToLocation = "Sydney",
Qty = 2000, RegDate = new DateTime(2014, 1, 1),
Location = "USA", AllocQty = 100 });
lstOrders.Add(new Outstanding() { Item = "BubbleGum",
Order = "000101", Line = 1, Status = 20,
ToLocation = "Sydney",
Qty = 2500, RegDate = new DateTime(2014, 1, 11),
Location = "USA", AllocQty = 300 });
lstOrders.Add(new Outstanding() { Item = "Coffee",
Order = "000111", Line = 1, Status = 50,
ToLocation = "Melbourne",
Qty = 2500, RegDate = new DateTime(2014, 1, 10),
Location = "USA", AllocQty = 100 });
lstOrders.Add(new Outstanding() { Item = "Sugar",
Order = "000112", Line = 1, Status = 50,
ToLocation = "Melbourne",
Qty = 2300, RegDate = new DateTime(2014, 1, 10),
Location = "NZ", AllocQty = 300 });
lstOrders.Add(new Outstanding() { Item = "Milk",
Order = "000112", Line = 1, Status = 50,
ToLocation = "Melbourne",
Qty = 2300, RegDate = new DateTime(2014, 1, 10),
Location = "NZ", AllocQty = 200 });
lstOrders.Add(new Outstanding() { Item = "Green Tea",
Order = "000112", Line = 1, Status = 20,
ToLocation = "Melbourne",
Qty = 300, RegDate = new DateTime(2014, 1, 10),
Location = "NZ", AllocQty = 220 });
lstOrders.Add(new Outstanding() { Item = "Biscuit",
Order = "000131", Line = 1, Status = 70,
ToLocation = "Perth",
Qty = 200, RegDate = new DateTime(2014, 1, 12),
Location = "IND", AllocQty = 10 });
lstOrders.Add(new Outstanding() { Item = "Wrap",
Order = "000131", Line = 1, Status = 20,
ToLocation = "Perth",
Qty = 2100, RegDate = new DateTime(2014, 1, 12),
Location = "IND", AllocQty = 110 });
return lstOrders;
}
}