private void Filterize() { switch (currTable) { case CurrentTable.Departments: DepartmentFilter da = new DepartmentFilter(); if (da.ShowDialog() == DialogResult.OK) { filterString = da.Filter; } break; case CurrentTable.Clients: ClientFilter cf = new ClientFilter(); if (cf.ShowDialog() == DialogResult.OK) { filterString = cf.Filter; } break; case CurrentTable.Employees: EmployeeFilter ef = new EmployeeFilter(); if (ef.ShowDialog() == DialogResult.OK) { filterString = ef.Filter; } break; case CurrentTable.Contracts: ContractFilter cnf = new ContractFilter(); if (cnf.ShowDialog() == DialogResult.OK) { filterString = cnf.Filter; } break; case CurrentTable.Meeting: MeetingFilter mf = new MeetingFilter(); if (mf.ShowDialog() == DialogResult.OK) { filterString = mf.Filter; } break; default: MessageBox.Show("Таблица " + currTable.ToString() + " не фильтруется."); break; } RefreshTable(); }