private void buttonEliminar_Click(object sender, EventArgs e) { try { if (this.dataGridViewCategorias.Rows.Count > 0) { DialogResult confirmacion = MessageBox.Show("¿Seguro deseas eliminar esta categoría?", "Eliminar Categoría", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (confirmacion == DialogResult.OK) { String mensaje = NACFLOCT_LOCAL.Eliminar(Convert.ToInt32(ObtenerSeleccion().Cells["ID"].Value)); if (mensaje == "Y") { Mensaje(String.Format("La Categoría {0} ha sido ELIMINADA", Convert.ToString(ObtenerSeleccion().Cells["NOMBRE"].Value))); Refrescar(); } else { MensajeError(mensaje); Refrescar(); } } } else { MensajeError("Debes seleccionar una fila para eliminar"); } } catch (Exception ex) { MensajeError(ex.Message); } }
public void Buscar() { try { this.dataGridViewCategorias.DataSource = NACFLOCT_LOCAL.Buscar(this.textBoxBuscarNombre.Text); } catch (Exception ex) { MensajeError(ex.Message); } }
public void Mostrar() { try { this.dataGridViewCategorias.DataSource = NACFLOCT_LOCAL.Mostrar(numeroPagina, registrosPorPagina); this.dataGridViewCategorias.Columns[0].Visible = false; cantidadPaginas = NACFLOCT_LOCAL.Tamaño(registrosPorPagina); this.labelPagina.Text = String.Format("Página {0} de {1}", numeroPagina, cantidadPaginas); } catch (Exception ex) { MensajeError(ex.Message); } }
private void buttonGuardar_Click(object sender, EventArgs e) { String mensaje = NACFLOCT_LOCAL.Insertar(this.textBoxNombre.Text, this.textBoxDescripcion.Text); if (mensaje == "Y") { this._owner.Mensaje(String.Format("La Categoría {0} ha sido AGREGADA", this.textBoxNombre.Text)); this._owner.Refrescar(); this.Close(); } else { MensajeError(mensaje); } }
private void buttonGuardar_Click(object sender, EventArgs e) { String mensaje = NACFLOCT_LOCAL.Editar(this.LOCID, this.textBoxNombre.Text, this.textBoxDescripcion.Text, this.textBoxsegmento.Text); if (mensaje == "Y") { this._owner.Mensaje(String.Format("El Local {0} ha sido EDITADO", this.textBoxNombre.Text)); this._owner.Refrescar(); this.Close(); } else { MensajeError(mensaje); } }