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

If Not IsNothing(ГруппаBindingSource.Current) Then ГруппаBindingSource.RemoveCurrent()

End Sub

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

ГруппаBindingSource.Filter = ""

End Sub

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

ГруппаBindingSource.Filter = "Название='" & ComboBox1.Text & "'"

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 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 fLessons

Private Sub ПредметBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)

Me.Validate()

Me.ПредметBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

End Sub

Private Sub Form4_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 Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Close()

End Sub

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

ПредметBindingSource.AddNew()

End Sub

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

If Not IsNothing(ПредметBindingSource.Current) Then ПредметBindingSource.RemoveCurrent()

End Sub

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

Try

Me.Validate()

Me.ПредметBindingSource.EndEdit()

Me.TableAdapterManager.UpdateAll(Me.TimetableDBDataSet)

Catch

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

End Try

End Sub

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click

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

End Sub

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

Dim Col As System.Windows.Forms.DataGridViewColumn = DataGridViewTextBoxColumn2

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)

Button7.Enabled = True

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