protected void btnModificar_Click(object sender, EventArgs e)
        {
            msjPrincipal.Text      = "Error al agregar";
            msjPrincipal.ForeColor = System.Drawing.Color.Red;
            //int i = 0;
            double x = 0.0;
            float  j = 000000;

            if (String.IsNullOrEmpty(txtID.Text))
            {
                msjID.Text = "Este campo es obligatorio";
            }
            else if (String.IsNullOrEmpty(txtBodega.Text))
            {
                msjIDBo.Text = "Este campo es obligatorio";
            }
            else if (String.IsNullOrEmpty(txtNombre.Text))
            {
                msjNombre.Text = "Este campo es obligatorio";
            }
            else if (String.IsNullOrEmpty(txtMarca.Text))
            {
                msjMarca.Text = "Este campo es obligatorio";
            }
            else if (String.IsNullOrEmpty(txtModelo.Text))
            {
                msjModelo.Text = "Este campo es obligatorio";
            }
            else if (string.IsNullOrEmpty(txtCodigoBarra.Text))
            {
                msjCBarra.Text = "El campo debe tener un numero";
            }
            else if (string.IsNullOrEmpty(txtDescripcion.Text))
            {
                MsjDescripcion.Text = "El campo es obligatorio";
            }
            else if (!double.TryParse(txtExistencia.Text, out x))
            {
                MsjExistencia.Text = "El campo debe tener un numero";
            }
            else if (!float.TryParse(Precio.Text, out j))
            {
                MsjPrecio.Text = "El campo debe tener un numero";
            }
            else if (!float.TryParse(txtPorcIV.Text, out j))
            {
                MsjPorcIV.Text = "El campo debe tener un numero";
            }
            else
            {
                DataEntity.Producto producto = new DataEntity.Producto();
                producto.idProducto   = Convert.ToInt32(txtID.Text);
                producto.idBodega     = Convert.ToInt32(txtBodega.Text);
                producto.nombre       = txtNombre.Text;
                producto.marca        = txtMarca.Text;
                producto.modelo       = txtModelo.Text;
                producto.codigoBarra  = Convert.ToInt32(txtCodigoBarra.Text);
                producto.descripcion  = txtDescripcion.Text;
                producto.existencia   = Convert.ToInt32(txtExistencia.Text);
                producto.preciocompra = Convert.ToInt32(Precio.Text);
                producto.porcIV       = Convert.ToInt32(txtPorcIV.Text);
                producto.porcIVA      = Convert.ToInt32(txtPorcIVA.Text);
                var es = estado.Checked? "a" : "i";
                producto.estado      = es;
                producto.precioventa = Convert.ToInt32(txtPrecioVenta.Text);
                var ex = exento.Checked? "s" : "n";
                producto.excento = ex;

                if (DLProducto.Update(producto))
                {
                    Response.Redirect("AgregarProducto.aspx");
                }
            }
        }