protected void btn_aceptar_Click(object sender, EventArgs e)
    {
        // Obtenemos los valores
        string  numero_cuenta   = this.txt_codigo_cuenta.Text.Trim();
        string  nombre_completo = this.txt_nombre_completo.Text.Trim();
        string  pin             = this.txt_pin.Text.Trim();
        decimal saldo           = Decimal.Parse(this.txt_saldo_inicial.Text.Trim());

        BancoWebService.BancoWebServiceSoapClient banco = new BancoWebService.BancoWebServiceSoapClient();

        bool estado = banco.Registrar(numero_cuenta, nombre_completo, pin, saldo);

        if (estado)
        {
            Session["numero_cuenta"] = numero_cuenta;
            Response.Redirect("/Depositar.aspx");
        }
        else
        {
            Response.Write("<div class='alert alert-warning alert-dismissible fade show' role='alert'>"
                           + "<strong> Error </strong> No se ha podido registrar."
                           + "<button type='button' class='close' data-dismiss='alert' aria-label='Close'>"
                           + "<span aria-hidden='true'>&times;</span></button></div>");
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["numero_cuenta"] != null)
     {
         BancoWebService.BancoWebServiceSoapClient banco = new BancoWebService.BancoWebServiceSoapClient();
         num_cuenta = Session["numero_cuenta"].ToString();
         var cuenta = banco.IniciarSecion(num_cuenta);
         lbl_monto.Text = "Saldo actual: " + cuenta.saldo + "$";
     }
 }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["numero_cuenta"] != null)
        {
            BancoWebService.BancoWebServiceSoapClient banco = new BancoWebService.BancoWebServiceSoapClient();
            var cuenta = banco.IniciarSecion(Session["numero_cuenta"].ToString());

            this.txt_codigo_cuenta.Text   = cuenta.numero_cuenta;
            this.txt_nombre_completo.Text = cuenta.nombre_propietario;
            this.txt_pin.Text             = cuenta.pin;
            this.txt_saldo_inicial.Text   = Double.Parse(cuenta.saldo.ToString()).ToString();
        }
    }
    protected void btn_aceptar_Click(object sender, EventArgs e)
    {
        decimal monto = Decimal.Parse(txt_monto.Text.Trim());

        BancoWebService.BancoWebServiceSoapClient banco = new BancoWebService.BancoWebServiceSoapClient();

        if (!banco.Depositar(num_cuenta, monto))
        {
            Response.Write("<div class='alert alert-warning alert-dismissible fade show' role='alert'>"
                           + "<strong> Error: </strong> No se ha podido realizar la transaccion."
                           + "<button type='button' class='close' data-dismiss='alert' aria-label='Close'>"
                           + "<span aria-hidden='true'>&times;</span></button></div>");
        }
    }