I want to display record on my html page like this.
Invoice No 1
|
Product 1
|
|
Product 2
|
|
Product 3
|
Invoice No 2
|
Product 1
|
Invoice No 3
|
Product 1
|
Invoice No 4
|
Product 1
|
|
Product 2
|
|
Product 3
|
I have this information in a list here's my code
static void Main(string[] args)
{
List<Program> listdata = new List<Program>();
listdata.Add(new Program { InvoiceNo=001, Product="Product1"});
listdata.Add(new Program { InvoiceNo = 001, Product = "Product2" });
listdata.Add(new Program { InvoiceNo = 001, Product = "Product3" });
listdata.Add(new Program { InvoiceNo = 001, Product = "Product4" });
listdata.Add(new Program { InvoiceNo = 001, Product = "Product5" });
listdata.Add(new Program { InvoiceNo = 002, Product = "Product1" });
listdata.Add(new Program { InvoiceNo = 003, Product = "Product1" });
listdata.Add(new Program { InvoiceNo = 004, Product = "Product1" });
listdata.Add(new Program { InvoiceNo = 004, Product = "Product2" });
listdata.Add(new Program { InvoiceNo = 004, Product = "Product3" });
foreach (var item in listdata)
{
Console.WriteLine(String.Format("Invoice No : {0} Product : {1}",item.InvoiceNo,item.Product));
}
Console.ReadLine();
}
Had used foreach for example purpose,have to display data on a html page in ng-repeat in angular js am not able to arrange the required list in this format as displayed above.