Your SlideShare is downloading. ×
0
Slshdataobject01
Slshdataobject01
Slshdataobject01
Slshdataobject01
Slshdataobject01
Slshdataobject01
Slshdataobject01
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Slshdataobject01

184

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
184
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. [email_address]
  • 2. ÍNDEX <ul><li>DataObject </li></ul><ul><ul><li>Objectes com a propietats </li></ul></ul>
  • 3. DataObject Objectes com a propietats CRITERI_AVALUACIO PK ID_CRITERI INT(4) FK ID_TIPUS INT(4) DESCRIPCIO VARCHAR2(200) TIPUS_CRITERI PK ID_TIPUS INT(4) TIPUS CHAR(3)
  • 4. DataObject Objectes com a propietats <ul><li>A CriteriAvaluacio la propietat Tipus es definia com: </li></ul><ul><ul><ul><li>Public Property Tipus() As String </li></ul></ul></ul><ul><ul><ul><li>Get </li></ul></ul></ul><ul><ul><ul><li>Me.VerifyData() </li></ul></ul></ul><ul><ul><ul><li>Return _tipus </li></ul></ul></ul><ul><ul><ul><li>End Get </li></ul></ul></ul><ul><ul><ul><li>Set(ByVal Value As String) </li></ul></ul></ul><ul><ul><ul><li>Me.VerifyData() </li></ul></ul></ul><ul><ul><ul><li>If Not IsNothing(Value) Then Value = Trim(Value) </li></ul></ul></ul><ul><ul><ul><li>If _tipus <> Value Then </li></ul></ul></ul><ul><ul><ul><li>_tipus = Value </li></ul></ul></ul><ul><ul><ul><li>Me.OnPropertyChanged(&quot;_tipus&quot;) </li></ul></ul></ul><ul><ul><ul><li>End If </li></ul></ul></ul><ul><ul><ul><li>End Set </li></ul></ul></ul><ul><ul><ul><li>End Property </li></ul></ul></ul>
  • 5. DataObject Objectes com a propietats <ul><li>Però ara el Tipus correspon a un objecte (que pot ésser un DataObject o no). </li></ul><ul><li>Volem accedir com si fos un objecte: </li></ul><ul><ul><ul><li>CriteriAvaluacio.Tipus.IdTipus = 3 </li></ul></ul></ul>
  • 6. DataObject Objectes com a propietats <ul><ul><ul><li>Public Property Tipus() As TipusCriteri </li></ul></ul></ul><ul><ul><ul><li>Get </li></ul></ul></ul><ul><ul><ul><li>Me.VerifyData() </li></ul></ul></ul><ul><ul><ul><li>If IsNothing(_TipusCriteri) Then </li></ul></ul></ul><ul><ul><ul><li>_TipusCriteri = New TipusCriteri(Me.SqlConnector) </li></ul></ul></ul><ul><ul><ul><li>_TipusCriteri.Key_IdTipus = _tipus </li></ul></ul></ul><ul><ul><ul><li>End If </li></ul></ul></ul><ul><ul><ul><li>Return _TipusCriteri </li></ul></ul></ul><ul><ul><ul><li>End Get </li></ul></ul></ul><ul><ul><ul><li>Set(ByVal Value As TipusCriteri) </li></ul></ul></ul><ul><ul><ul><li>Me.VerifyData() </li></ul></ul></ul><ul><ul><ul><li>If Not _TipusCriteri Is Value Then </li></ul></ul></ul><ul><ul><ul><li>_TipusCriteri = Value </li></ul></ul></ul><ul><ul><ul><li>Me.OnPropertyChanged(&quot;_tipus&quot;) </li></ul></ul></ul><ul><ul><ul><li>End If </li></ul></ul></ul><ul><ul><ul><li>End Set </li></ul></ul></ul><ul><ul><ul><li>End Property </li></ul></ul></ul>
  • 7. DataObject Objectes com a propietats Protected Overrides Sub InitializeObjectPointers () _TipusCriteri = Nothing End Sub Protected Overrides Sub FillCommandParameters (...) If Not IsNothing(_TipusCriteri) AndAlso _TipusCriteri.Exists Then .Item(&quot;:ID_TIPUS&quot;).Value = _TipusCriteri.Key_IdTipus Else If Me.IsSet(&quot;_tipus&quot;) And _tipus > 0 Then .Item(&quot;:ID_TIPUS&quot;).Value = _tipus End If End If End Sub

×