private void btnUpdate_Click(object sender, EventArgs e) { StudentsBL bl = new StudentsBL(); if (bl.StudentUpdate(BuildStudent())) { MessageBox.Show("Updated successfully"); } else { MessageBox.Show("Not Updated"); } }
private void btnInsert_Click(object sender, EventArgs e) { try { StudentsBL bl = new StudentsBL(); if (bl.StudentInsert(BuildStudent())) { MessageBox.Show("Inserted successfully"); } else { MessageBox.Show("Not Inserted"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSearch_Click(object sender, EventArgs e) { StudentsBL bl = new StudentsBL(); students = bl.Search(txtSearch.Text); dgvResult.DataSource = students; foreach (DataGridViewColumn c in dgvResult.Columns) { c.Visible = false; } dgvResult.Columns["Id"].Visible = true; dgvResult.Columns["Id"].Width = 68; dgvResult.Columns["LastName"].Visible = true; dgvResult.Columns["LastName"].Width = 95; dgvResult.Columns["FirstName"].Visible = true; dgvResult.Columns["FirstName"].Width = 77; dgvResult.Columns["Status"].Visible = true; dgvResult.Columns["Status"].Width = 77; dgvResult.RowHeadersVisible = false; }