Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ПЗ Муравейко Павел(v1_0).docx
Скачиваний:
1
Добавлен:
01.03.2025
Размер:
692.62 Кб
Скачать

If InStr(ПредметDataGridView.Item(I, j).Value, TextBox1.Text) Then

ПредметDataGridView.Item(i, j).Style.BackColor = Color.AliceBlue

ПредметDataGridView.Item(i, j).Style.ForeColor = Color.Red

End If

Next j

Next i

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

ПредметBindingSource.Filter = "Название='" & ComboBox1.Text & "'"

End Sub

End Class

Public Class fPrepods

Private Sub ПреподавательBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)

Me.Validate()

Me.ПреподавательBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

'TODO: This line of code loads data into the 'TimetableDBDataSet.Преподаватель' table. You can move, or remove it, as needed.

Me.ПреподавательTableAdapter.Fill(Me.TimetableDBDataSet.Преподаватель)

End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click

For i = 0 To ПреподавательDataGridView.ColumnCount - 1

For j = 0 To ПреподавательDataGridView.RowCount - 1

ПреподавательDataGridView.Item(i, j).Style.BackColor = Color.White

ПреподавательDataGridView.Item(i, j).Style.ForeColor = Color.Black

Next j

Next i

For i = 0 To ПреподавательDataGridView.ColumnCount - 1

For j = 0 To ПреподавательDataGridView.RowCount - 1

If InStr(ПреподавательDataGridView.Item(I, j).Value, TextBox1.Text) Then

ПреподавательDataGridView.Item(i, j).Style.BackColor = Color.AliceBlue

ПреподавательDataGridView.Item(i, j).Style.ForeColor = Color.Red

End If

Next j

Next i

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

ПреподавательBindingSource.Filter = "Адрес='" & ComboBox1.Text & "'"

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

ПреподавательBindingSource.Filter = ""

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Close()

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

If Not IsNothing(ПреподавательBindingSource.Current) Then ПреподавательBindingSource.RemoveCurrent()

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

Try

Me.Validate()

Me.ПреподавательBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

Catch

MessageBox.Show("Неверное заполнение!")

End Try

End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click

Dim Col As System.Windows.Forms.DataGridViewColumn

Select Case ListBox1.SelectedIndex

Case 0

Col = DataGridViewTextBoxColumn2

Case 1

Col = DataGridViewTextBoxColumn3

Case 2

Col = DataGridViewTextBoxColumn4

End Select

If RadioButton1.Checked Then

ПреподавательDataGridView.Sort(Col, System.ComponentModel.ListSortDirection.Ascending)

Else

ПреподавательDataGridView.Sort(Col, System.ComponentModel.ListSortDirection.Descending)

End If

End Sub

Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged

Button7.Enabled = True

End Sub

End Class

Public Class fRooms

Private Sub АудиторияBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)

Me.Validate()

Me.АудиторияBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

End Sub

Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load

'TODO: This line of code loads data into the 'TimetableDBDataSet.Аудитория' table. You can move, or remove it, as needed.

Me.АудиторияTableAdapter.Fill(Me.TimetableDBDataSet.Аудитория)

ListBox1.SelectedIndex = 0

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs)

АудиторияBindingSource.AddNew()

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

АудиторияBindingSource.RemoveCurrent()

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

Try

Me.Validate()

Me.АудиторияBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

Catch

MessageBox.Show("Неверное заполнение!")

End Try

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

Close()

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

For i = 0 To АудиторияDataGridView.ColumnCount - 1

For j = 0 To АудиторияDataGridView.RowCount - 1

АудиторияDataGridView.Item(i, j).Style.BackColor = Color.White

АудиторияDataGridView.Item(i, j).Style.ForeColor = Color.Black

Next j

Next i

For i = 0 To АудиторияDataGridView.ColumnCount - 1

For j = 0 To АудиторияDataGridView.RowCount - 1