Hi,
I have a function with a large number of variable arguments, it is public and therefore using the optional keyword is not recommended.
How else could this de done, overloading would be a nightmare.
Here is the functin :
Public Function GetPayments(ByVal MerchantCompanyName As String, ByVal InvoiceStatus As String, _
ByVal PayoutStatus As String, ByVal ProductName As String, _
ByVal AffiliateCompanyName As String, ByVal NETPayout As String, _
ByVal VATPayout As String, ByVal StartDate As String, _
ByVal EndDate As String, ByVal InvoicePayoutID As String, _
ByVal CountryID As System.Nullable(Of Integer), ByVal AgencyID As System.Nullable(Of Integer), _
ByVal CurrentPage As System.Nullable(Of Integer), ByVal PageSize As System.Nullable(Of Integer), _
ByRef TotalRecords As System.Nullable(Of Integer)) As DataTable
Using objadapter As New DAL.dsPaymentsTableAdapters.ta_InvoicePayoutStatsTableAdapter
Return objadapter.GetData(MerchantCompanyName, InvoiceStatus, PayoutStatus, ProductName, AffiliateCompanyName, _
NETPayout, VATPayout, StartDate, EndDate, InvoicePayoutID, CountryID, AgencyID, _
CurrentPage, PageSize, TotalRecords)
End Using
End Function
Thankd
I have a function with a large number of variable arguments, it is public and therefore using the optional keyword is not recommended.
How else could this de done, overloading would be a nightmare.
Here is the functin :
Public Function GetPayments(ByVal MerchantCompanyName As String, ByVal InvoiceStatus As String, _
ByVal PayoutStatus As String, ByVal ProductName As String, _
ByVal AffiliateCompanyName As String, ByVal NETPayout As String, _
ByVal VATPayout As String, ByVal StartDate As String, _
ByVal EndDate As String, ByVal InvoicePayoutID As String, _
ByVal CountryID As System.Nullable(Of Integer), ByVal AgencyID As System.Nullable(Of Integer), _
ByVal CurrentPage As System.Nullable(Of Integer), ByVal PageSize As System.Nullable(Of Integer), _
ByRef TotalRecords As System.Nullable(Of Integer)) As DataTable
Using objadapter As New DAL.dsPaymentsTableAdapters.ta_InvoicePayoutStatsTableAdapter
Return objadapter.GetData(MerchantCompanyName, InvoiceStatus, PayoutStatus, ProductName, AffiliateCompanyName, _
NETPayout, VATPayout, StartDate, EndDate, InvoicePayoutID, CountryID, AgencyID, _
CurrentPage, PageSize, TotalRecords)
End Using
End Function
Thankd