private void buttonUpdate_Click(object sender, EventArgs e)
        {
            MeetingRoom Item = GetInfo();

            Item.RoomCapacity = Convert.ToInt32(textBoxCapacity.Text);
            Db.SaveChanges();
            FillDataGrid();
        }
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            MeetingRoom NewRoom = new MeetingRoom();

            NewRoom.RoomCapacity = Convert.ToInt32(textBoxCapacity.Text);
            Db.MeetingRooms.Add(NewRoom);
            Db.SaveChanges();
            MessageBox.Show("Eklendi");
            FillDataGrid();
        }
        private MeetingRoom GetInfo()
        {
            int ID = 0;

            foreach (DataGridViewRow item in dataGridViewRoom.SelectedRows)
            {
                ID = (int)item.Cells[0].Value;
            }
            MeetingRoom Item = Db.MeetingRooms.SingleOrDefault(x => x.MeetingRoomID == ID);

            return(Item);
        }
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     try
     {
         MeetingRoom Item = GetInfo();
         Db.MeetingRooms.Remove(Item);
         Db.SaveChanges();
         FillDataGrid();
     }
     catch
     {
         MessageBox.Show("Seçilen odanın reservasyonu olduğu için oda silinememektedir.");
     }
 }