23.05.2017 Views

CIS 407 DeVry iLab 6 of 7 latest

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tnSubmit.Visible = false; }<br />

13. Set the start page as frmLogin.aspx. Run the website. Try to log in with both User Name = Mickey and Password<br />

= Mouse and User Name = Minnie and Password = Mouse. Any other user ID and password should not allow you to<br />

log in.<br />

14. When the user logs in we want to restrict what they can see and do based on their user role. The role is stored in<br />

the database table tblUserLogin. Mickey Mouse has all privileges whereas Minnie Mouse has read only privileges. We<br />

want to control the visibility <strong>of</strong> the links on the frmMain page.<br />

15. Initially we did not set the ID <strong>of</strong> any <strong>of</strong> the Link Button or Image Button controls that we used on frmMain. In order<br />

to make our code more maintainable we will change the IDs as follows:<br />

Option Link Button ID Image Button ID<br />

Annual Salary Calculator linkbtnCalculator imgbtnCalculator<br />

Add New Employee linkbtnNewEmployee imgbtnNewEmployee<br />

View User Activity linkbtnViewUserActivity imgbtnViewUserActivity<br />

View Personnel linkbtnViewPersonnel imgbtnViewPersonnel<br />

Search Personnel linkbtnSearch imgbtnSearch<br />

Edit Employees linkbtnEditEmployees imgbtnEditEmployees<br />

16. Modify the main form so that the following options are turned <strong>of</strong>f for nonadmin users:<br />

o<br />

o<br />

o<br />

Add New Employee<br />

View User Activity<br />

Edit Employees<br />

17. You now have a web application that honors the role <strong>of</strong> the logged in user. We don't have a way <strong>of</strong> managing the<br />

user roles and users in the system.<br />

18. Add a new form called frmManageUsers that will allow the user to add new users. The user will also need to be<br />

able to view all users and modify or delete any <strong>of</strong> the users in the database. Add a main form option called Manage<br />

Users that is only accessible to admin users. Add the link and image buttons as we have done in the past. Add the<br />

CoolBiz logo that is hyperlinked as you did in previous assignments.<br />

o For the security level <strong>of</strong> the user, use a dropdown list control to allow the user to select from A or U.<br />

o<br />

o<br />

Name the controls with names that make sense.<br />

Add code as appropriate to the code behind and clsDataLayer.<br />

19. Hints:<br />

o<br />

o<br />

o<br />

o<br />

o<br />

Make sure you reestablish your database connection if you copied the files from a previous lab.<br />

Update any DataSource controls you added with the new Payroll database location.<br />

You can turn a control on or <strong>of</strong>f by setting it's Visible property.<br />

You can add a data entry form for new users and a grid displaying all users all on the same form.<br />

To force a gridView to refresh call its DataBind method.<br />

o In order to use the Advanced SQL Generation option (allowing you to update/delete records) there must be a<br />

primary key defined on the table you are generating SQL for. tblUserLogin needs to have a primary key set on the<br />

UserID column. You can do this in Access.<br />

20. Test your application to make sure you are logging in with an invalid user id. Try to log in with both Minnie and<br />

Mickey and make sure the UI adjusts by the role properly. Make sure you can utilize the Manage Users functionality to<br />

add/modify/delete and view user information. Once you have verified that everything works, save your project, zip up<br />

all files, and submit in the Dropbox.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!