1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Private Sub btnFilter_Click(sender As Object, e As EventArgs) Handles btnFilter.Click
Dim data = (From d In Promo.DTO.DetailsDemo
Select Id = d.Id, Department = d.CodeDemo.Department, CodeDemo = d.CodeDemo, Percentage = d.Percentage, Description = d.Description, Note = d.Note, ListType = d.ListType).Concat(
From d In Promo.DTO.DetailsDepartment
Select Id = d.Id, Department = d.Department, CodeDemo = CType(Nothing, PROMO_DTO.CodeDemo), Percentage = d.Percentage, Description = d.Description, Note = d.Note, ListType = d.ListType)
If ckbDepartment.Checked Then
data = (From d In data
Where d.Department.Id = CShort(cbDepartment.SelectedValue)
Select d)
End If
If ckbConcession.Checked Then
data = (From d In data
Where d.CodeDemo.Id = CInt(cbConcession.SelectedValue)
Select d)
End If
If ckbPercent.Checked Then
data = (From d In data
Where d.Percentage = nudPercent.Value
Select d)
End If
dgvDemo.DataSource = data.ToList
End Sub |
Partager