تواجهني المشكلة التالية:
عندي كلاس وليكن خاص بالعملاء يحتوي على الاجراءات (اضافة عميل , حذف عميل , عرض بيانات عميل)
Public Class Customers
sub Add_Customer(ID as string,Name as string , Phone as string, Address as string)
'Some Code ....
End Sub
Sub Delete_Customer(ID as string)
'Some Code ....
End Sub
Sub Show_Info(ID as string , byref txtName as TextBox , byref txtPhone as TextBox ,byref txtAddress as TextBox)
Dim row as datarow
'---------------------------------------
'Getting Customer info into {row}
'----------------------------------------
txtName.text=row.item("Name")
txtPhone.text=row.item("Phone")
txtAddress.text=row.item("Address")
End Sub
End Classفي الكود التالي سوف استخدم Show_Info
Dim obj as new Customers
obj.Show_Info("1234",txtName,txtPhone,txtAddress) 'sending the TextBoxs byrefلا حظ أنني في الكود في الاجراء Show_Info أرسلت مربعات النص الخاصة بإسم العميل ورقم هاتفه وعنوانه
سؤالي هو هل عملي هذا صحيح وهل هنالك طريقة آخرى لعرض بيانات بإستخدام كلاس
وجزاكم الله خير
