public DataTable Get() { DataTable dt = new DataTable(); dt.Columns.Add("eventID"); dt.Columns.Add("name"); dt.Columns.Add("type"); dt.Columns.Add("description"); dt.Columns.Add("image"); dt.Columns.Add("website"); dt.Columns.Add("date"); foreach (WinnipegEvent w in _WinnipegEventMain) { DataRow dr = dt.NewRow(); dr["eventID"] = w.eventID; dr["name"] = w.name; dr["type"] = w.type; dr["description"] = w.description; dr["image"] = w.image; dr["website"] = w.website; dr["date"] = w.date; switch (w.GetType().Name) { case "Fest": Fest f = (Fest)(w); break; case "Play": Play p = (Play)(w); break; case "Exhibition": Exhibition ex = (Exhibition)(w); break; } dt.Rows.Add(dr); } return(dt); }
public void Add(Exhibition exhib) { _WinnipegEventMain.Add(exhib); Save(); }