private void btnGrabar_Click(object sender, EventArgs e) { llenarEntidades(); if (estado.Equals("NUEVO")) { LECTORCn.InsertLECTOR(cabecera); } else { LECTORCn.UpdateLECTOR(cabecera); } String id = cabecera.ID; LECTOR_DETALLECn.DeleteLector(id); foreach (LECTOR_DETALLE dd in detalle) { LECTOR_DETALLECn.InsertLECTOR_DETALLE(dd); } LECTORCn.CrearDocumentoNisira(id); llenarDesdeBD(id); llenarVista(); estado = "VISTA"; edicion(false); }
private void btnEliminar_Click(object sender, EventArgs e) { DialogResult dr; dr = MessageBox.Show(this, "Desea eliminar el documento?", "OK", MessageBoxButtons.YesNo); if (DialogResult.Yes.Equals(dr)) { String id = cabecera.ID; LECTOR_DETALLECn.DeleteLector(id); LECTORCn.DeleteLector(id); LECTORCn.BorrarDocumentoNisira(id); } }
private void llenarDesdeBD(String id) { cabecera = LECTORCn.GetLector(id); detalle = LECTOR_DETALLECn.GetLECTOR_DETALLE(id); }