Implementing OOP to Develop Database Oriented Applications using VB.NET 2005 - Developing the application (Page 6 of 6 )
Once you have developed all the core classes, the only part left is the presentation. The presentation is as simple as the following:
PublicClass Form1
Dim clnEmp As New Employees
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.DataGridView1.DataSource = EmployeeFactory.getList()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim ef As New EmployeeFactory
ef.add(New Employee(2001, "aaa", 4500, 20))
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ef As New EmployeeFactory
ef.delete(2001)
End Sub
EndClass
The explanation for all of the code will be part of an upcoming article. Please check back frequently or sign up for a newsletter.
The entire source code for this article is available in the form of a downloadable zip. The solution was developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows Server 2003 Enterprise Edition together with Microsoft SQL Server 2005 Developer Edition. I didn’t really test the solution with any other/previous editions. But I believe that the above code must execute even in .NET Framework 1.1. If you have any problems with executing the solution, please post in the discussion area.
Any feedback, suggestions, bugs, errors, improvements etc., are highly appreciated at jag_chat@yahoo.com.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |