Пример #1
0
 public RoomForm()
 {
     InitializeComponent();
     roomService.parseRooms();
     DBService.writeDB(roomService.rooms);
     dataGridView1.DataSource = RoomDBService.getRooms().Tables[0].DefaultView;
 }
Пример #2
0
        private void EditRoomButton_Click(object sender, EventArgs e)
        {
            var form = new MoveStudentForm(roomService.rooms);

            form.ShowDialog(this);
            DBService.writeDB(roomService.rooms);
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = RoomDBService.getRooms().Tables[0].DefaultView;
        }
Пример #3
0
        private void RemoveRoomButton_Click(object sender, EventArgs e)
        {
            int index;

            index = int.Parse(dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value.ToString());
            RoomDBService.queryRemove(index);
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = RoomDBService.getRooms().Tables[0].DefaultView;
            roomService.parseRooms();
        }
Пример #4
0
        private void StudentsInRoom_Click(object sender, EventArgs e)
        {
            int     index;
            DataRow row = RoomDBService.getRooms().Tables[0].Rows[dataGridView1.SelectedCells[0].RowIndex];

            index = int.Parse(row[0].ToString());
            var form = new StudentListForm(index);

            form.ShowDialog(this);
            roomService.parseRooms();
        }
Пример #5
0
        private void AddRoomButton_Click(object sender, EventArgs e)
        {
            var          form = new AddRoomForm();
            DialogResult dr   = form.ShowDialog(this);

            if (dr == DialogResult.OK)
            {
                roomService.rooms.Add(form.getRoom());
            }
            DBService.writeDB(roomService.rooms);
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = RoomDBService.getRooms().Tables[0].DefaultView;
        }