1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Private Sub dgBde_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgBde.ItemCommand
If (e.CommandSource.GetType.Name = "LinkButton") Then
If (e.CommandName = "EnregistrerComment") Then
Dim sSql As String = "DELETE FROM TransactionsCommentaire where TCO_ID = '" & e.Item.Cells(7).Text & "'"
Requete_Executer(sSql, Session("SqlCnxStrAdmin"))
Dim user As String = Session("SqlCnxStrAdmin").ToString.Substring(InStr(Session("SqlCnxStrAdmin"), "user=") + 4)
user = user.Substring(0, InStr(user, ";") - 1)
If CType(e.Item.FindControl("txtComment"), TextBox).Text <> "" Then
MsgBox(CType(e.Item.FindControl("txtComment"), TextBox).Text)
Else
MsgBox("pas ok")
End If sSql = "INSERT INTO TransactionsCommentaire Values ('" & e.Item.Cells(7).Text & "', '" & CType(e.Item.FindControl("txtComment"), TextBox).Text & "', '" & Now & "', '" & user & "')"
Requete_Executer(sSql, Session("SqlCnxStrAdmin"))
End If
End If
End Sub |
Partager