示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int cuentaLength = txt_cuenta.TextLength;
            int limiteCuenta = 10;

            /*
             * Boolean resultado = DevCom.consultarCuenta(txt_cuenta.Text);
             *
             * if (resultado)
             * {
             *  MessageBox.Show("Cuenta existe", "Error");
             * }
             */

            // Evaluar si datos requeridos estan
            if (cuentaLength < limiteCuenta)
            {
                if (txt_cuenta.Text != "" || txt_monto.Text != "" || txt_monto.Text != "")
                {
                    //DevCom.ActualizarCuenta(txt_cuenta.Text, txt_saldoAnterior.Text, txt_monto.Text);
                    DevCom.DepositarCuenta(txt_cuenta.Text, txt_monto.Text);
                }
                else
                {
                    MessageBox.Show("Cuenta excede los digitos maximos (10)", "Error");
                }
            }
            else
            {
                MessageBox.Show("Faltan datos requeridos de agregar", "Error");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // Necesito conectarme a DevCom.
            // A: Referencio DevCom aca.

            // Si el usuario y contrasenia da TRUE
            if (DevCom.claveValida(txtbox_usuario.Text, txtbox_clave.Text))
            {
                // HIDE window
                this.Hide();

                // SHOW menu
                Form miformulario = new frm_Menu();
                miformulario.Show();
            }
            else
            {
                MessageBox.Show("Clave incorrecta", "Error");
            }

            //this.Dispose();
            //this.Hide();
        }