protected void Consultar()
    {
        negAlquiler negAlquiler = new negAlquiler();

        lstAlquileres.DataSource = negAlquiler.ListarAlquileres(txtMatricula.Text);
        lstAlquileres.DataBind();
        txtTotal.Text = (negAlquiler.TotalRecaudado(txtMatricula.Text)).ToString();
    }
Exemplo n.º 2
0
 protected void btnCalcular_Click(object sender, EventArgs e)
 {
     try
     {
         negAlquiler negAlquiler = new negAlquiler();
         lblError.Text = "Costo total U$S " + (negAlquiler.CalcularCostoAlquiler((cboVehiculos.SelectedValue).ToString(), Convert.ToDateTime(clnFechaInicio.Value), Convert.ToDateTime(clnFechaFin.Value))).ToString();
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }
Exemplo n.º 3
0
 protected void btnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         negCliente  negCliente  = new negCliente();
         negVehiculo negVehiculo = new negVehiculo();
         Cliente     cliente     = negCliente.Buscar(txtCedula.Text, true);
         Vehiculo    vehiculo    = negVehiculo.Buscar((cboVehiculos.SelectedValue).ToString());
         Alquiler    alquiler    = new Alquiler(cliente, vehiculo, Convert.ToDateTime(clnFechaInicio.Value), Convert.ToDateTime(clnFechaFin.Value));
         negAlquiler negAlquiler = new negAlquiler();
         negAlquiler.Agregar(alquiler);
         lblError.Text = "Se agregó el alquiler con éxito.";
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }