private void RentHistoryButton_Click(object sender, EventArgs e) { Reception[] receptions; using (var context = new ApplicationDBContext()) { receptions = context.GetReceptions(SearchReceptionParam.SearchByEmployeeId(Employee.ID)) .ToArray(); } var history = new RentHistoryView(receptions); history.ShowDialog(); }
// обработчик кнопки "История аренд" private void RentHistoryButton_Click(object sender, EventArgs e) { Reception[] receptions; using (var context = new ApplicationDBContext()) { // получаем список всех аренд для автомобиля receptions = context.GetReceptions(SearchReceptionParam.SearchByCarId(Car.ID)) .ToArray(); } var history = new RentHistoryView(receptions); history.ShowDialog(); }