private void Eliminarbutton_Click(object sender, EventArgs e) { if (Validar(4)) { MessageBox.Show("Favor de Llenar Casilla para poder Buscar", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { int id = Convert.ToInt32(PagoIDnumericUpDown.Value); if (BLL.PagosBLL.Eliminar(id)) { MessageBox.Show("Eliminado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information); PagoIDnumericUpDown.Value = 0; FiltrarcomboBox.SelectedItem = null; ConsultadataGridView.DataSource = null; CriteriotextBox.Clear(); DesdedateTimePicker.Value = DateTime.Now; HastadateTimePicker.Value = DateTime.Now; AbonadonumericUpDown.Value = 0; DeudanumericUpDown.Value = 0; } else { MessageBox.Show("No Pudo Eliminar!", "Fallido!", MessageBoxButtons.OK, MessageBoxIcon.Error); } ClienteerrorProvider.Clear(); } }
private void Consultabutton_Click(object sender, EventArgs e) { Expression <Func <Renta, bool> > filtro = x => true; int id; switch (FiltrocomboBox.SelectedIndex) { case 0: //RentaId id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.RentaId == id && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 1: // MiembroId id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.MiembroId == id && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; } RepositorioBase <Renta> rep = new RepositorioBase <Renta>(); ConsultadataGridView.DataSource = rep.GetList(c => true); CriteriotextBox.Clear(); }
private void TipocomboBox_SelectedIndexChanged(object sender, EventArgs e) { CriteriotextBox.Clear(); LimpiarError(); if (TipocomboBox.SelectedIndex == 5) { CriteriotextBox.Enabled = false; } else { CriteriotextBox.Enabled = true; } if (TipocomboBox.SelectedIndex == 3) { CriteriotextBox.MaxLength = 11; } if (TipocomboBox.SelectedIndex == 4) { CriteriotextBox.MaxLength = 10; } else { CriteriotextBox.MaxLength = 200; } }
private void Buscarbutton_Click(object sender, EventArgs e) { RepositoryBase <Usuario> repository = new RepositoryBase <Usuario>(); var listado = new List <Usuario>(); if (CriteriotextBox.Text.Trim().Length > 0) { switch (FiltrocomboBox.SelectedIndex) { case 0: //Todo listado = repository.GetList(p => true); break; case 1: //Id { int id = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.UsuarioID == id); if (repository.GetList(filtro).Count() == 0) { MessageBox.Show("Este id de usuario no Exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } break; } case 2: //Nombre { listado = repository.GetList(p => p.Nombre.Contains(CriteriotextBox.Text)); if (repository.GetList(filtro).Count() == 0) { MessageBox.Show("Nombre no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } break; } case 3: //Contraseña { listado = repository.GetList(p => p.Contraseña.Contains(CriteriotextBox.Text)); if (repository.GetList(filtro).Count() == 0) { MessageBox.Show("Contraseña no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } break; } } else { listado = repository.GetList(p => true); } dataGridView1.DataSource = null; dataGridView1.DataSource = listado; usuario = listado; CriteriotextBox.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { RepositoryBase <Factura> repository = new RepositoryBase <Factura>(); var listado = new List <Factura>(); if (CriteriotextBox.Text.Trim().Length >= 0) { switch (FiltrocomboBox.SelectedIndex) { case 0: //Todo listado = repository.GetList(p => true); break; case 1: //Id int id = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.FacturaId == id); break; case 2: //Monto decimal monto = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.Monto == monto); break; case 3: //UsuarioId int usuarioId = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.UsuarioId == usuarioId); break; case 4: //ClienteId int clienteId = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.ClienteID == clienteId); break; case 5: //Descripcion listado = repository.GetList(p => p.Descripcion.Contains(CriteriotextBox.Text)); break; case 6: //Devuelta decimal devuelta = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.Devuelta == devuelta); break; case 7: //Efectivo Recibido decimal efectivoRecibido = Convert.ToInt32(CriteriotextBox.Text); listado = repository.GetList(p => p.EfectivoRecibido == efectivoRecibido); break; } listado = listado.Where(c => c.Fecha.Date >= DesdedateTimePicker.Value.Date && c.Fecha.Date <= HastadateTimePicker.Value.Date).ToList(); } else { listado = repository.GetList(p => true); } dataGridView1.DataSource = null; dataGridView1.DataSource = listado; CriteriotextBox.Clear(); Factura = listado; }
private void Consultabutton_Click(object sender, EventArgs e) { if (SetError(4)) { MessageBox.Show("Debe introducir porque filtro va a consultar", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } Expression <Func <Cliente, bool> > filtrar = x => true; switch (FiltrarcomboBox.SelectedIndex) { case 0: //ClienteID if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (BLL.ClienteBLL.GetList(filtrar).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; } if (FiltrarcomboBox.SelectedItem != null) { ConsultadataGridView.DataSource = ClienteBLL.GetList(filtrar); if (FiltrarcomboBox.SelectedIndex == 0) { foreach (var item in ClienteBLL.GetList(filtrar)) { DeudanumericUpDown.Value = item.Total - AbonadonumericUpDown.Value; AbonadonumericUpDown.Text = item.Total.ToString(); } } CriteriotextBox.Clear(); ClienteerrorProvider.Clear(); //ConsultadataGridView.Columns["InversionID"].Visible = false; } }
private void Nuevobutton_Click(object sender, EventArgs e) { PagoIDnumericUpDown.Value = 0; FiltrarcomboBox.SelectedItem = null; ConsultadataGridView.DataSource = null; CriteriotextBox.Clear(); DesdedateTimePicker.Value = DateTime.Now; HastadateTimePicker.Value = DateTime.Now; AbonadonumericUpDown.Value = 0; DeudanumericUpDown.Value = 0; }
private void Limpiar() { PagoIDnumericUpDown.Value = 0; FiltrarcomboBox.SelectedItem = null; ConsultadataGridView.DataSource = null; CriteriotextBox.Clear(); DesdedateTimePicker.Value = DateTime.Now; HastadateTimePicker.Value = DateTime.Now; AbonadonumericUpDown.Value = 0; DeudanumericUpDown.Value = 0; }
private void TipocomboBox_SelectedIndexChanged(object sender, EventArgs e) { CriteriotextBox.Clear(); if (TipocomboBox.SelectedIndex == 2) { CriteriotextBox.Enabled = false; } else { CriteriotextBox.Enabled = true; } }
private void FiltrocomboBox_SelectedIndexChanged(object sender, EventArgs e) { CriteriotextBox.Clear(); LimpiarError(); if (FiltrocomboBox.SelectedIndex == 5) { CriteriotextBox.Enabled = false; } else { CriteriotextBox.Enabled = true; } }
private void Consultabutton_Click(object sender, EventArgs e) { Expression <Func <VideoJuego, bool> > filtro = x => true; int id; switch (FiltrocomboBox.SelectedIndex) { case 0: //ID id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.VideoJuegoId == id && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 1: // Titulo filtro = x => x.Titulo.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 2: // Descripcion filtro = x => x.Descripcion.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 3: //Plataforma filtro = x => x.Plataforma.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 4: //Lanzamiento CriteriotextBox.ReadOnly = true; DesdedateTimePicker.Visible = false; HastadateTimePicker.Visible = false; filtro = x => x.Lanzamiento.Year == LanzamientodateTimePicker.Value.Year; break; case 5: //Genero filtro = x => x.Genero.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 6: //Cantidad de ejemplares filtro = x => x.CantidadEjemplares.Equals(Convert.ToInt32(CriteriotextBox)) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; } RepositorioBase <VideoJuego> juegorep = new RepositorioBase <VideoJuego>(); ConsultadataGridView.DataSource = juegorep.GetList(c => true); CriteriotextBox.Clear(); }
private void Guardarbutton_Click(object sender, EventArgs e) { if (Validar(5)) { MessageBox.Show("Debe de Dijitar un Monto!", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Pagos cobros = Llenaclase(); bool paso = false; if (PagoIDnumericUpDown.Value == 0) { paso = BLL.PagosBLL.Guardar(Llenaclase()); } else { int id = Convert.ToInt32(PagoIDnumericUpDown.Value); var entry = BLL.PagosBLL.Buscar(id); if (entry != null) { paso = BLL.PagosBLL.Editar(Llenaclase()); } else { MessageBox.Show("Id no existe", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } } PagoIDnumericUpDown.Value = 0; FiltrarcomboBox.SelectedItem = null; ConsultadataGridView.DataSource = null; CriteriotextBox.Clear(); DesdedateTimePicker.Value = DateTime.Now; HastadateTimePicker.Value = DateTime.Now; AbonadonumericUpDown.Value = 0; DeudanumericUpDown.Value = 0; ClienteerrorProvider.Clear(); if (paso) { MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void Consultabutton_Click(object sender, EventArgs e) { Expression <Func <Usuario, bool> > filtro = x => true; int id; switch (FiltrocomboBox.SelectedIndex) { case 0: //ID id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.UsuarioId == id && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 1: // Nombre filtro = x => x.Nombre.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 2: // Cedula filtro = x => x.Cedula.Equals(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 3: //Telefono filtro = x => x.Telefono.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 4: //Username filtro = x => x.UserName.Equals(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; case 5: //tipo filtro = x => x.UserName.Contains(CriteriotextBox.Text) && (x.FechaRegistro >= DesdedateTimePicker.Value && x.FechaRegistro <= HastadateTimePicker.Value); break; } RepositorioBase <Usuario> usrep = new RepositorioBase <Usuario>(); ConsultadataGridView.DataSource = usrep.GetList(c => true); CriteriotextBox.Clear(); }
private void TipocomboBox_SelectedIndexChanged(object sender, EventArgs e) { bool paso = false; CriteriotextBox.Clear(); if (TipocomboBox.SelectedIndex == 4) { CriteriotextBox.Enabled = false; } else { CriteriotextBox.Enabled = true; } if (TipocomboBox.SelectedIndex == 0) { ContadocheckBox.Enabled = false; CreditocheckBox.Enabled = false; paso = true; } else { ContadocheckBox.Enabled = true; CreditocheckBox.Enabled = true; paso = false; } if (paso == false) { if (TipocomboBox.SelectedIndex == 7 || TipocomboBox.SelectedIndex == 6) { CreditocheckBox.Enabled = false; ContadocheckBox.Enabled = false; } else { ContadocheckBox.Enabled = true; CreditocheckBox.Enabled = true; } } }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <EntradaArticulos, bool> > filtro = x => true; int id; switch (FiltrocomboBox.SelectedIndex) { case 0: //ID id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.EntradaId == id && (x.Fecha >= DesdedateTimePicker.Value && x.Fecha <= HastadateTimePicker.Value); break; case 1: // Articulo filtro = x => x.ArticuloId.Equals(CriteriotextBox.Text) && (x.Fecha >= DesdedateTimePicker.Value && x.Fecha <= HastadateTimePicker.Value); break; case 2: // Fecha filtro = x => x.Fecha.Equals(CriteriotextBox.Text) && (x.Fecha >= DesdedateTimePicker.Value && x.Fecha <= HastadateTimePicker.Value); break; case 3: // Cantidad filtro = x => x.Cantidad.Equals(CriteriotextBox.Text) && (x.Fecha >= DesdedateTimePicker.Value && x.Fecha <= HastadateTimePicker.Value); break; case 4: //Todo filtro = x => true; break; } ConsultadataGridView.DataSource = BLL.EntradaArticulosBLL.GetList(filtro); CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Consultabutton_Click(object sender, EventArgs e) { Expression <Func <Departamento, bool> > filtro = x => true; switch (TipocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.DepartamentoId == id; if (BLL.DepartamentoBLL.Buscar(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Nombre if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una Descripcion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Nombre.Contains(CriteriotextBox.Text); if (BLL.DepartamentoBLL.Buscar(filtro).Count() == 0) { MessageBox.Show("Esta Descripcion, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Todo filtro = x => true; break; } ConsultadataGridView.DataSource = BLL.DepartamentoBLL.Buscar(filtro); CriteriotextBox.Clear(); TexterrorProvider.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { RepositorioBase <Articulo> repositorio; repositorio = new RepositorioBase <Articulo>(); var filtro = new List <Articulo>(); int id; if (CristeriotextBox.Text.Trim().Length >= 0) { switch (FiltrocomboBox.SelectedIndex) { case 0: //Id { int id = Convert.ToInt32(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.IDArticulos == id); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Este Articulo no Exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } break; } case 1: //Descripcion if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { listado = repositoryBase.GetList(p => p.Descripcion.Contains(CriteriotextBox.Text)); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Descripcion no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } break; } case 2: //Importe if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { float importe = Convert.ToSingle(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.Costo == importe); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Importe no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } break; } case 3: //Ganancia if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { float Ganancia = Convert.ToSingle(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.Ganancia == Ganancia); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Ganancia no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } break; case 4: //precio if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { float precio = Convert.ToSingle(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.Precio == precio); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Precio no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } break; case 5: //Cantidad if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int Cantidad = Convert.ToInt32(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.Cantidad == Cantidad); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Precio no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } break; case 6: //Itebis if (Validar(1)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Llenar Campo", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { float itebis = Convert.ToSingle(CriteriotextBox.Text); listado = repositoryBase.GetList(p => p.Itebis == itebis); if (repositoryBase.GetList(filtro).Count() == 0) { MessageBox.Show("Precio no exite", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } break; case 7: //todo filtro = x => true; break; } } else { listado = repositoryBase.GetList(p => true); } dataGridView1.DataSource = null; dataGridView1.DataSource = listado; CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ArticuloId == id; if (ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Nombre if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un Nombre!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Nombre.Contains(CriteriotextBox.Text); if (ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Nombre, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 2: //Inventario if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int inventario = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.Inventario == inventario; if (ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Inventario, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 3: //todo filtro = x => true; if (ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Lista esta Vacia", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } if (FiltrocomboBox.SelectedItem != null) { ArticulosdataGridView.DataSource = ArticulosBLL.GetList(filtro); CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); } }
private void Consultabutton_Click(object sender, EventArgs e) { switch (TipocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.UsuariosId == id; if (UsusariosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Nombre if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un Nombre!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Nombre.Contains(CriteriotextBox.Text); if (UsusariosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Nombre, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 2: //Usuario if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Usuario.Equals(CriteriotextBox.Text); if (UsusariosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 3: //TODO filtro = x => true; if (UsusariosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Lista esta Vacia, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } if (TipocomboBox.SelectedItem != null) { ConsultadataGridView.DataSource = BLL.UsusariosBLL.GetList(filtro); CriteriotextBox.Clear(); UsuarioerrorProvider.Clear(); } ListaUsuarios = UsusariosBLL.GetList(filtro); ConsultadataGridView.DataSource = ListaUsuarios; }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <EntradaRopas, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.EntradaId == id && (desdedateTimePicker.Value >= x.Fecha && HastadateTimePicker.Value <= x.Fecha); } else { filtro = x => x.EntradaId == id; } if (BLL.EntradaRopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //RopaId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int ropaId = Convert.ToInt32(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.RopaId == ropaId && (desdedateTimePicker.Value >= x.Fecha && HastadateTimePicker.Value <= x.Fecha); } else { filtro = x => x.RopaId == ropaId; } if (BLL.EntradaRopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 2: //Cantidad if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal cantidad = Convert.ToDecimal(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.Cantidad == cantidad && (desdedateTimePicker.Value >= x.Fecha && HastadateTimePicker.Value <= x.Fecha); } else { filtro = x => x.Cantidad == cantidad; } if (BLL.EntradaRopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Todo filtro = x => true; break; } entradaRopas = BLL.EntradaRopasBLL.GetList(filtro); EntradaRopasdataGridView.DataSource = entradaRopas; CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <Ropas, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.RopaId == id; if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Descripcion if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una Descripcion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Descripcion.Contains(CriteriotextBox.Text); if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta Descripcion, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 2: //Precio if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal precio = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Precio == precio; if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este precio, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Size if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un size!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Size.Contains(CriteriotextBox.Text); if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este size, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 4: //marca if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una marca!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Marca.Contains(CriteriotextBox.Text); if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta marca, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 5: //Inventario if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Invetario = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Inventario == Invetario; if (BLL.RopasBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No hay Existencia", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 6: //Todo filtro = x => true; break; } ropas = BLL.RopasBLL.GetList(filtro); RopasdataGridView.DataSource = ropas; CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Consultabutton_Click(object sender, EventArgs e) { if (SetError(4)) { MessageBox.Show("Debe introducir porque filtro va a consultar", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error); } Expression <Func <Cliente, bool> > filtrar = x => true; List <Cliente> listaCliente = new List <Cliente>(); switch (FiltrarcomboBox.SelectedIndex) { case 0: filtrar = x => true; break; case 1: int.TryParse(CriteriotextBox.Text, out int id); filtrar = x => x.ClienteID == id; break; case 2: string Nombre = CriteriotextBox.Text; filtrar = x => x.NombreCliente.Contains(Nombre); break; } /* * switch (FiltrarcomboBox.SelectedIndex) * { * * case 0://ClienteID * * if (Validar(1)) * { * MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); * return; * } * if (Validar(2)) * { * MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); * return; * } * else * { * if (BLL.ClienteBLL.GetList(filtrar).Count() == 0) * { * MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); * return; * } * } * break; * }*/ /*if (FiltrarcomboBox.SelectedItem != null) * { */ listaCliente = ClienteBLL.GetList(filtrar).Where(x => x.Total > 0).ToList(); ConsultadataGridView.DataSource = listaCliente; /*if (FiltrarcomboBox.SelectedIndex == 0) * {*/ foreach (var item in listaCliente) { DeudanumericUpDown.Value = item.Total - AbonadonumericUpDown.Value; AbonadonumericUpDown.Text = item.Total.ToString(); } //} CriteriotextBox.Clear(); ClienteerrorProvider.Clear(); //ConsultadataGridView.Columns["InversionID"].Visible = false; //} }
//Busca una Entidad en la base de datos y la muestra //Comparando con cada uno de los casos del switch private void Buscarbutton_Click_1(object sender, EventArgs e) { //Inicializacion del filtro en True Expression <Func <Articulos, bool> > filtro = X => true; int id; switch (FiltrocomboBox.SelectedIndex) { case 0: //Todo ConsultardataGridView.DataSource = BLL.ArticuloBLL.GetList(filtro); // Muesta la lista completa de entidade que se encuentran en la //base de datos break; case 1: //ID if (Validar(1)) { MessageBox.Show("Por Favor Llene Casilla"); } else if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero"); } else { id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ArticuloId == id; // aqui se busca una entidad por el id y lo lista if (BLL.ArticuloBLL.GetList(filtro).Count() == 0) { errorProvider.Clear(); MessageBox.Show("Este ID no Existe"); return; } else { errorProvider.Clear(); ConsultardataGridView.DataSource = BLL.ArticuloBLL.GetList(filtro); // aqui lo lista en el datagridview } } break; case 2: //Fecha if (Validar(1)) { MessageBox.Show("Por Favor Llene Casilla"); } else if (Validar(3)) { MessageBox.Show("Debe Digitar una Fecha"); } else { filtro = x => x.FechaVencimiento.Equals(CriteriotextBox.Text); if (BLL.ArticuloBLL.GetList(filtro).Count() == 0) // se busca una entidad por la fecha { errorProvider.Clear(); MessageBox.Show("Esta Fecha no Existe"); return; } else { errorProvider.Clear(); } ConsultardataGridView.DataSource = BLL.ArticuloBLL.GetList(filtro); } break; case 3: //Precio if (Validar(1)) { MessageBox.Show("Por Favor Llene Casilla"); } else if (Validar(2)) { MessageBox.Show("Debe Digitar un Precio"); } else { decimal p = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Precio == p; //se busca una entidad por el precio if (BLL.ArticuloBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Precio No Existe"); return; } else { errorProvider.Clear(); } ConsultardataGridView.DataSource = BLL.ArticuloBLL.GetList(filtro); } break; } CriteriotextBox.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { switch (FiltrocomboBox.SelectedIndex) { case 0: //ReciboId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ReciboId == id; if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: // ArticuloId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ArticuloId == id; if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 2: //NombreArticulo if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un Nombre de Articulo!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { filtro = x => x.Articulo.Contains(CriteriotextBox.Text); if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 3: //Descripcion if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una Direccion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Descripcion.Contains(CriteriotextBox.Text); if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 4: // Cantidad if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int cantidad = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.Cantidad == cantidad; if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 5: // Monto if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Monto!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal monto = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Monto == monto; if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 6: //TODO filtro = x => true; if (BLL.ReciboDetallesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Lista esta Vacia, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } if (FiltrocomboBox.SelectedItem != null) { RecibodataGridView.DataSource = BLL.ReciboDetallesBLL.GetList(filtro); CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); RecibodataGridView.Columns["articulos"].Visible = false; RecibodataGridView.Columns["ID"].Visible = false; } }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <Clientes, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ClienteId == id; if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Direccion if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una direccion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Direccion.Contains(CriteriotextBox.Text); if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta direccion, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 2: //Nombre if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un nombre!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Nombre.Contains(CriteriotextBox.Text); if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este nombre, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Devuelta if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Devuelta = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Devuelta == Devuelta; if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta devuelta, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 4: //Cedula if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar una cedula!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Cedula.Contains(CriteriotextBox.Text);; if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta cedula, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 5: //telefono if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un telefono!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Telefono.Contains(CriteriotextBox.Text); if (BLL.ClientesBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No existe telefono", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 6: //Todo filtro = x => true; break; } clientes = BLL.ClientesBLL.GetList(filtro); ClientesdataGridView.DataSource = clientes; CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { switch (FiltrocomboBox.SelectedIndex) { case 0: //ReciboId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.ReciboId == id && (x.Fecha >= desdedateTimePicker.Value.Date && x.Fecha <= HastadateTimePicker.Value.Date); } else { filtro = x => x.ReciboId == id; } if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: // ClienteId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.ClienteId == id && (x.Fecha >= desdedateTimePicker.Value.Date && x.Fecha <= HastadateTimePicker.Value.Date); } else { filtro = x => x.ClienteId == id; } if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 2: //NombredeCliente if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un Nombre!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { if (FechacheckBox.Checked == true) { filtro = x => x.NombredeCliente.Contains(CriteriotextBox.Text) && (x.Fecha >= desdedateTimePicker.Value.Date && x.Fecha <= HastadateTimePicker.Value.Date); } else { filtro = x => x.NombredeCliente.Contains(CriteriotextBox.Text); } if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 3: // Monto if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Monto!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { decimal monto = Convert.ToDecimal(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.MontoTotal == monto && (x.Fecha >= desdedateTimePicker.Value.Date && x.Fecha <= HastadateTimePicker.Value.Date); } else { filtro = x => x.MontoTotal == monto; } if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 4: //TODO filtro = x => true; if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Lista esta Vacia, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } if (FiltrocomboBox.SelectedItem != null) { RecibodataGridView.DataSource = BLL.ReciboBLL.GetList(filtro); // RecibodataGridView.Columns.Add("estado", "Estado"); CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); RecibodataGridView.Columns["ActivodeNegocioId"].Visible = false; RecibodataGridView.Columns["Detalle"].Visible = false; } }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <Recibos, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //ReciboId if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); if (FechacheckBox.Checked == true) { filtro = x => x.ReciboId == id && (x.Fecha >= DesdedateTimePicker.Value.Date && x.Fecha <= HastadateTimePicker.Value.Date); } else { filtro = x => x.ReciboId == id; } if (BLL.ReciboBLL.GetList(filtro).Count() == 0) { MessageBox.Show(" No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; } if (FiltrocomboBox.SelectedItem != null) { CobrosdataGridView.DataSource = BLL.ReciboBLL.GetList(filtro); if (FiltrocomboBox.SelectedIndex == 0) { foreach (var item in BLL.ReciboBLL.GetList(filtro)) { deudatextBox.Text = (BLL.CobroBLL.quincenas(item.Fecha, item.MontoTotal) - item.Abono).ToString(); AbonostextBox.Text = item.Abono.ToString(); DateTime FechaAct = fechaDateTimePicker.Value; DateTime FechaEmpeño = item.UltimaFechadeVigencia; if (FechaAct >= FechaEmpeño) { estadolabel.Text = "Vencido"; estadolabel.ForeColor = Color.Red; } else { estadolabel.Text = "Vigente"; estadolabel.ForeColor = Color.Green; } } } CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); CobrosdataGridView.Columns["Detalle"].Visible = false; CobrosdataGridView.Columns["ActivodeNegocioId"].Visible = false; } }
private void Buscarbutton_Click(object sender, EventArgs e) { switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ClienteId == id; if (BLL.ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } break; case 1: //Nombre if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar un Nombre!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { filtro = x => x.Nombre.Contains(CriteriotextBox.Text); if (ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Nombre, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 2: //Cedula if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar la Cedula con sus Guiones!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { filtro = x => x.Cedula.Equals(CriteriotextBox.Text); if (BLL.ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta Cedula, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 3: //Telefono if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar el telefono con sus Guiones!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { filtro = x => x.Telefono.Equals(CriteriotextBox.Text); if (BLL.ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Telefono, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 4: //Direccion if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una Direccion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { filtro = x => x.Direccion.Contains(CriteriotextBox.Text); if (BLL.ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta Direccion, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 5: //TODO filtro = x => true; if (BLL.ClienteBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Lista esta Vacia, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } break; } if (FiltrocomboBox.SelectedItem != null) { ClientesdataGridView.DataSource = BLL.ClienteBLL.GetList(filtro); CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); } }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <Articulos, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("llenar campo ", "fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Digite un numero!", "fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ArticulosId == id; if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("no existe ese Id", "favor revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Descripcion if (Validar(1)) { MessageBox.Show(" Llenar campo ", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Digite una Descripcion!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Descripcion.Contains(CriteriotextBox.Text); if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("no hay esa descripcion", "favor revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 2: //Costo if (Validar(1)) { MessageBox.Show("Llenar campo ", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Digite un numero!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal costo = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.costo == costo; if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("no existe este costo", "revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Ganancia if (Validar(1)) { MessageBox.Show("llenar campo ", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Digite un numero!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Ganancia = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Ganancia == Ganancia; if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("no existe la ganancia", "revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 4: //precio if (Validar(1)) { MessageBox.Show("llenar campo ", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Digite un numeroo!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal precio = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.precio == precio; if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("no existe el precio", "revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 5: //Inventario if (Validar(1)) { MessageBox.Show("llenar campo ", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Digite un numero!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Invetario = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Inventario == Invetario; if (BLL.ArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("el inventario es vacio", "revisar", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 6: //Todo filtro = x => true; break; } ConsultadataGridView.DataSource = BLL.ArticulosBLL.GetList(filtro); CriteriotextBox.Clear(); errorProvider1.Clear(); }
private void Buscarbutton_Click(object sender, EventArgs e) { Expression <Func <RegistrodeArticulos, bool> > filtro = x => true; switch (FiltrocomboBox.SelectedIndex) { case 0: //Id if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { int id = Convert.ToInt32(CriteriotextBox.Text); filtro = x => x.ArticulosId == id; if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este ID, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } break; case 1: //Descripcion if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(3)) { MessageBox.Show("Debe Digitar una Descripcion!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { filtro = x => x.Descripcion.Contains(CriteriotextBox.Text); if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Esta Descripcion, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 2: //Costo if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal costo = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.costo == costo; if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Monto, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 3: //Ganancia if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Ganancia = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Ganancia == Ganancia; if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este Monto, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 4: //precio if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal precio = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.precio == precio; if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("Este precio, No Existe", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 5: //Inventario if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla ", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Validar(2)) { MessageBox.Show("Debe Digitar un Numero!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { decimal Invetario = Convert.ToDecimal(CriteriotextBox.Text); filtro = x => x.Inventario == Invetario; if (BLL.RegistrodeArticulosBLL.GetList(filtro).Count() == 0) { MessageBox.Show("No hay Existencia", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case 6: //Todo filtro = x => true; break; } ArticulosdataGridView.DataSource = BLL.RegistrodeArticulosBLL.GetList(filtro); CriteriotextBox.Clear(); GeneralerrorProvider.Clear(); }