protected void Page_Load(object sender, EventArgs e)
		{
			this.libros = new Bussiness.ControlLibros();

			if (!IsPostBack)
			{
				this.addArea.DataSource = libros.MostrarAreas();
				this.addArea.DataBind();
			}
			else
			{
				a = libros.CodigoArea(this.addArea.SelectedItem.ToString());
			}
			
			
		}
Esempio n. 2
0
        public void Actualizar(object sender, EventArgs e)
        {
            if (IsValid)
            {
                String codig = this.actCodigo.Text;
                String nom   = this.actNombre.Text;
                int    pag   = Convert.ToInt32(this.actNumPag.Text);
                String autr  = this.actAutor.Text;
                String edit  = this.actEditorial.Text;
                String are   = libros.CodigoArea(this.actArea.SelectedItem.ToString());

                if (libros.Actualizar(new Entities.Libro(codig, nom, pag, autr, edit, are), cod))
                {
                    Response.Redirect("LibrosLista.aspx");
                }
                else
                {
                    msgAddLibro.Visible  = true;
                    msgAddLibro.CssClass = "alert alert-danger";
                    msgAddLibro.Text     = "Error";
                }
            }
        }