public override void Siguiente() { eTIPO_NEGOCIO o = new eTIPO_NEGOCIO(); o.TNE_codigo = this.txtCodigo.Text.Trim(); cargarDatos(balTIPO_NEGOCIO.anteriorRegistro(o)); }
private void btnGoTipoNegocio_Click(object sender, EventArgs e) { eTIPO_NEGOCIO o = new eTIPO_NEGOCIO(); o.TNE_codigo = this.cmbTipoNegocio.SelectedValue != null?this.cmbTipoNegocio.SelectedValue.ToString() : ""; frmDM_TipoNegocio o2 = new frmDM_TipoNegocio(o); o2.MdiParent = this.MdiParent; o2.Show(); }
public bool eliminarRegistro(eTIPO_NEGOCIO oeTIPO_NEGOCIO) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_TIPO_NEGOCIO_eliminarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@TNE_CODIGO", oeTIPO_NEGOCIO.TNE_codigo)); return(cmd.ExecuteNonQuery() > 0); } }
public DataTable obtenerRegistro(eTIPO_NEGOCIO oeTIPO_NEGOCIO) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_TIPO_NEGOCIO_obtenerRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter dad = new SqlDataAdapter(cmd); dad.SelectCommand.Parameters.Add(new SqlParameter("@TNE_CODIGO", oeTIPO_NEGOCIO.TNE_codigo)); DataTable dt = new DataTable(); dad.Fill(dt); return(dt); } }
public override void Buscar() { eTIPO_NEGOCIO o = new eTIPO_NEGOCIO(); balTIPO_NEGOCIO b = new balTIPO_NEGOCIO(); _frmBusqueda ventana = new _frmBusqueda(true, "buscarRegistro", b); DialogResult respuesta = ventana.ShowDialog(); if (respuesta == DialogResult.OK) { o.TNE_codigo = ventana.pk; DataTable dt = balTIPO_NEGOCIO.obtenerRegistro(o); cargarDatos(dt); this.txtCodigo.ReadOnly = true; } }
public override bool Guardar() { bool rpta = false; try { eTIPO_NEGOCIO o = new eTIPO_NEGOCIO(); o.TNE_codigo = this.txtCodigo.Text.Trim(); o.TNE_nombre = this.txtNombre.Text.Trim(); if (balTIPO_NEGOCIO.insertarRegistro(o)) { mensaje("guardar", ""); //MessageBox.Show("El registro fue guardado correctamente.", "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtCodigo.ReadOnly = true; rpta = true; } } catch (CustomException ex) { if (ex.tupla != null) { foreach (Control c in this.gpbInformacion.Controls) { foreach (var item in ex.tupla) { if (c.Tag != null && c.Tag.ToString() == item.name) { errValidacion.SetError(c, item.message.ToString()); } } } mensaje("subsanar", ""); } else { mensaje("corregir", ex.Message); } } catch (Exception ex) { MessageBox.Show("Ocurrió un error inesperado:\r\n" + ex.Message, "SICO", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(rpta); }
public frmDM_TipoNegocio(eTIPO_NEGOCIO o) { InitializeComponent(); tabla = "TIPO_NEGOCIO"; this._o = o; }