private void Guardarbutton_Click(object sender, EventArgs e) { bool paso = false; Talleres talleres = new Talleres(); if (Validar(2)) { MessageBox.Show("llenar los campo Marcados"); } GeneralErrorProvider.Clear(); if (TallerIDNumericUpDown.Value == 0) { paso = BLL.TalleresBLL.Guardar(LlenarClase()); } else { paso = BLL.TalleresBLL.Modificar(LlenarClase()); } if (paso) { MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonBuscar_Click(object sender, EventArgs e) { if (validar(1)) { MessageBox.Show("Introducir Id"); } else { int id = Convert.ToInt32(EntradaIdNumericUpDown.Value); EntradaArticulos entradaarticulo = EntradaArticulosBLL.Buscar(id); if (entradaarticulo != null) { EntradaIdNumericUpDown.Value = entradaarticulo.EntradaId; ArticulosComboBox.SelectedValue = entradaarticulo.ArticuloID; CantidadNumericUpDown.Value = entradaarticulo.Cantidad; } else { MessageBox.Show("No Fue Encontrado!", "Fallo!", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
private void LimpiarCampos() { EntradaIdNumericUpDown.Value = 0; CantidadNumericUpDown.Value = 0; GeneralErrorProvider.Clear(); }
private void LimpiarCampos() { vehiculoIdNumericUpDown.Value = 0; DescripcionTextBox.Clear(); MantenimientoTextBox.Clear(); GeneralErrorProvider.Clear(); }
private void buttonBuscar_Click(object sender, EventArgs e) { if (validar(1)) { MessageBox.Show("Introduzca Id A Buscar"); } else { int id = Convert.ToInt32(vehiculoIdNumericUpDown.Value); Vehiculos vehiculos = VehiculosBLL.Buscar(id); if (vehiculos != null) { vehiculoIdNumericUpDown.Value = vehiculos.VehiculoId; DescripcionTextBox.Text = vehiculos.Descripcion; MantenimientoTextBox.Text = vehiculos.Mantenimiento.ToString(); } else { MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
private bool Validar() { bool Validar = false; if (string.IsNullOrWhiteSpace(NombresTextBox.Text)) { GeneralErrorProvider.SetError(NombresTextBox, "Debes llenar este campo"); Validar = true; } if (string.IsNullOrWhiteSpace(NombreUsuarioTextBox.Text)) { GeneralErrorProvider.SetError(NombreUsuarioTextBox, "Debes llenar este campo"); Validar = true; } if (string.IsNullOrWhiteSpace(ClaveTextBox.Text)) { GeneralErrorProvider.SetError(ClaveTextBox, "Debes llenar este campo"); Validar = true; } if (string.IsNullOrWhiteSpace(CargosComboBox.Text)) { GeneralErrorProvider.SetError(CargosComboBox, "Debes Elegir una opcion"); Validar = true; } return(Validar); }
private void ButtonBuscar_Click(object sender, EventArgs e) { if (Validar(1)) { MessageBox.Show("Introduzca El Id A Buscar!"); } else { int id = Convert.ToInt32(ProductoIdNumericUpDown.Value); Productos producto = ProductosBLL.Buscar(id); if (producto != null) { ProductoIdNumericUpDown.Value = producto.ProductoId; DescripcionTextBox.Text = producto.Descripcion; CostoNumericUpDown.Value = producto.Costo; PrecioNumericUpDown.Value = producto.Precio; GananciaNumericUpDown.Value = producto.Ganancia; InventarioTextBox.Text = producto.Inventario.ToString(); } else { MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
private void Buscarbutton_Click(object sender, EventArgs e) { GeneralErrorProvider.Clear(); if (Validar(1)) { MessageBox.Show("Ingrese un ID"); return; } int id = Convert.ToInt32(IdnumericUpDown.Value); Articulos articulo = BLL.ArticulosBLL.Buscar(id); if (articulo != null) { DescripciontextBox.Text = articulo.Descripcion; PrecionumericUpDown.Value = articulo.Precio; VencimientodateTimePicker.Text = articulo.FechaVencimiento.ToString(); CantCotnumericUpDown.Text = articulo.CantidadCotizada.ToString(); } else { MessageBox.Show("No se encontro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private bool Validar(int validar) // VALIDAR { bool paso = false; if (validar == 1 && IdnumericUpDown.Value == 0) { GeneralErrorProvider.SetError(IdnumericUpDown, "Ingrese un ID"); paso = true; } if (validar == 2 && DescripciontextBox.Text == string.Empty) { GeneralErrorProvider.SetError(DescripciontextBox, "Ingrese una descripcion"); paso = true; } if (validar == 2 && PrecionumericUpDown.Value == 0) { GeneralErrorProvider.SetError(PrecionumericUpDown, "Ingrese un precio"); paso = true; } if (validar == 2 && CantCotnumericUpDown.Text == string.Empty) { GeneralErrorProvider.SetError(CantCotnumericUpDown, "Ingrese la cantidad cotizada"); } return(paso); }
private void Nuevobutton_Click(object sender, EventArgs e) { EntradaIDNumericUpDown.Value = 0; FechaDateTimePicker1.ResetText(); GeneralErrorProvider.Clear(); CantidadNumericUpDown2.Value = 0; }
private void Guardarbutton_Click(object sender, EventArgs e) { bool paso = false; if (Validar(2)) { MessageBox.Show("Llenar todos los campos marcados"); return; } GeneralErrorProvider.Clear(); if (IdnumericUpDown.Value == 0) { paso = BLL.ArticulosBLL.Guardar(LlenarClase()); } else { paso = BLL.ArticulosBLL.Modificar(LlenarClase()); } if (paso) { MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { //if(Validar(2)) //{ // MessageBox.Show("Ingrese el Id"); // return; //} int id = Convert.ToInt32(EntradaIDNumericUpDown.Value); //rEntradaArt rEntradaArt = rEntradaArtBLL.Buscar(id); //if(rEntradaArt != null) //{ if (BLL.rEntradaArtBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo eliminar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } //} GeneralErrorProvider.Clear(); }
private void ButtonBuscar_Click(object sender, EventArgs e) { if (Validar(1)) { MessageBox.Show("Introduzca El Id A Buscar!"); } else { int id = Convert.ToInt32(UsuarioIdNumericUpDown.Value); Usuarios usuario = UsuariosBLL.Buscar(id); if (usuario != null) { UsuarioIdNumericUpDown.Value = usuario.UsuarioId; NombresTextBox.Text = usuario.Nombre; UsuarioTextBox.Text = usuario.NombreUser; ClaveTextBox.Text = usuario.Clave; FechaDateTimePicker.Value = usuario.Fecha; TotalVendidoTextBox.Text = usuario.TotalVendido.ToString(); } else { MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); } GeneralErrorProvider.Clear(); } }
private void BuscarButton_Click(object sender, EventArgs e) { GeneralErrorProvider.Clear(); //if (Validar()) //{ // MessageBox.Show("Ingrese un ID"); // return; // int id = Convert.ToInt32(MantenimientoIdNumericUpDown.Value); Mantenimiento mantenimiento = BLL.MantenimientoBLL.Buscar(id); if (mantenimiento != null) { LlenaCampo(mantenimiento); //MantenimientoIdNumericUpDown.Value = mantenimiento.MantenimientoId; //TallerComboBox.Text = mantenimiento.Taller.ToString(); } else { MessageBox.Show("No se encontro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LimpiarCampos() { EntradaIdNumericUpDown.Value = 0; CantidadNumericUpDown.Value = 0; fechaDateTimePicker.Value = DateTime.Now; GeneralErrorProvider.Clear(); }
private bool Validar() { bool Validar = false; if (CantidadNumericUpDown2.Value == 0) { GeneralErrorProvider.SetError(CantidadNumericUpDown2, "Digite la Cantidad de entradas"); Validar = true; } return(Validar); }
private bool Validar() { bool Validar = false; if (DetalledataGridView.RowCount == 0) { GeneralErrorProvider.SetError(DetalledataGridView, "No hay datos para mostrar"); Validar = true; } return(Validar); }
private void LimpiarCampos() { ProductoIdNumericUpDown.Value = 0; DescripcionTextBox.Clear(); CostoNumericUpDown.Value = 0; PrecioNumericUpDown.Value = 0; GananciaNumericUpDown.Value = 0; InventarioTextBox.Clear(); InventarioTextBox.Text = 0.ToString(); GeneralErrorProvider.Clear(); }
private bool Validar() { bool Validar = false; if (string.IsNullOrWhiteSpace(DescripcionTextBox.Text)) { GeneralErrorProvider.SetError(DescripcionTextBox, "Debes llenar la descripcion"); Validar = true; } return(Validar); }
private bool Validar(int validar) { bool paso = false; if (validar == 2 && DescripcionTextBox.Text == string.Empty) { GeneralErrorProvider.SetError(DescripcionTextBox, "Ingrese una descripcion"); paso = true; } return(paso); }
private bool Validar(int validar) { bool Validar = false; if (string.IsNullOrWhiteSpace(NombreTextBox.Text)) { GeneralErrorProvider.SetError(NombreTextBox, "Favor Ingrese el nombre"); Validar = true; } return(Validar); }
private void LimpiarCampos() { UsuarioIdNumericUpDown.Value = 0; NombresTextBox.Clear(); UsuarioTextBox.Clear(); ClaveTextBox.Clear(); VerificarClaveTextBox.Clear(); FechaDateTimePicker.Value = DateTime.Now; TotalVendidoTextBox.Clear(); GeneralErrorProvider.Clear(); }
private void Nuevobutton_Click(object sender, EventArgs e) { MantenimientoIdNumericUpDown.Value = 0; FechaDateTimePicker.Value = DateTime.Now; CantidadNumericUpDown.Value = 0; PrecioNumericUpDown.Value = 0; ImporteNumericUpDown.Value = 0; TotalnumericUpDown.Value = 0; DetalledataGridView.DataSource = null; SubTotalNumericUpDown.Value = 0; ITBISNumericUpDown.Value = 0; GeneralErrorProvider.Clear(); mantenimiento.Detalle.Clear(); }
private bool Validar(int error) { bool paso = false; if (error == 1 && VentaIdNumericUpDown.Value == 0) { GeneralErrorProvider.SetError(VentaIdNumericUpDown, "Favor Introduzca Un Id"); paso = true; } if (error == 2 && string.IsNullOrEmpty(DescripcionTextBox.Text)) { GeneralErrorProvider.SetError(DescripcionTextBox, "Es obligatorio Agregar una Descripcion"); paso = true; } if (error == 2 && (UsuariosComboBox.SelectedIndex < 0)) { GeneralErrorProvider.SetError(UsuariosComboBox, "Agrege El usuario"); paso = true; } if (error == 2 && (ProductoComboBox.SelectedIndex < 0)) { GeneralErrorProvider.SetError(ProductoComboBox, "Agrege Un Producto"); paso = true; } if (error == 2 && VentaDetalleDataGridView.RowCount == 0) { GeneralErrorProvider.SetError(VentaDetalleDataGridView, "Es obligatorio Agregar un Producto"); paso = true; } if (error == 3 && string.IsNullOrEmpty(ImporteTextBox.Text)) { GeneralErrorProvider.SetError(ImporteTextBox, "Es obligatorio Agregar un Producto"); paso = true; } return(paso); }
private void ButtonGuardar_Click(object sender, EventArgs e) { bool paso = false; Usuarios usuario = Llenaclase(); if (VerificarClave()) { MessageBox.Show("La ContraseƱa No Es la Misma Verique!"); } else if (Validar(2)) { MessageBox.Show("Introduzca Las Casillas Correspondientes!"); } else { if (UsuarioIdNumericUpDown.Value == 0) { paso = UsuariosBLL.Guardar(usuario); } else { int id = Convert.ToInt32(UsuarioIdNumericUpDown.Value); var usuarios = UsuariosBLL.Buscar(id); if (usuarios != null) { paso = UsuariosBLL.Modificar(usuario); } else { MessageBox.Show("Id No Encotrado!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } LimpiarCampos(); GeneralErrorProvider.Clear(); if (paso) { MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private bool Validar(int error) { bool errores = false; if (error == 1 && TallerIdNumericUpDown.Value == 0) { GeneralErrorProvider.SetError(TallerIdNumericUpDown, "Introduzcca un Id"); errores = true; } if (error == 2 && string.IsNullOrEmpty(NombretextBox.Text)) { GeneralErrorProvider.SetError(NombretextBox, "Introduzca un Nombre"); errores = true; } return(errores); }
private bool validar(int error) { bool errores = false; if (error == 1 && EntradaIdNumericUpDown.Value == 0) { GeneralErrorProvider.SetError(EntradaIdNumericUpDown, "Introduzca un Id"); errores = true; } if (error == 2 && CantidadNumericUpDown.Value == 0) { GeneralErrorProvider.SetError(CantidadNumericUpDown, "Introduzca un Nombre"); errores = true; } return(errores); }
private bool Validar(int error) { bool paso = false; int num = 0; if (error == 1 && string.IsNullOrEmpty(CriterioTextBox.Text)) { GeneralErrorProvider.SetError(CriterioTextBox, "Por Favor, Llenar Casilla!"); paso = true; } if (error == 2 && int.TryParse(CriterioTextBox.Text, out num) == false) { GeneralErrorProvider.SetError(CriterioTextBox, "Ingrese un Numero"); paso = true; } return(paso); }
private void buttonGuardar_Click(object sender, EventArgs e) { bool paso = false; Articulos articulo = Llenaclase(); if (validar(2)) { MessageBox.Show("Introduzca Las Casillas Correspondientes!"); } else { if (ArticuloIdNumericUpDown.Value == 0) { paso = ArticulosBLL.Guardar(articulo); } else { int id = Convert.ToInt32(ArticuloIdNumericUpDown.Value); var articulos = ArticulosBLL.Buscar(id); if (articulos != null) { paso = ArticulosBLL.Modificar(articulo); } else { MessageBox.Show("Id No Encotrado!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } LimpiarCampos(); GeneralErrorProvider.Clear(); if (paso) { MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void NuevoButton_Click(object sender, EventArgs e) { FacturaIdNumericUpDown.Value = 0; FechaDateTimePicker.Value = DateTime.Now; ClienteComboBox.SelectedIndex = 0; ProductoComboBox.SelectedIndex = 0; CantidadNumericUpDown.Value = 0; PrecioNumericUpDown.Value = 0; ImporteNumericUpDown.Value = 0; SuBTotalNumericUpDown.Value = 0; ITBISNumericUpDown.Value = 0; TotalNumericUpDown.Value = 0; DetalledataGridView.DataSource = null; GeneralErrorProvider.Clear(); GeneralErrorProvider.Clear(); }