private void PopulateReceptions() { using (ProjetSGBDEntities context = new ProjetSGBDEntities()) { IQueryable <GetReservedReception_Result> Receptions = context.GetReservedReception(CurrentClient.Id); dataGridViewReservations.DataSource = Receptions.ToList(); dataGridViewReservations.Columns[3].Visible = false; dataGridViewReservations.Columns[4].Visible = false; dataGridViewReservations.Columns[5].Visible = false; } }
public void LoadReception(int id) { if (CurrentClient != null) { using (ProjetSGBDEntities context = new ProjetSGBDEntities()) { IQueryable <GetReservedReception_Result> recs = context.GetReservedReception(CurrentClient.Id); if (recs.Where(rec => rec.ReceptionId == id).Count() == 1) { CurrentReception = recs.Where(rec => rec.ReceptionId == id).First(); } } } }