Académique Documents
Professionnel Documents
Culture Documents
Procedure Et Exemples Traite Date Null
Procedure Et Exemples Traite Date Null
mindate Then Return True Else Return False End If End Function Public Sub AffectDate(ByVal xVar As Object, ByVal xValue As Object) If NullDate(xValue) Then xVar.isnull = True Else xVar.value = xValue.value End If End Sub '----------- exemples insertion et maj table Private Sub Save() Try If nouveau Then Dim FdCls As New Parc.T_Visite.spI(MyConnString) With FdCls.Values .Montant.Value = Me.txtMontant.Text.Trim .Affectation.Value = Me.txtAffectation.Text.Trim AffectDate(.DateDebut, Me.cldDatedebut) AffectDate(.DateFin, Me.cldDatefin) AffectDate(.DatePrealable, Me.cldDatePrealable) AffectDate(.DateRealise, Me.cldDateRealise) AffectDate(.DateVisite, Me.cldDateVisite) .CauseNonRealise.Value = Me.txtCauseNonRealise.Text.Trim .Realise.Value = Not Me.cldDateRealise.IsNullDate .CodeEngin.Value = Me.txtCodeEngin.Text End With FdCls.Execute() FdCls.Disconnect() Me.ChargeVisite() Me.grdMain.Row = 0 Else If changed Then Dim FdCls As New Parc.T_Visite.spU(MyConnString) FdCls.Filters.NumeroVisite.Value = Me.grdMain.GetValue("Nume roVisite") With FdCls.Values .Montant.Value = Me.txtMontant.Text.Trim .Affectation.Value = Me.txtAffectation.Text.Trim AffectDate(.DateDebut, Me.cldDatedebut) AffectDate(.DateFin, Me.cldDatefin) AffectDate(.DatePrealable, Me.cldDatePrealable) AffectDate(.DateRealise, Me.cldDateRealise) AffectDate(.DateVisite, Me.cldDateVisite) .CauseNonRealise.Value = Me.txtCauseNonRealise.Text.Trim .Realise.Value = Not Me.cldDateRealise.IsNullDate .CodeEngin.Value = Me.txtCodeEngin.Text End With
FdCls.Execute() FdCls.Disconnect() Me.ChargeVisite() End If End If changed = False If nouveau Then nouveau = False End If Catch ex As Exception MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon .Error) End Try End Sub