public List <populationAge> Map_AgeTile(List <List <string> > tableDetails) { List <populationAge> objList = new List <populationAge>(); foreach (var item in tableDetails) { populationAge obj = new populationAge { age = item[0].ToString(), spend = item[1].ToString().Replace(",", "").Replace("K", "").Replace("$", "").Trim(), members = item[2].ToString().Replace(",", "").Trim() }; objList.Add(obj); } return(objList); }
//database part public List <populationAge> Expected_Population_Age(string customStartDate, string customEndDate) { List <populationAge> objList = new List <populationAge>(); var dt = _executor.GetDataTable(_populationSqlScripts.ExpectedAgeDetails(customStartDate, customEndDate)); for (int i = 0; i < dt.Rows.Count; i++) { populationAge obj = new populationAge { age = dt.Rows[i]["age_band"].ToString(), spend = dt.Rows[i]["p1_total_paid"].ToString().ToUpper(), members = dt.Rows[i]["p1_member_count"].ToString() }; objList.Add(obj); } return(objList); }