public void AddContestantToDB() { var addPerson = new AddPersonView("contestant"); if (addPerson.ShowDialog() == DialogResult.OK) { Database db = new Database(); foreach (var p in addPerson.PersonList) { try { p.ID = (int)db.StorePerson(p); } catch (Exception e) { MessageBox.Show("asd"); Console.WriteLine(e.Message.ToString()); } GlobalContestantList.Add((Contestant)p); } UpdateListViews(); } }
public void AddJudgeToDB() { var addPerson = new AddPersonView("judge"); if (addPerson.ShowDialog() == DialogResult.OK) { Database db = new Database(); foreach (var p in addPerson.PersonList) { //try //{ // db.StorePerson(p); //} //catch (Exception e) //{ // Console.WriteLine(e.Message.ToString()); //} GlobalJudgeList.Add((Judge)p); } UpdateListViews(); } }