void AddToolStripMenuItem1Click(object sender, EventArgs e) { AddPeopleDialog dlg = new AddPeopleDialog(); if (dlg.ShowDialog() == DialogResult.OK) { String firstname = dlg.firstname.Text; String lastname = dlg.lastname.Text; DateTime dateofbirth = dlg.dateTimePicker1.Value; String city = dlg.city.Text; String address = dlg.address.Text; IObjectContainer db = DBConnection.Instance.DB; db.Store(new Lender(firstname, lastname, dateofbirth, city, address)); } }
void AddToolStripMenuItem1Click(object sender, EventArgs e) { AddPeopleDialog dlg = new AddPeopleDialog(); if (dlg.ShowDialog() == DialogResult.OK) { String firstname = dlg.firstname.Text; String lastname = dlg.lastname.Text; DateTime dateofbirth = dlg.dateTimePicker1.Value; String city = dlg.city.Text; String address = dlg.address.Text; IObjectContainer db = DBConnection.Instance.DB; db.Store(new Lender(firstname,lastname,dateofbirth,city,address)); } }