public override void Siguiente()
        {
            eTIPO_VENTA o = new eTIPO_VENTA();

            o.TVE_codigo = this.txtCodigo.Text.Trim();
            cargarDatos(balTIPO_VENTA.siguienteRegistro(o));
        }
        public override void Anterior()
        {
            eTIPO_VENTA o = new eTIPO_VENTA();

            o.TVE_codigo = this.txtCodigo.Text.Trim();
            cargarDatos(balTIPO_VENTA.anteriorRegistro(o));
        }
Exemple #3
0
        private void btnGoTipoVenta_Click(object sender, EventArgs e)
        {
            eTIPO_VENTA o = new eTIPO_VENTA();

            o.TVE_codigo = this.cmbTipoVenta.SelectedValue != null?this.cmbTipoVenta.SelectedValue.ToString() : "";

            frmDM_TipoVenta o2 = new frmDM_TipoVenta(o);

            o2.MdiParent = this.MdiParent;
            o2.Show();
        }
        public override void Buscar()
        {
            eTIPO_VENTA   o         = new eTIPO_VENTA();
            balTIPO_VENTA b         = new balTIPO_VENTA();
            _frmBusqueda  ventana   = new _frmBusqueda(false, "buscarRegistro", b);
            DialogResult  respuesta = ventana.ShowDialog();

            if (respuesta == DialogResult.OK)
            {
                o.TVE_codigo = ventana.pk;
                DataTable dt = balTIPO_VENTA.obtenerRegistro(o);
                cargarDatos(dt);
            }
        }
Exemple #5
0
        public bool eliminarRegistro(eTIPO_VENTA oeTIPO_VENTA)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_TIPO_VENTA_eliminarRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@TVE_CODIGO", oeTIPO_VENTA.TVE_codigo));

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
Exemple #6
0
        public bool actualizarRegistro(eTIPO_VENTA oeTIPO_VENTA)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_TIPO_VENTA_actualizarRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                cnn.Open();

                cmd.Parameters.Add(new SqlParameter("@TVE_CODIGO", oeTIPO_VENTA.TVE_codigo));                 //variable tipo:string
                cmd.Parameters.Add(new SqlParameter("@TVE_DESCRIPCION", oeTIPO_VENTA.TVE_descripcion));       //variable tipo:string

                return(cmd.ExecuteNonQuery() > 0);
            }
        }
Exemple #7
0
        public DataTable obtenerRegistro(eTIPO_VENTA oeTIPO_VENTA)
        {
            using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["CadenaPrincipal"].ToString()))
            {
                string     sp  = "pa_crud_TIPO_VENTA_obtenerRegistro";
                SqlCommand cmd = new SqlCommand(sp, cnn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter dad = new SqlDataAdapter(cmd);
                dad.SelectCommand.Parameters.Add(new SqlParameter("@TVE_CODIGO", oeTIPO_VENTA.TVE_codigo));

                DataTable dt = new DataTable();
                dad.Fill(dt);

                return(dt);
            }
        }
        public override bool Actualizar()
        {
            bool rpta = false;

            try
            {
                eTIPO_VENTA o = new eTIPO_VENTA();
                o.TVE_codigo      = this.txtCodigo.Text.Trim();
                o.TVE_descripcion = this.txtDescripcion.Text.Trim();

                if (balTIPO_VENTA.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 frmDM_TipoVenta(eTIPO_VENTA o)
 {
     InitializeComponent();
     tabla   = "TIPO_VENTA";
     this._o = o;
 }