private void GetByFilter() { var query = new PersonQuery { FirstName = FirstNameFilter.Text, LastName = LastNameFilter.Text, IdNum = IdFilter.Text, BirthDate = BirthDate.Text != "" ? DateTime.Parse(BirthDate.Text) : (DateTime?)null }; EntitiesGrid.DataSource = query.GetByFilter(); EntitiesGrid.DataBind(); }
private void GetByFilter() { var query = new KindergardenQuery { Name = GardenNameFilter.Text, TeacherId = TeachersFilter.SelectedValue != "999" ? int.Parse(TeachersFilter.SelectedValue) : default(int?) }; if (CitiesFilter.SelectedValue != "-1") { var city = Enum.Parse(typeof(Entities.Cities), CitiesFilter.SelectedValue, true); query.City = (Entities.Cities?)city; } EntitiesGrid.DataSource = query.GetByFilter().ToList(); EntitiesGrid.DataBind(); }