Exemple #1
0
 public void Actualizar_Datos(E_Parametro obj)
 {
     cn.Close();
     da.UpdateCommand             = new SqlCommand("SP_PARAMETROS", cn);
     da.UpdateCommand.CommandType = CommandType.StoredProcedure;
     da.UpdateCommand.Parameters.AddWithValue("@ACCION", "U");
     da.UpdateCommand.Parameters.AddWithValue("@CAPACIDAD_PAGO_ACTUAL", obj._CAPACIDAD_PAGO_ACTUAL);
     da.UpdateCommand.Parameters.AddWithValue("@CAPACIDAD_PAGO_PUNTOS", obj._CAPACIDAD_PAGO_PUNTOS);
     da.UpdateCommand.Parameters.AddWithValue("@REFERENCIA_BUENA", obj._REFERENCIA_BUENA);
     da.UpdateCommand.Parameters.AddWithValue("@REFERENCIA_REGULAR", obj._REFERENCIA_REGULAR);
     da.UpdateCommand.Parameters.AddWithValue("@REFERENCIA_MALA", obj._REFERENCIA_MALA);
     da.UpdateCommand.Parameters.AddWithValue("@PUNTOS_PARA_CALIFICAR", obj._PUNTOS_PARA_CALIFICAR);
     da.UpdateCommand.Parameters.AddWithValue("@PORCIENTO_AFP", obj._PORCIENTO_AFP);
     da.UpdateCommand.Parameters.AddWithValue("@PORCIENTO_SFS", obj._PORCIENTO_SFS);
     da.UpdateCommand.Parameters.AddWithValue("@MONTO_ISR", obj._MONTO_ISR);
     da.UpdateCommand.Parameters.AddWithValue("@PORCIENTO_ISR", obj._PORCIENTO_ISR);
     cn.Open();
     da.UpdateCommand.ExecuteNonQuery();
     cn.Close();
 }
Exemple #2
0
        private void btn_guardar_Click(object sender, EventArgs e)
        {
            if (txt_capacidad_menor_a.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_capacidad_menor_a, "El Formato del valor de Capacidad de Pago Actual es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_capacidad_puntos.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_capacidad_puntos, "El Formato de Puntos de Capacidad de Pago Actual es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_monto_isr.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_monto_isr, "El Formato del Monto de ISR es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_porciento_afp.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_porciento_afp, "El Formato del Porciento de AFP es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_porciento_isr.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_porciento_isr, "El Formato del Porciento de ISR es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_porciento_sfs.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_porciento_sfs, "El Formato del Porciento de SFS es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_puntos_para_calificar.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_puntos_para_calificar, "El Formato de Puntos Para Calificar es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_referencia_buena.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_referencia_buena, "El Formato de Punto de Referencia Buena es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_referencia_mala.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_referencia_mala, "El Formato de Punto de Referencia Mala es Incorrecto") == false)
                {
                    return;
                }
            }

            if (txt_referencia_regular.Text.Length != 0)
            {
                if (Funciones.Utilitario.Validar_Decimal(txt_referencia_regular, "El Formato de Punto de Referencia Regular es Incorrecto") == false)
                {
                    return;
                }
            }

            E_Parametro campo   = new E_Parametro();
            string      Mensaje = "";

            campo._CAPACIDAD_PAGO_ACTUAL = Convert.ToDouble(txt_capacidad_menor_a.Text);
            campo._CAPACIDAD_PAGO_PUNTOS = Convert.ToDouble(txt_capacidad_puntos.Text);
            campo._REFERENCIA_BUENA      = Convert.ToDouble(txt_referencia_buena.Text);
            campo._REFERENCIA_REGULAR    = Convert.ToDouble(txt_referencia_regular.Text);
            campo._REFERENCIA_MALA       = Convert.ToDouble(txt_referencia_mala.Text);
            campo._PUNTOS_PARA_CALIFICAR = Convert.ToDouble(txt_puntos_para_calificar.Text);
            campo._PORCIENTO_AFP         = Convert.ToDouble(txt_porciento_afp.Text);
            campo._PORCIENTO_SFS         = Convert.ToDouble(txt_porciento_sfs.Text);
            campo._PORCIENTO_ISR         = Convert.ToDouble(txt_porciento_isr.Text);
            campo._MONTO_ISR             = Convert.ToDouble(txt_monto_isr.Text);
            campo._PORCIENTO_ISR         = Convert.ToDouble(txt_porciento_isr.Text);

            try
            {
                N_Parametro.Actualizar_Datos(campo);
                Mensaje = "Datos Actualizados Con Exito";

                Funciones.Utilitario.Mensaje_Informacion(Mensaje);
                Consultar();
            }

            catch (Exception ex)
            {
                Funciones.Utilitario.Mensaje_Error(ex.Message);
            }
        }