コード例 #1
0
    protected void btnGuardarAgregarDetalle_Click(object sender, EventArgs e)
    {
        try
        {
            CNCorreccion ObjCN = new CNCorreccion();
            CEDetalle    Obj   = new CEDetalle();
            Obj.Motivo            = txtMotivo.Text;
            Obj.Archivo           = txtNombreArchivo.Text;
            Obj.Tipo              = ddlTipoDetalle.SelectedValue;
            Obj.CodigoCorrelativo = Convert.ToInt32(lblCodigoCorrelativoDetalle.Text);
            Obj.Codigo            = Convert.ToInt32(lblCodigoDetalle.Text);

            if (lblCodigoDetalle.Text == "0")
            {
                ObjCN.InsertarDetalleCorreccion(Obj, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString());
            }
            else
            {
                ObjCN.ActualizarDetalleCorrelativoCorreccion(Obj, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString());
            }
            lblCodigoDetalle.Text = "0";
            Detalle();
            LimpiarRegistrarDetalle();
            mpeDetalle.Show();
        }
        catch (Exception ex)
        {
            ucMsje.RegistrarMensajeCliente("dvMsjeError", Funciones.m_strImagenError, ex.Message + "<br />" + ex.StackTrace);
        }
        finally
        {
        }
    }
コード例 #2
0
    protected void btnEliminarDetalle_Click(object sender, EventArgs e)
    {
        try
        {
            int          codigo;
            CNCorreccion ObjCN = new CNCorreccion();
            CEDetalle    ObjCE = new CEDetalle();
            ObjCE.Codigo   = Convert.ToInt32(lblCodigoDetalleEliminar.Text);
            ObjCE.Vigencia = false;

            codigo = ObjCN.EliminarDetalleCorrelativoCorreccion(ObjCE, ConfigurationManager.ConnectionStrings["SIEMPRESOFT"].ConnectionString.ToString());
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "Msje", "alert('Se ha desestimado el correlativo satisfactoriamente.');", true);
            Detalle();
            mpeDetalle.Show();
        }
        catch (Exception ex)
        {
            ucMsje.RegistrarMensajeCliente("dvMsjeError", Funciones.m_strImagenError, ex.Message + "<br />" + ex.StackTrace);
        }
        finally
        {
        }
    }