Exemple #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Verificaciones();

            if (bresultado == true)
            {
                btnAdd.Enabled = true;
                btnRes.Enabled = true;

                int nResultado = -1;
                objTarjeta.Sumar(int.Parse(txtSaldo.Text));
                nResultado = objCapsulaTarjeta.SumRes("Sumar", objTarjeta);
                if (nResultado != -1)
                {
                    MessageBox.Show("La Suma fue hecha con éxito", "AVISO", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("Se produjo un error al intentar Sumar saldo a la tarjeta", "ATENCION", MessageBoxButtons.OK);
                }
            }
            else
            {
                MessageBox.Show("La tarjeta no coincide con el DNI", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        //private void BtnModificar_Click(object sender, EventArgs e)
        //{
        //    int nResultado = -1;
        //    TxtBox_a_Obj();
        //    nResultado = objCapsulaTarjeta.abmTarjetas("Modificar", objTarjeta);
        //    if (nResultado != -1)
        //    {
        //        MessageBox.Show("Aviso", "La Tarjeta fue Modificada con éxito");
        //        Limpiar();
        //        LlenarDGV();
        //        txtNro.Enabled = true;
        //        txtSaldo.Enabled = true;


        //    }
        //    else
        //        MessageBox.Show("Error", "Se produjo un error al intentar modificar la tarjeta");
        //}

        private void BtnAgregar_Click(object sender, EventArgs e)
        {
            int nResultado = -1;

            objTarjeta.Sumar(int.Parse(txtAddRes.Text));
            nResultado = objCapsulaTarjeta.SumRes("Sumar", objTarjeta);
            if (nResultado != -1)
            {
                MessageBox.Show("Aviso", "La Suma fue hecha con éxito");
                Limpiar();
                LlenarDGV();
                txtNro.Enabled   = true;
                txtSaldo.Enabled = true;
            }
            else
            {
                MessageBox.Show("Error", "Se produjo un error al intentar Sumar saldo a la tarjeta");
            }
        }