public IActionResult CustomersList() { DataTable data = new DataTable(); data = new GetCustomersBAL().CustomersList(); IList <Customer> list = new List <Customer>(); foreach (DataRow row in data.Rows) { list.Add(new Customer() { CustomerId = int.Parse(row["CustomerId"].ToString()), CustomerName = row["CustomerName"].ToString(), CustomerAddress = row["CustomerAddress"].ToString() }); } return(View(list)); }
public IActionResult Question4() { DataTable data = new DataTable(); data = new GetCustomersBAL().Question4(); IList <CustomerBanks> list = new List <CustomerBanks>(); foreach (DataRow row in data.Rows) { list.Add(new CustomerBanks() { CustomerId = int.Parse(row["CustomerId"].ToString()), CustomerName = row["CustomerName"].ToString(), BankName = row["BankName"].ToString(), TagId = int.Parse(row["TagId"].ToString()) }); } return(View(list)); }