private void btnnuevoAlumno_Click( object sender, EventArgs e ) { frm_Registers regAlum = new frm_Registers( this._data ); this._openMain = false; regAlum.Show(); this.Close(); }
private void dgvSearch_CellDoubleClick( object sender, DataGridViewCellEventArgs e ) { frm_Registers regAlum = new frm_Registers( this._data ); regAlum.CodigoAlumno = Convert.ToInt32( this.dgvSearch.Rows[e.RowIndex].Cells[0].Value ); regAlum.keyAlumno = this.dgvSearch.CurrentRow.Cells[1].Value.ToString(); regAlum.ToActualize = true; this._openMain = false; regAlum.Show(); this.Close(); }
private void dgvSearch_KeyDown( object sender, KeyEventArgs e ) { if ( e.KeyData == Keys.Delete ) { int idAlumno = Convert.ToInt32( dgvListado.CurrentRow.Cells[0].Value ); string nombreAlumno = dgvListado.CurrentRow.Cells[2].Value.ToString(); DialogResult question = MetroMessageBox.Show( this, "Realmente deseas eliminar Al Alumno: " + nombreAlumno + "?", "Advertencia!", MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if ( question == DialogResult.Yes ) { if ( alumnos.DeleteStudent( idAlumno ) ) this.dgvListado.Rows.Remove( this.dgvListado.CurrentRow ); } } else if ( e.KeyData == Keys.Enter ) { frm_Registers regAlum = new frm_Registers( this._data ); regAlum.CodigoAlumno = Convert.ToInt32( this.dgvListado.CurrentRow.Cells[0].Value ); regAlum.ToActualize = true; this._openMain = false; regAlum.Show(); this.Close(); } }