Ejemplo n.º 1
0
        protected void btnIngresarContenedor_Click(object sender, EventArgs e)
        {
            ContenedorInteligente contenedor = new ContenedorInteligente();
            long   idContenedor    = Int64.Parse(txtIdContenedor.Text);
            string nombreClave     = txtNombreClave.Text;
            double capacidadTotal  = (double)Convert.ToDecimal(txtCapacidadTotal.Text);
            double capacidadActual = (double)Convert.ToDecimal(ddlCapacidadActual.Text);

            capacidadActual = (capacidadActual * capacidadTotal);

            contenedor.IdContenedor    = idContenedor;
            contenedor.NombreClave     = nombreClave;
            contenedor.CapacidadActual = capacidadActual;
            contenedor.CapacidadTotal  = capacidadTotal;

            ContenedorDAL contenedores = new StaticContenedorDAL();

            contenedores.agregarContenedores(contenedor);

            Response.Redirect("MostrarContenedores.aspx");
        }
 public void agregarContenedores(ContenedorInteligente contenedor)
 {
     contenedores.Add(contenedor);
 }