Esempio n. 1
0
        protected void btnDescuento_Click(object sender, EventArgs e)
        {
            Bibliotecas.Negocio.BibliotecasCollection col = new Bibliotecas.Negocio.BibliotecasCollection();
            if (col.EsNumerico(txtDescuento.Text))
            {
                if (porcentaje())
                {
                    Bibliotecas.Negocio.BibliotecasCollection bl = new Bibliotecas.Negocio.BibliotecasCollection();
                    bl.UpdateMasivoDescuento(Convert.ToInt32(txtDescuento.Text));
                    Server.Transfer("Admin.aspx");
                }
                else
                {
                    string script = @"<script type='text/javascript'>
                            alerta('Porcentaje fuera de rango 0 a 100');
                        </script>";

                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
                }
            }
            else
            {
                string script = @"<script type='text/javascript'>
                            alerta('Lo sentimos ese no es un numero entero');
                        </script>";

                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Bibliotecas.Negocio.BibliotecasCollection bl = new Bibliotecas.Negocio.BibliotecasCollection();

            LbDescuentos.Text = "Numero de descuentos realizados: " + bl.CantidadDescuentos().ToString();
            LbUsuario.Text    = " Numero de usuaruios registrados: " + bl.CantidadUsuario().ToString();
            LbVehiculo.Text   = " Numero de vehiculos registrados:" + bl.CantidadAutos().ToString();
            LbViajes.Text     = "Numero de viajes registrados: " + bl.CantidadViajes().ToString();
            LbRutas.Text      = "Numero de rutas registradas: " + bl.CantidadRutas().ToString();
        }