예제 #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            DialogResult resultMB = MessageBox.Show("¿Está seguro que desea agregar la marca a la Base de Datos ?", "Confirmación",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);

            if (resultMB == DialogResult.Yes)
            {
                marca.AgregarMarca(addTextBox.Text);
                Dispose();
            }
        }
예제 #2
0
 protected void Agregar_Click(object sender, EventArgs e)
 {
     if (Agregar.Text == "Modificar")
     {
         marca.nombre = marcaLabel.Text;
         marcaNegocio.Modificar(marca);
     }
     else
     {
         nombreMarca = marcaLabel.Text;
         marcaNegocio.AgregarMarca(nombreMarca);
     }
     Response.Redirect("marcas.aspx");
 }
예제 #3
0
        protected void ALta_Click(object sender, EventArgs e)
        {
            MarcaNegocio negocio = new MarcaNegocio();

            try
            {
                Marca producto = new Marca();
                producto.Descripcion = TxtDescripcion.Text;
                negocio.AgregarMarca(producto);
                Response.Redirect("ListaMarca.aspx");
            }
            catch (Exception)
            {
                throw;
            }
        }