private void button3_Click(object sender, EventArgs e) { var existe = catManager.Existe(comboBox1.Text); var resp = MessageBox.Show("Esta seguro de Agregar esta Categoría?", "Agregar Categoria", MessageBoxButtons.YesNo); if (resp == DialogResult.Yes && comboBox1.Text != "" && existe == false) { catManager.InsertCategorias(new Categoria { Activo = true, CategoriaDesc = comboBox1.Text.ToUpper(), Pesa = false, Idcategoria = 0 }); } comboUpdates(); }
private string validarRegistro(Categoria newpart) { bool aux = catManager.Existe(newpart.CategoriaDesc); string msgValidate = ""; if (aux && (newpart.Idcategoria != currentCat.Idcategoria)) { msgValidate = msgValidate + "Categoria ya Existente.\n"; } if (newpart.CategoriaDesc == "") { msgValidate = msgValidate + "Nombre no puede ser dejado en Blanco\n"; } return(msgValidate); }