public override void Siguiente() { eIMPUESTO o = new eIMPUESTO(); o.IMP_codigo = this.txtCodigo.Text.Trim(); cargarDatos(balIMPUESTO.siguienteRegistro(o)); }
public override void Anterior() { eIMPUESTO o = new eIMPUESTO(); o.IMP_codigo = this.txtCodigo.Text.Trim(); cargarDatos(balIMPUESTO.anteriorRegistro(o)); }
private void btnGoImpuesto_Click(object sender, EventArgs e) { eIMPUESTO o = new eIMPUESTO(); o.IMP_codigo = this.cmbImpuesto.SelectedValue != null?this.cmbImpuesto.SelectedValue.ToString() : ""; frmDM_Impuesto o2 = new frmDM_Impuesto(o); o2.MdiParent = this.MdiParent; o2.Show(); }
public bool eliminarRegistro(eIMPUESTO oeIMPUESTO) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_IMPUESTO_eliminarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeIMPUESTO.IMP_codigo)); return(cmd.ExecuteNonQuery() > 0); } }
public DataTable obtenerRegistro(eIMPUESTO oeIMPUESTO) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_IMPUESTO_obtenerRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter dad = new SqlDataAdapter(cmd); dad.SelectCommand.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeIMPUESTO.IMP_codigo)); DataTable dt = new DataTable(); dad.Fill(dt); return(dt); } }
public bool actualizarRegistro(eIMPUESTO oeIMPUESTO) { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString())) { string sp = "pa_crud_IMPUESTO_actualizarRegistro"; SqlCommand cmd = new SqlCommand(sp, cnn); cmd.CommandType = CommandType.StoredProcedure; cnn.Open(); cmd.Parameters.Add(new SqlParameter("@IMP_CODIGO", oeIMPUESTO.IMP_codigo)); //variable tipo:string cmd.Parameters.Add(new SqlParameter("@IMP_NOMBRE", oeIMPUESTO.IMP_nombre)); //variable tipo:string cmd.Parameters.Add(new SqlParameter("@IMP_NOMBRE_CORTO", oeIMPUESTO.IMP_nombre_corto)); //variable tipo:string return(cmd.ExecuteNonQuery() > 0); } }
public override bool Actualizar() { bool rpta = false; try { eIMPUESTO o = new eIMPUESTO(); o.IMP_codigo = this.txtCodigo.Text.Trim(); o.IMP_nombre = this.txtNombre.Text.Trim(); o.IMP_nombre_corto = this.txtNombreCorto.Text.Trim(); if (balIMPUESTO.actualizarRegistro(o)) { mensaje("actualizar", ""); //MessageBox.Show("El registro fue actualizado 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 override void Buscar() { eIMPUESTO o = new eIMPUESTO(); balIMPUESTO b = new balIMPUESTO(); _frmBusqueda ventana = new _frmBusqueda(true, "buscarRegistro", b); DialogResult respuesta = ventana.ShowDialog(); if (respuesta == DialogResult.OK) { o.IMP_codigo = ventana.pk; DataTable dt = balIMPUESTO.obtenerRegistro(o); cargarDatos(dt); this.txtCodigo.ReadOnly = true; } }
public frmDM_Impuesto(eIMPUESTO o) { InitializeComponent(); tabla = "IMPUESTO"; this._o = o; }