示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Categoria categoria = new Categoria("Periferico");
            int       result    = AdminCategoria.Crear(categoria);

            if (result > 0)
            {
                MessageBox.Show("OK");
                ShowAllCategories();
            }
            else
            {
                MessageBox.Show("Fallo");
            }
        }
示例#2
0
        protected void btnInsertarCategoria_Click(object sender, EventArgs e)
        {
            Categoria categoria = new Categoria(TextBox1.Text);
            int       idCreado  = AdminCategoria.Crear(categoria);


            if (idCreado > 0)
            {
                lblCheck.Text = "Insertado Ok";
                TraerTodasLasCategorias();
                ComboCategoria.Items.Add(Convert.ToString(idCreado));
            }
            else
            {
                lblCheck.Text = "Fallo Insert";
            }
        }