public void populate() { CrimeDataBase crimeDB = new CrimeDataBase(); list_crimes = crimeDB.Select_All(); CrimeGridView.DataSource = list_crimes; }
private void deleteBtn_Click(object sender, EventArgs e) { c = new Crime(); c.crimeID = Convert.ToInt32(CrimeGridView.CurrentRow.Cells[0].Value.ToString()); CrimeDataBase crimeDB = new CrimeDataBase(); crimeDB.delete(c); populate(); }
private void saveBtn_Click(object sender, EventArgs e) { CrimeDataBase crimeDB = new CrimeDataBase(); c = new Crime(); c.crimeType = crimeTxt.Text; c.crimeDate = crimeDateTxt.Text; c.location = locationTxt.Text; c.noOfPeopleArrest = Convert.ToInt32(arrestTxt.Text); crimeDB.insert(c); populate(); }
private void updateBtn_Click(object sender, EventArgs e) { CrimeDataBase crimeDB = new CrimeDataBase(); c = new Crime(); c.crimeID = Convert.ToInt32(CrimeGridView.CurrentRow.Cells[0].Value.ToString()); c.crimeType = crimeTxt.Text; c.crimeDate = crimeDateTxt.Text; c.location = locationTxt.Text; c.noOfPeopleArrest = Convert.ToInt32(arrestTxt.Text); crimeDB.update(c); populate(); }