Returning a value from a Namespace and shared Sub

Posts   
 
    
avarndel
User
Posts: 36
Joined: 14-Jun-2007
# Posted on: 21-Aug-2007 17:01:36   

I'm using the Bal to create all my process'

I have this class below and wanted to know is there a way to return values? I need to get a hold of the BId...

Namespace EntityClass Public Class xProjectRequest Inherits PBDAL.EntityClasses.XProjectRequestEntity Public Shared Sub AddProjectRequest(ByVal costCenterId As String, ByVal ClientName As String, ByVal ExpectedStartDate As Date, ByVal ExpectedEndDate As Date, ByVal RequestStatus As String, ByVal TotalSellAmt As Integer, ByVal RateCardID As Integer, ByVal Billings As Integer, ByVal Revenue As Integer, ByVal ProjDesc As String) Dim obj As New xProjectRequest Dim BId As Integer

        obj.CostCenterId = costCenterId
        obj.ClientName = ClientName
        obj.ExpectedStartDate = ExpectedStartDate
        obj.ExpectedEndDate = ExpectedEndDate
        obj.RequestStatus = RequestStatus
        obj.TotalSellAmt = TotalSellAmt
        obj.Billings = Billings
        obj.Revenue = Revenue
        obj.ProjDesc = ProjDesc
        obj.Save()
        BId = obj.BudReqId
    End Sub
End Class

End Namespace

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Aug-2007 11:15:44   

The question is unclear to me.

Is it related to LLBLGen Pro? If so would you please check the following guidelines: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7722

avarndel
User
Posts: 36
Joined: 14-Jun-2007
# Posted on: 22-Aug-2007 13:53:54   

Version 2.0 of llBLGen Pro.

Using the entityclass

VS 2005

Created a class using LLBLGen Pro and want to return a value after the data has been saved in a table.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Aug-2007 15:43:37   

Just declare an output parameter "ByRef" as follows:

Namespace EntityClass Public Class xProjectRequest Inherits PBDAL.EntityClasses.XProjectRequestEntity Public Shared Sub AddProjectRequest(ByVal costCenterId As String, ByVal ClientName As String, ByVal ExpectedStartDate As Date, ByVal ExpectedEndDate As Date, ByVal RequestStatus As String, ByVal TotalSellAmt As Integer, ByVal RateCardID As Integer, ByVal Billings As Integer, ByVal Revenue As Integer, ByVal ProjDesc As String, ByRef BId As Integer)

        Dim obj As New xProjectRequest

        obj.CostCenterId = costCenterId
        obj.ClientName = ClientName
        obj.ExpectedStartDate = ExpectedStartDate
        obj.ExpectedEndDate = ExpectedEndDate
        obj.RequestStatus = RequestStatus
        obj.TotalSellAmt = TotalSellAmt
        obj.Billings = Billings
        obj.Revenue = Revenue
        obj.ProjDesc = ProjDesc
        obj.Save()
        BId = obj.BudReqId
    End Sub
End Class

End Namespace