private void btnagregar_Click(object sender, EventArgs e) { frmcursosingle frm = new frmcursosingle(new CursoDTO(), "A"); frm.ShowDialog(); LoadForm(); var habilitar = DGVGrilla.Rows.Count; if (habilitar != 0) { btnmodificar.Enabled = true; btneliminar.Enabled = true; } }
private void btnmodificar_Click(object sender, EventArgs e) { Int32 id = Convert.ToInt32(DGVGrilla[0, DGVGrilla.CurrentRow.Index].Value); CursoDTO getcurso = Myproxy().Get(id, ""); frmcursosingle frm = new frmcursosingle(getcurso, "M"); frm.ShowDialog(); LoadForm(); var habilitar = DGVGrilla.Rows.Count; if (habilitar != 0) { btnmodificar.Enabled = true; btneliminar.Enabled = true; } }
private void btneliminar_Click(object sender, EventArgs e) { if (MessageBox.Show("Estas seguro de eliminar este registro ?", "Eliminar registro", MessageBoxButtons.YesNo) == DialogResult.Yes) { Int32 id = Convert.ToInt32(DGVGrilla[0, DGVGrilla.CurrentRow.Index].Value); CursoDTO getcurso = Myproxy().Get(id, ""); frmcursosingle frm = new frmcursosingle(getcurso, "D"); frm.ShowDialog(); LoadForm(); var habilitar = DGVGrilla.Rows.Count; if (habilitar == 0) { btnmodificar.Enabled = false; btneliminar.Enabled = false; } } }