private void dgvSUBCLASE_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e) { if (dgvSUBCLASE.CurrentRow == null) { MessageBox.Show("Debe seleccionar una ciudad"); return; } oSUBCLASE = (MODELO.Subclase)dgvSUBCLASE.CurrentRow.DataBoundItem; this.DialogResult = DialogResult.OK; }
private void btnLUPAsubclase_Click(object sender, EventArgs e) { MATERIALES.Subclase frm = new MATERIALES.Subclase("Buscar"); DialogResult dr = frm.ShowDialog(); if (dr == DialogResult.OK) { oSUBCLASE = frm.SubClaseSelect; txtSUBCLASE.Text = oSUBCLASE.NOMBRE; //cmbPROVEEDOR.SelectedItem = oPROVEEDOR; } }
public CLASE2(MODELO.Subclase unaClase, string unaaccion) { InitializeComponent(); cClase = CONTROLADORA.cSubclase.obtener_instancia(); oClase = unaClase; accion = unaaccion; if (accion != "A") { txtNOMBRE.Text = oClase.NOMBRE; if (accion == "C") { txtNOMBRE.Enabled = false; } } }
private void btnCONSULTAR_Click(object sender, EventArgs e) { if (dgvSUBCLASE.CurrentRow == null) { MessageBox.Show("Debe seleccionar una subclase"); return; } MODELO.Subclase oClase = (MODELO.Subclase)dgvSUBCLASE.CurrentRow.DataBoundItem; MATERIALES.CLASE2 frm = new MATERIALES.CLASE2(oClase, "C"); DialogResult dr = frm.ShowDialog(); if (dr == DialogResult.OK) { ARMO_GRILLA(); } }
private void btnELIMINAR_Click(object sender, EventArgs e) { if (dgvSUBCLASE.CurrentRow == null) { MessageBox.Show("Debe seleccionar una subclase"); return; } MODELO.Subclase oClase = (MODELO.Subclase)dgvSUBCLASE.CurrentRow.DataBoundItem; DialogResult dr = MessageBox.Show("¿Confirma que desea eliminar " + oClase.NOMBRE + "?", "CONFIRMA", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { cSubclase.eliminarSubClase(oClase); ARMO_GRILLA(); } }
public void modificarSubClase(MODELO.Subclase oSubClase) { oMODELO_SEGURIDAD.Entry(oSubClase).State = System.Data.Entity.EntityState.Modified; oMODELO_SEGURIDAD.SaveChanges(); }
public void eliminarSubClase(MODELO.Subclase oSubClase) { oMODELO_SEGURIDAD.SUBCLASES.Remove(oSubClase); oMODELO_SEGURIDAD.SaveChanges(); }
public void agregarSubClase(MODELO.Subclase oSubClase) { oMODELO_SEGURIDAD.SUBCLASES.Add(oSubClase); oMODELO_SEGURIDAD.SaveChanges(); }