private void Eliminarbutton_Click(object sender, EventArgs e) { if (Validar(1)) { MessageBox.Show("Ingrese un ID"); return; } int id = Convert.ToInt32(ArticuloIDnumericUpDown.Value); if (BLL.ArticulosBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); ArticuloIDnumericUpDown.Value = 0; DescripciontextBox.Clear(); CostonumericUpDown.Value = 0; PrecionumericUpDown.Value = 0; GanancianumericUpDown.Value = 0; InventariotextBox.Clear(); errorProvider.Clear(); } else { MessageBox.Show("No se pudo eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Nuevobutton_Click(object sender, EventArgs e) { ArticuloIDnumericUpDown.Value = 0; DescripciontextBox.Clear(); CostonumericUpDown.Value = 0; PrecionumericUpDown.Value = 0; GanancianumericUpDown.Value = 0; InventariotextBox.Clear(); errorProvider.Clear(); }
private void Limpiar() { IdnumericUpDown.Value = 0; DescripciontextBox.Clear(); CostonumericUpDown.Value = 0; InventariotextBox.Clear(); GananciaTextBox.Clear(); PrecionumericUpDown.Value = 0; InventariotextBox.Text = 0.ToString(); MyErrorProvider.Clear(); }
private void Limpiar() { IdnumericUpDown.Value = 0; SizetextBox.Clear(); PrecionumericUpDown.Value = 0; InventariotextBox.Clear(); DescripciontextBox.Clear(); MarcatextBox.Clear(); InventariotextBox.Text = 0.ToString(); errorProvider1.Clear(); }
private Articulos Limpiar() { Articulos vehiculo = new Articulos(); IdnumericUpDown.Value = 0; DescripciontextBox.Clear(); CostonumericUpDown.Value = 0; PrecionumericUpDown.Value = 0; GanancianumericUpDown.Value = 0; InventariotextBox.Clear(); return(vehiculo); }
private void Guardarbutton_Click(object sender, EventArgs e) { bool paso = false; Articulos articulos = LlenarClase(); if (Validar(2)) { MessageBox.Show("Llenar todos los campos marcados"); return; } errorProvider.Clear(); if (ArticuloIDnumericUpDown.Value == 0) { paso = BLL.ArticulosBLL.Guardar(articulos); } else { var A = BLL.ArticulosBLL.Buscar(Convert.ToInt32(ArticuloIDnumericUpDown.Value)); if (A != null) { paso = BLL.ArticulosBLL.Modificar(articulos); } if (paso) { MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); ArticuloIDnumericUpDown.Value = 0; DescripciontextBox.Clear(); CostonumericUpDown.Value = 0; PrecionumericUpDown.Value = 0; GanancianumericUpDown.Value = 0; InventariotextBox.Clear(); errorProvider.Clear(); } else { MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }