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
|
Protected Sub gv_det_devis_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
if e.CommandName="InsertLines" then
For Each oDataRow As GridViewRow In gv_det_devis.Rows
Dim sQte As String = CType(gv_det_devis.FindControl("tb_qte"), TextBox).Text
Dim sPU As String = CType(gv_det_devis.FindControl("tb_pu"), TextBox).Text
Valider_ajout(sQte, sPU)
Next
end if
End Sub
Private Sub BindData()
Dim iDummy(4) As Int32 ' ça va nous donner 5 ligne
gv_det_devis.DataSource = iDummy
gv_det_devis.DataBind()
End Sub
Protected Sub Valider_ajout(ByVal qte As String, ByVal pu As String)
req_cmd = "INSERT INTO Devis(id_pdt,id_devis,id_clt,qte_devis,prix_devis)" & _
" VALUES ('PR0001','DE0001','CL0001'," & qte & "','" & pu & "')"
cmd = New SqlCommand(req_cmd, con)
cmd.ExecuteNonQuery()
con.Close()
End Sub |
Partager