|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
VB.Net
Hii Guys,
I can create the interface,but other staff kind confuse me. Here is the story were I need help. 2. Description This is consists of two forms that connect to a database. All database access should be performed at runtime in code. Your project should not include any data controls added at design time. Zip your final solution up into one single zip file and upload that via the subject website. The database file to be used in this Bus2011.mdb Exception Handling and comments will would be nice. Form 1: Login Form Your Login Form should look like the form in Figure 1. Figure 1: Login Form The Login form requires the user to enter a username and a password. When the user clicks the Login button, the Username and Password are used to authenticate the user against the Monash LDAP server using a Web Service. The Web Service is located at: URL This Web Service is passed two string arguments (username and password) and returns the following fields: 1. Auth Type Boolean 2. OrganisationalUnit Type String 3. Location Type String 4. Email Type String 5. ErrorReason Type String Hint: Define a structure containing the fields that the Web Service returns (or use the Web Services UserInfo class). The Login Form should contain the code that performs the following tasks: 1. Use the Web Service to authenticate the User. If the Auth field returned is True then the User has been authenticated 2. If User fails authentication display a message on a label that they should try again 3. If the User is authenticated you should a. Query the Access database supplied (BUS2011.mdb) to see if the user’s details are contained in the Users Table ("Select * From Users Where Username = '" & txtUsername.Text & "'" ) b. If no record exists INSERT a new record with the data returned by the Web Service ("INSERT INTO Users (UserName, OrganisationalUnit, Location, Email) values ('" & Username & "','" & OrganisationalUnit & "','" & Location & "','" & Email & "')" ) c. If a record exists for the user, check if any of their information has changed (i.e Web Service OrganisationalUnit, Location or Email is different from that on the database). If so update the database with the new data (“Update Users Set OrganisationalUnit & " = '" & Value & "'," & Location & " = '" & Value & "'," & eMail & " = '" & Value & "') Where Username = '" & Username & "'" ) d. Once these actions have been performed hide the login form and Show the second form in the project, the Users form Hints: Use helper Procedures like: Private Sub UpdateUser(ByVal Username As String, ByVal OrganisationalUnit As String, ByVal Location As String, ByVal Email As String) Private Sub InsertUser(ByVal Username As String, ByVal OrganisationalUnit As String, ByVal Location As String, ByVal Email As String) 3. Form 2: Users Form Your Users Form should look like the form in Figure 2. Figure 2: Users Form The Users form allows the user to navigate through the records contained in the Users table in the supplied database (BUS2011.mdb). The user can also add, delete and update records. Figure 3: Users Form when the Add New button has been clicked Hints: ConnectionString Property of the OleDbConnection Object = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data Source=C:\temp\BUS2011.mdb;Jet OLEDB:SFP=False" SQL Statements required for this form are: 1. "Select * from Users" 2. "Update Users set OrganisationalUnit = '" & txtOrganisationalUnit.Text & "', Location = '" & txtLocation.Text & "', email = '" & txtEmail.Text & "' where Username = '" & txtUsername.Text & "'" 3. "INSERT into Users (Username, OrganisationalUnit,Location,email) values ('" & txtUsername.Text & "','" & txtOrganisationalUnit.Text & "','" & txtLocation.Text & "','" & txtEmail.Text & "')" 4. "Delete from Users where Username = '" & txtUsername.Text & "'" The username textbox should not be enabled unless the user is adding a record. Use helper Procedures like: Private Sub FillDataSet() Destroy the dataview Create new DataSet object Open the Connection Create a new OleDbCommand object Set its Connection, CommandText and CommandType Properties Fill the Dataset Cerate and fill a new DataView object objCurrencyManager = CType(Me.BindingContext(objDataView), CurrencyManager) Close the Connection object Destroy the Dataset object Private Sub BindFields() Clear your control’s Bindings (Control.DataBinding.Clear method) Rebind the control’s Bindings (Control.DataBinding.Add method) Private Sub ShowPosition() Set the Record Position indicator textbox.Text Property These procedures should be called after ANY action is performed (other than basic navigation) All figures i.e figure 1,figure 2 and 3 plus the Bus2011.dbm file I did send as attachment. Jacinta 2. Description Form 1: Login Form Figure 1. 3. Form 2: Users Form Figure 2. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > VB.Net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|