Я создаю приложение, в которое люди могут вставить событие с такой информацией, как имя события, местоположение, дата, часы, ...
Есть 3 шага.первые 2 шага со вставками были успешно вставлены.Но на шаге 3, где они должны вставить startDay (Startdag), endDay (Einddag), starthour (startUurt), endHour (eindUur), я не могу это исправить.
В слое презентаций я использую calendarExtender для Startday и Endday с форматом d MMMM гггг с и target txt_sDag и txt_eDag
В наборе данных "DAL_Planit3.xsd" я дал endDay и startDayкак тип "datetime" и startHour и endHour как тип String (потому что мы будем только читать его, мы не будем ничего с ним делать).
Может кто-нибудь помочь мне?
StepThree.aspx.vb
Protected Sub btn_next_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_next.Click
Try
Dim BLLdata As New BLL_Data
Dim eventID As Integer = Session.Item("eventID")
Dim plaatsID As Integer = Session.Item("plaatsID")
Dim data As New CL_Data
data.Einddag = txt_eDag.Text
data.Startdag = CDate(txt_sDag.Text)
data.Einddag = CDate(txt_eDag.Text)
data.Einduur = txt_eUur.Text
data.StartUur = txt_sUur.Text
data.FKEvenementId = eventID
data.FKPlaatsId = plaatsID
BLLdata.insertData(data)
lbl_feedback.Text = "Data succesful inserted!"
Catch ex As Exception
lbl_feedback.Text = "Data not inserted! " + ex.Message
End Try
End Sub
End Class
* BLL_Data.vb *
' INSERT DATA
Public Function insertData(ByVal data As CL_Data) As String
Dim feedback As String = Nothing
Try
adapterDatum3.Insert(data.Startdag, data.Einddag, data.StartUur, data.Einduur, data.FKPlaatsId, data.FKEvenementId)
'adapterDatum.Insert(data.Startdag, data.Einddag, data.StartUur, data.Einduur, data.FKPlaatsId, data.FKEvenementId)
feedback = "Data is toegevoegd"
Catch ex As Exception
feedback = ex.Message
End Try
Return feedback
End Function
CL_Data
Public Class CL_Data
Private iDataId As Integer
Public Property DataID() As Integer
Get
Return iDataId
End Get
Set(ByVal value As Integer)
iDataId = value
End Set
End Property
Private dStartDag As Date
Public Property Startdag() As Date
Get
Return dStartDag
End Get
Set(ByVal value As Date)
dStartDag = value
End Set
End Property
Private dEindDag As Date
Public Property Einddag() As Date
Get
Return dEindDag
End Get
Set(ByVal value As Date)
dEindDag = value
End Set
End Property
Private tStartUur As String
Public Property StartUur() As String
Get
Return tStartUur
End Get
Set(ByVal value As String)
tStartUur = value
End Set
End Property
Private tEindUur As String
Public Property Einduur() As String
Get
Return tEindUur
End Get
Set(ByVal value As String)
tEindUur = value
End Set
End Property
Private iFKPlaatsId As Integer
Public Property FKPlaatsId() As Integer
Get
Return iFKPlaatsId
End Get
Set(ByVal value As Integer)
iFKPlaatsId = value
End Set
End Property
Private iFKEvenementId As Integer
Public Property FKEvenementId() As Integer
Get
Return iFKEvenementId
End Get
Set(ByVal value As Integer)
iFKEvenementId = value
End Set
End Property
End Class