private void btnDodSam_Click(object sender, EventArgs e) { frmDodSamo nowy = new frmDodSamo(); nowy.dodano += Main_Load; nowy.ShowDialog(); }
private void btnESamo_Click(object sender, EventArgs e) { int Id = 0; DataTable g = dgvSamo.DataSource as DataTable; DataRow row = ((DataRowView)dgvSamo.SelectedRows[0].DataBoundItem).Row; Id = row.Field <int>("IdSam"); DataTable rr = wypSamochodTableAdapter.GetDataBy(Id); Samochod SamoEdyt = new Samochod(rr); frmDodSamo SamEdyt = new frmDodSamo(SamoEdyt); SamEdyt.dodano += Main_Load; SamEdyt.ShowDialog(); }