I am working on my first n tier project and having a lot of trouble getting my head around wirining it all up. I have a customer class
Just to test it out I put this is the Form Load EventVB Code:
Public Class Customer Inherits BOBase Private Const CN_CustomerCode As String = "CustomerCode" Private Const CN_CompanyName As String = "CompanyName" Private _CustomerCode As String Public Property CustomerCode() As String Get Return _CustomerCode End Get Private Set(ByVal value As String) _CustomerCode = value End Set End Property Private _CompanyName As String Public Property CompanyName() As String Get Return _CompanyName End Get Set(ByVal value As String) If _CompanyName <> value Then Dim propertyName As String = "CompanyName" Me.DataStateChanged(EntityStateEnum.Modified) _CompanyName = value End If End Set End Property Private Sub New() End Sub Public Shared Function Create(ByVal custCode As String) As Customer Dim cust As Customer Dim dt As DataTable dt = DAC.ExecuteDataTable("GetCustomerByCode_SP", _ DAC.parameter(CN_CustomerCode, custCode)) cust = New Customer() With dt.Rows(0) cust.CustomerCode = .Item(CN_CustomerCode).ToString cust.CompanyName = .Item(CN_CompanyName).ToString End With cust.DataStateChanged(EntityStateEnum.Unchanged) Return cust End Function End Class
Dim myCode As String = "ABC"
Me.CustomerBindingSource1.DataSource = Customer.Create(myCode)
Nothing comes up. I don't get an error or anything. The form just loads with out anything in the fields (I have bound them all). When I set a Break Point on the Me.CustomerBindingSource it doesn't stop there either. Is there something that I am missing?




Reply With Quote