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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
Private Sub btn_modify_operation_Click(sender As Object, e As EventArgs) Handles btn_modify_operation.Click
connex.Close()
connex.Open()
Dim form As New Frm_Modification
Dim i, mont As Integer
Dim dateop, op, mot, motsup, dev As String
i = grid_story.CurrentRow.Index
req1 = "SELECT num_operation AS NUM, date_operation AS DATES, designation_operation, designation_motif,designation_departement, designation_bien, devise_operation AS DEVISES, FORMAT(montant_operation, 2) AS MONTANTS FROM tab_operation, tab_type_operation, tab_motif, tab_departement, tab_bien_vendu WHERE tab_type_operation.type_operation=tab_operation.operation AND tab_motif.type_operation=tab_operation.operation AND tab_motif.motif=tab_operation.motif_operation AND tab_operation.departement_operation=tab_departement.departement AND tab_operation.bien_vendu_operation=tab_bien_vendu.code_bien AND tab_operation.num_operation='" & grid_story.Rows(i).Cells(0).Value & "' "
Dim rd5 As MySqlDataReader
Dim cmd8 As New MySqlCommand(req1, connex)
rd5 = cmd8.ExecuteReader
While rd5.Read
dateop = rd5("date_operation")
op = rd5("designation_operation")
mot = rd5("designation_motif")
If rd5("designation_departement") = Nothing And String.IsNullOrEmpty(rd5("designation_bien")) = False Then
motsup = rd5("designation_bien")
ElseIf rd5("designation_bien") = Nothing And String.IsNullOrEmpty(rd5("designation_departement")) = False Then
motsup = rd5("designation_departement")
ElseIf rd5("designation_bien") = Nothing And rd5("designation_departement") = Nothing Then
motsup = Nothing
End If
dev = rd5("devise")
mont = rd5("montant_operation")
End While
If user_role = "ADMIN" Or user_role = "AUTORISE" Then
form.date_operation.Value = grid_story.Rows(i).Cells(1).Value
form.cbo_operation_saisi.SelectedText = op
form.cbo_motif.SelectedText = mot
form.cbo_motif_sup.SelectedText = motsup
form.cbo_devise.SelectedText = dev
form.txt_montant.Text = grid_story.Rows(i).Cells(6).Value
Else
form.date_operation.Value = grid_story.Rows(i).Cells(1).Value
form.date_operation.Enabled = False
form.cbo_operation_saisi.SelectedItem = op
form.cbo_operation_saisi.Enabled = False
form.cbo_motif.SelectedItem = mot
form.cbo_motif.Enabled = False
form.cbo_motif_sup.SelectedItem = motsup
form.cbo_motif_sup.Enabled = False
form.cbo_devise.SelectedItem = dev
form.cbo_devise.Enabled = False
form.txt_montant.Text = grid_story.Rows(i).Cells(5).Value
form.txt_montant.Enabled = False
form.btn_save.Visible = False
End If
form.Show() |
Partager