BusinessBase.Save

BusinessBase.Save

Old forum URL: forums.lhotka.net/forums/t/4387.aspx


R_Raccoon posted on Thursday, February 21, 2008

I have a non-child Editable Root object that requires a property available in another object.  I was thinking about passing that object property to my Editable root on MyBase.Save but this function doesn't accept parameters.  This leads me to believe that I'm thinking of this all wrong.

Any suggestions?

Here's what my DataPortal_Insert sub might look like if I could pass in parameter -

<Transactional(TransactionalTypes.TransactionScope)> _

Protected Overloads Sub DataPortal_Insert(ByVal str as string)

Using cn As New SqlConnection(Utilities.DPNConnection)

cn.Open()

Using cm As SqlCommand = cn.CreateCommand

With cm

.CommandText = "AddDPNNote_sp"

.Parameters.AddWithValue("@alpano", str)

.Parameters.AddWithValue("@projectno", mProjectno)

.Parameters.Add(New SqlParameter("@newId", SqlDbType.Int)).Direction = ParameterDirection.Output

DoInsertUpdate(cm)

mID = CInt(.Parameters("@newId").Value)

End With

End Using

End Using

End Sub

JohnB replied on Friday, February 29, 2008

R_Raccoon:
I have a non-child Editable Root object that requires a property available in another object.


If I understand you correctly why can't you just create a property in your Editable Root that is the same as the other object?

As for passing in parameters, if it were a property, you could just access the private member like you would do for inserts or updates.

Perhaps I missing something...

Copyright (c) Marimer LLC