Private Sub initilizeDateBindings()
AddHandler DteServiceBeginTextEdit.DataBindings(0).Format, AddressOf FormatDate
AddHandler DteServiceBeginTextEdit.DataBindings(0).Parse, AddressOf ParseDate
AddHandler DteServiceEndTextEdit.DataBindings(0).Format, AddressOf FormatDate
AddHandler DteServiceEndTextEdit.DataBindings(0).Parse, AddressOf ParseDate
'AddHandler DteServiceCreatedTextEdit.DataBindings(0).Format, AddressOf FormatDate
' AddHandler DteServiceCreatedTextEdit.DataBindings(0).Parse, AddressOf ParseDate
End Sub
Private Sub FormatDate(ByVal sender As Object, ByVal e As ConvertEventArgs)
If Not (e.Value Is System.DBNull.Value) Then
e.Value = DateConvertor.DateMiladiToStrJalali(e.Value, "yy/MM/dd")
End If
End Sub
Private Sub ParseDate(ByVal sender As Object, ByVal e As ConvertEventArgs)
Try
e.Value = DateConvertor.strHejriToDateMiladi(e.Value)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
|