Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Entidades.EntidadesCategoria categoria = new Entidades.EntidadesCategoria()
            {
                Id = Convert.ToInt32(Request.QueryString["id"]),
            };

            categoriaNegocio.BorrarCategoria(categoria);
            Response.Redirect("~/Categoria/VerCategorias/VerCategorias.aspx");
        }
Пример #2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            Entidades.EntidadesCategoria categoria = new Entidades.EntidadesCategoria()
            {
                Nombre = txtNombre.Text
            };


            categoriaNegocio.InsertarCategoria(categoria);
            Response.Redirect("~/Categoria/VerCategorias/VerCategorias.aspx");
        }
Пример #3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            Entidades.EntidadesCategoria categoria = new Entidades.EntidadesCategoria()
            {
                Id     = Convert.ToInt32(Request.QueryString["id"]),
                Nombre = txtNombre.Text
            };

            categoriaNegocio.ActualizarCategoria(categoria);
            Response.Redirect("~/Categoria/VerCategorias/VerCategorias.aspx");
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack == false)
     {
         int id = Convert.ToInt32(Request.QueryString["id"]);
         Entidades.EntidadesCategoria categoria = categoriaNegocio.ObtenerCategoria(id);
         if (categoria == null)
         {
             Response.Redirect("~/VerCategorias/VerCategorias.aspx");
         }
         else
         {
             lblNombre.Text = categoria.Nombre;
             txtNombre.Text = categoria.Nombre;
         }
     }
 }