private void Search_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(txtCodeFind.Text)) { var nro = int.Parse(txtCodeFind.Text); lboxCases.DataSource = ListCases.Where(x => x.Code == nro).ToList(); } else { InitialLoad(); ChargeList(); } }
private void txtCodeFind_KeyPress(object sender, KeyPressEventArgs e) { General.ValidNumber(e); if (!string.IsNullOrWhiteSpace(txtCodeFind.Text)) { var nro = int.Parse(txtCodeFind.Text); lboxCases.DataSource = ListCases.Where(x => x.Code == nro).ToList(); } else { InitialLoad(); ChargeList(); } }
private void lbxCompany_SelectedIndexChanged(object sender, EventArgs e) { var filterCases = ListCases.Where(x => x.IdCompany == ((Company)lbxCompany.SelectedItem).Id).ToList(); FillListBox(lboxCases, filterCases, "Id", "code"); }