SlideShare a Scribd company logo
1 of 13
need help completing week 6 ilab.. i will upload what I
currently have if you know the material please let me know.
what the person to add on to what I currently have started.
iLab 6 of 7: Login and Security Levels (30 Points)
Submit your assignment to the Dropbox located on the silver tab
at the top of this page.
(See Syllabus "Due Dates for Assignments & Exams" for due
dates.)
i L A B O V E R V I E W
Scenario/Summary
In this week's lab, we will create a login form, validate a user
based on their login name and password, and allow them to
access the system or not. We will assign a session variable to
determine the level of security the user has and allow certain
functions to be displayed or not displayed in the existing
frmPersonnel form depending on the assigned security level.
(NOTE: In some cases the instructions for this lab will be less
specific than in earlier labs, because you are expected to apply
what you have learned in earlier weeks. Refer to the detailed
instructions in previous weeks' labs if you need to do so.)
Instructions for Week 6 iLab: Login and Security Levels
Click on the link above to view the tutorial.
Please watch this tutorial before beginning the iLab.
The tutorial has audio.
Deliverables
When you try to log in, if you use User Name = Mickey and
Password = Mouse, the frmMain form should open with all links
visible. If you use User Name = Minnie and Password = Mouse,
the frmMain form should open with only the Salary Calculator,
View Personnel, and Search options should be available. You
will have a new option called Manage Users that will allow you
to add new users and remove or update existing users. Once you
have verified that it works, save your website, zip up all files,
and submit in the Dropbox.
Note on database connections: We are using a SQLDataSource
control for the Edit employees feature we added. You should be
using the connection string stored in the web.config file for
your database connection for this control. Rather than creating a
new connection each time, just use this connection. If you
change the folder where your website is (e.g., you copy each
week's work to a new location), you will need to update the
web.config. The advantage of using the database connection in
the web.config is that you only have to set the configuration in
one location.
Before starting this week's lab, make sure everything is working
and that all database connections are properly configured.
i L A B S T E P S
STEP 1: Login Form (10 points)
Open Microsoft Visual Studio.NET 2008.
Click the ASP.NET website named PayrollSystem to open it.
Create a new web form named frmLogin.
Drop a login control onto the form.
Set the properties of the login control as follows:
PROPERTY
VALUE
DestinationPageUrl
frmMain.aspx
TitleText
Please enter your UserName and Password in order to log into
the system
Add the
Cool
Biz
Productions
, Inc.
logo to the frmLogin form. Do not hylerlink the logo.
Highlight everything in the form, then click Format, Justify,
Center. Save your work.
Go to the
Solution
Explorer, right-click on frmLogin, and left-click on Set As
Start Page. Then run the website to check if the web form
appears correctly.
Click on image to enlarge.
Login Form In Browser
Click here for text description of this image.
STEP 2: Login Check (10 points)
Create a new DataSet called dsUser. Use the table tblLogin as
the database table for this dataset. Do this in the same way you
added datasets in the previous labs.
Open the clsDataLayer and add the following function:
// This function verifies a user in the tblUser table
public static
dsUser VerifyUser(
string
Database,
string
UserName,
string
UserPassword)
{
// Add your comments here
dsUser DS;
OleDbConnection sqlConn;
OleDbDataAdapter sqlDA;
// Add your comments here
sqlConn =
new
OleDbConnection(
"PROVIDER=Microsoft.Jet.OLEDB.4.0;"
+
"Data Source="
+ Database);
// Add your comments here
sqlDA =
new
OleDbDataAdapter(
"Select SecurityLevel from tblUserLogin "
+
"where UserName like '"
+ UserName + "' " +
"and UserPassword like '"
+ UserPassword +
"'"
, sqlConn);
// Add your comments here
DS =
new
dsUser();
// Add your comments here
sqlDA.Fill(DS.tblUserLogin);
// Add your comments here
return
DS;
}
Double-click on the login control you added. Add the following
code to the login control Authenticate event handler:
// Add your comments here
dsUser
dsUserLogin;
// Add your comments here
string
SecurityLevel;
// Add your comments here
dsUserLogin =
clsDataLayer
.VerifyUser(Server.MapPath(
"PayrollSystem_DB.mdb"
),
Login1.UserName, Login1.Password);
// Add your comments here
if
(dsUserLogin.tblUserLogin.Count < 1)
{
e.Authenticated =
false
;
return
;
}
// Add your comments here
SecurityLevel =
dsUserLogin.tblUserLogin[0].SecurityLevel.ToString();
// Add your comments here
switch
(SecurityLevel)
{
case
"A"
:
// Add your comments here
e.Authenticated =
true
;
Session[
"SecurityLevel"
] =
"A"
;
break
;
case
"U"
:
// Add your comments here
e.Authenticated =
true
;
Session[
"SecurityLevel"
] =
"U"
;
break
;
default
:
e.Authenticated =
false
;
STEP 3: Test and Submit (10 points)
Open the frmPersonnel form and add the following code to its
Page_Load() function:
// Add your comments here
if (Session["SecurityLevel"] == "A") {
btnSubmit.Visible = true;
//Add your comments here
} else {
btnSubmit.Visible = false;
}
Set the start page as frmLogin.aspx. Run the website. Try to log
in with both User Name = Mickey and Password = Mouse and
User Name = Minnie and Password = Mouse. Any other user ID
and password should not allow you to log in.
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 the database
table tblUserLogin. Mickey Mouse has all privileges whereas
Minnie Mouse has read only privileges. We want to control the
visibility of the links on the frmMain page.
Initially we did not set the ID of any of the Link Button or
Image Button controls that we used on frmMain. In order to
make our code more maintainable we will change the IDs as
follows:
Option
Link Button ID
Image Button ID
Annual Salary Calculator
linkbtnCalculator
imgbtnCalculator
Add New Employee
linkbtnNewEmployee
imgbtnNewEmployee
View User Activity
linkbtnViewUserActivity
imgbtnViewUserActivity
View Personnel
linkbtnViewPersonnel
imgbtnViewPersonnel
Search Personnel
linkbtnSearch
imgbtnSearch
Edit Employees
linkbtnEditEmployees
imgbtnEditEmployees
Modify the main form so that the following options are turned
off for nonadmin users:
Add New Employee
View User Activity
Edit Employees
You now have a web application that honors the role of the
logged in user. We don't have a way of managing the user roles
and users in the system.
Add a new form called frmManageUsers that will allow the user
to add new users. The user will also need to be able to view all
users and modify or delete any of the users in the database. Add
a main form option called Manage Users that is only accessible
to admin users. Add the link and image buttons as we have done
in the past. Add the CoolBiz logo that is hyperlinked as you did
in previous assignments.
For the security level of the user, use a dropdown list control to
allow the user to select from A or U.
Name the controls with names that make sense.
Add code as appropriate to the code behind and clsDataLayer.
Hints:
Make sure you reestablish your database connection if you
copied the files from a previous lab.
Update any DataSource controls you added with the new Payroll
database location.
You can turn a control on or off by setting it's Visible property.
You can add a data entry form for new users and a grid
displaying all users all on the same form.
To force a gridView to refresh call its DataBind method.
In order to use the Advanced SQL Generation option (allowing
you to update/delete records) there must be a primary key
defined on the table you are generating SQL for. tblUserLogin
needs to have a primary key set on the UserID column. You can
do this in Access.
Test your application to make sure you are logging in with an
invalid user id. Try to log in with both Minnie and Mickey and
make sure the UI adjusts by the role properly. Make sure you
can utilize the Manage Users functionality to add/modify/delete
and view user information. Once you have verified that
everything works, save your project, zip up all files, and submit
in the Dropbox.
NOTE: Make sure you include comments in the code provided
where specified (where the " // Your comments here" is
mentioned); also, any code you write needs to be properly
commented, or else a five point deduction per item (form, class,
function) will be made.
Mickey Mouse (Admin)
Click on image to enlarge.
frmMain After Mickey Login
Click here for text description of this image.
Minnie Mouse (User)
Click on image to enlarge.
frmMain After Minnie Login
Click here for text description of this image.
frmManageUsers
Click on image to enlarge.
frmManageUsers
Click here for text description of this image.

More Related Content

Similar to Manage security levels and users

Cis407 a ilab 7 web application development devry university
Cis407 a ilab 7 web application development devry universityCis407 a ilab 7 web application development devry university
Cis407 a ilab 7 web application development devry universitylhkslkdh89009
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces  CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces HomeWork-Fox
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesccis224477
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesccis224477
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android ApplicationMark Lester Navarro
 
Claims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .newClaims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .newRavikantChaturvedi
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletMitchinson
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5Akhil Mittal
 
Previous weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxPrevious weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxkeilenettie
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classsdjdskjd9097
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacescis247
 
Cis247 i lab 4 composition and class interfaces
Cis247 i lab 4 composition and class interfacesCis247 i lab 4 composition and class interfaces
Cis247 i lab 4 composition and class interfacessdjdskjd9097
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Clarence Ngoh
 

Similar to Manage security levels and users (20)

Cis407 a ilab 7 web application development devry university
Cis407 a ilab 7 web application development devry universityCis407 a ilab 7 web application development devry university
Cis407 a ilab 7 web application development devry university
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Knockout in action
Knockout in actionKnockout in action
Knockout in action
 
CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces  CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfaces
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfaces
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android Application
 
ODI User and Security
ODI User and Security ODI User and Security
ODI User and Security
 
Claims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .newClaims based authentication in share point 2010 .new
Claims based authentication in share point 2010 .new
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutlet
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5
 
Previous weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxPrevious weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docx
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee class
 
Cis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfacesCis247 a ilab 4 composition and class interfaces
Cis247 a ilab 4 composition and class interfaces
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
Cis247 i lab 4 composition and class interfaces
Cis247 i lab 4 composition and class interfacesCis247 i lab 4 composition and class interfaces
Cis247 i lab 4 composition and class interfaces
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
 
Insight
InsightInsight
Insight
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
 

More from niraj57

Need help in doing two assignment, first one the topic will be Soci.docx
Need help in doing two assignment, first one the topic will be Soci.docxNeed help in doing two assignment, first one the topic will be Soci.docx
Need help in doing two assignment, first one the topic will be Soci.docxniraj57
 
Need for Cultural Competence Use this Discussion to practice as a .docx
Need for Cultural Competence Use this Discussion to practice as a .docxNeed for Cultural Competence Use this Discussion to practice as a .docx
Need for Cultural Competence Use this Discussion to practice as a .docxniraj57
 
need help in finance report,I already have report with all the b.docx
need help in finance report,I already have report with all the b.docxneed help in finance report,I already have report with all the b.docx
need help in finance report,I already have report with all the b.docxniraj57
 
Need help creating a very simple mobile game using Flash builder and.docx
Need help creating a very simple mobile game using Flash builder and.docxNeed help creating a very simple mobile game using Flash builder and.docx
Need help creating a very simple mobile game using Flash builder and.docxniraj57
 
Need help finsishing a potery explication esssay that i started,.docx
Need help finsishing a potery explication esssay that i started,.docxNeed help finsishing a potery explication esssay that i started,.docx
Need help finsishing a potery explication esssay that i started,.docxniraj57
 
Need discussion board type answers to the following questions. No wo.docx
Need discussion board type answers to the following questions. No wo.docxNeed discussion board type answers to the following questions. No wo.docx
Need discussion board type answers to the following questions. No wo.docxniraj57
 
Need at least a 200 min word response with a cited sourceI do .docx
Need at least a 200 min word response with a cited sourceI do .docxNeed at least a 200 min word response with a cited sourceI do .docx
Need at least a 200 min word response with a cited sourceI do .docxniraj57
 
Need by tomorrow 3pm estUse the Internet to research the various m.docx
Need by tomorrow 3pm estUse the Internet to research the various m.docxNeed by tomorrow 3pm estUse the Internet to research the various m.docx
Need by tomorrow 3pm estUse the Internet to research the various m.docxniraj57
 
Need assignment ASAP well written no plagiarism and own work= 1050 t.docx
Need assignment ASAP well written no plagiarism and own work= 1050 t.docxNeed assignment ASAP well written no plagiarism and own work= 1050 t.docx
Need assignment ASAP well written no plagiarism and own work= 1050 t.docxniraj57
 
Need as soon as possible1)Which of the following represent .docx
Need as soon as possible1)Which of the following represent .docxNeed as soon as possible1)Which of the following represent .docx
Need as soon as possible1)Which of the following represent .docxniraj57
 
Need Argumentative essay of minimum of 2000 words over sources below.docx
Need Argumentative essay of minimum of 2000 words over sources below.docxNeed Argumentative essay of minimum of 2000 words over sources below.docx
Need Argumentative essay of minimum of 2000 words over sources below.docxniraj57
 
Need Argumentative essay of minimum over sources below.  Essay needs.docx
Need Argumentative essay of minimum over sources below.  Essay needs.docxNeed Argumentative essay of minimum over sources below.  Essay needs.docx
Need Argumentative essay of minimum over sources below.  Essay needs.docxniraj57
 
Need a job description for the Miami Police Department. It was one o.docx
Need a job description for the Miami Police Department. It was one o.docxNeed a job description for the Miami Police Department. It was one o.docx
Need a job description for the Miami Police Department. It was one o.docxniraj57
 
Need answers ASAP!!1.Explain how the project manager measure.docx
Need answers ASAP!!1.Explain how the project manager measure.docxNeed answers ASAP!!1.Explain how the project manager measure.docx
Need answers ASAP!!1.Explain how the project manager measure.docxniraj57
 
Need a cost management plan that includes the followingCost Estim.docx
Need a cost management plan that includes the followingCost Estim.docxNeed a cost management plan that includes the followingCost Estim.docx
Need a cost management plan that includes the followingCost Estim.docxniraj57
 
Need all of this answeredPart IDefine the following term.docx
Need all of this answeredPart IDefine the following term.docxNeed all of this answeredPart IDefine the following term.docx
Need all of this answeredPart IDefine the following term.docxniraj57
 
Need an Essay in Humanites about .docx
Need an Essay in Humanites about .docxNeed an Essay in Humanites about .docx
Need an Essay in Humanites about .docxniraj57
 
need a paper written, no particular ampunt of words as long as the.docx
need a paper written, no particular ampunt of words as long as the.docxneed a paper written, no particular ampunt of words as long as the.docx
need a paper written, no particular ampunt of words as long as the.docxniraj57
 
Need 3 people to do assignment; Independent Challenge 1, Independent.docx
Need 3 people to do assignment; Independent Challenge 1, Independent.docxNeed 3 people to do assignment; Independent Challenge 1, Independent.docx
Need 3 people to do assignment; Independent Challenge 1, Independent.docxniraj57
 
Need a 300 word response to the below question 1 Peer reveiwed sou.docx
Need a 300 word response to the below question 1 Peer reveiwed sou.docxNeed a 300 word response to the below question 1 Peer reveiwed sou.docx
Need a 300 word response to the below question 1 Peer reveiwed sou.docxniraj57
 

More from niraj57 (20)

Need help in doing two assignment, first one the topic will be Soci.docx
Need help in doing two assignment, first one the topic will be Soci.docxNeed help in doing two assignment, first one the topic will be Soci.docx
Need help in doing two assignment, first one the topic will be Soci.docx
 
Need for Cultural Competence Use this Discussion to practice as a .docx
Need for Cultural Competence Use this Discussion to practice as a .docxNeed for Cultural Competence Use this Discussion to practice as a .docx
Need for Cultural Competence Use this Discussion to practice as a .docx
 
need help in finance report,I already have report with all the b.docx
need help in finance report,I already have report with all the b.docxneed help in finance report,I already have report with all the b.docx
need help in finance report,I already have report with all the b.docx
 
Need help creating a very simple mobile game using Flash builder and.docx
Need help creating a very simple mobile game using Flash builder and.docxNeed help creating a very simple mobile game using Flash builder and.docx
Need help creating a very simple mobile game using Flash builder and.docx
 
Need help finsishing a potery explication esssay that i started,.docx
Need help finsishing a potery explication esssay that i started,.docxNeed help finsishing a potery explication esssay that i started,.docx
Need help finsishing a potery explication esssay that i started,.docx
 
Need discussion board type answers to the following questions. No wo.docx
Need discussion board type answers to the following questions. No wo.docxNeed discussion board type answers to the following questions. No wo.docx
Need discussion board type answers to the following questions. No wo.docx
 
Need at least a 200 min word response with a cited sourceI do .docx
Need at least a 200 min word response with a cited sourceI do .docxNeed at least a 200 min word response with a cited sourceI do .docx
Need at least a 200 min word response with a cited sourceI do .docx
 
Need by tomorrow 3pm estUse the Internet to research the various m.docx
Need by tomorrow 3pm estUse the Internet to research the various m.docxNeed by tomorrow 3pm estUse the Internet to research the various m.docx
Need by tomorrow 3pm estUse the Internet to research the various m.docx
 
Need assignment ASAP well written no plagiarism and own work= 1050 t.docx
Need assignment ASAP well written no plagiarism and own work= 1050 t.docxNeed assignment ASAP well written no plagiarism and own work= 1050 t.docx
Need assignment ASAP well written no plagiarism and own work= 1050 t.docx
 
Need as soon as possible1)Which of the following represent .docx
Need as soon as possible1)Which of the following represent .docxNeed as soon as possible1)Which of the following represent .docx
Need as soon as possible1)Which of the following represent .docx
 
Need Argumentative essay of minimum of 2000 words over sources below.docx
Need Argumentative essay of minimum of 2000 words over sources below.docxNeed Argumentative essay of minimum of 2000 words over sources below.docx
Need Argumentative essay of minimum of 2000 words over sources below.docx
 
Need Argumentative essay of minimum over sources below.  Essay needs.docx
Need Argumentative essay of minimum over sources below.  Essay needs.docxNeed Argumentative essay of minimum over sources below.  Essay needs.docx
Need Argumentative essay of minimum over sources below.  Essay needs.docx
 
Need a job description for the Miami Police Department. It was one o.docx
Need a job description for the Miami Police Department. It was one o.docxNeed a job description for the Miami Police Department. It was one o.docx
Need a job description for the Miami Police Department. It was one o.docx
 
Need answers ASAP!!1.Explain how the project manager measure.docx
Need answers ASAP!!1.Explain how the project manager measure.docxNeed answers ASAP!!1.Explain how the project manager measure.docx
Need answers ASAP!!1.Explain how the project manager measure.docx
 
Need a cost management plan that includes the followingCost Estim.docx
Need a cost management plan that includes the followingCost Estim.docxNeed a cost management plan that includes the followingCost Estim.docx
Need a cost management plan that includes the followingCost Estim.docx
 
Need all of this answeredPart IDefine the following term.docx
Need all of this answeredPart IDefine the following term.docxNeed all of this answeredPart IDefine the following term.docx
Need all of this answeredPart IDefine the following term.docx
 
Need an Essay in Humanites about .docx
Need an Essay in Humanites about .docxNeed an Essay in Humanites about .docx
Need an Essay in Humanites about .docx
 
need a paper written, no particular ampunt of words as long as the.docx
need a paper written, no particular ampunt of words as long as the.docxneed a paper written, no particular ampunt of words as long as the.docx
need a paper written, no particular ampunt of words as long as the.docx
 
Need 3 people to do assignment; Independent Challenge 1, Independent.docx
Need 3 people to do assignment; Independent Challenge 1, Independent.docxNeed 3 people to do assignment; Independent Challenge 1, Independent.docx
Need 3 people to do assignment; Independent Challenge 1, Independent.docx
 
Need a 300 word response to the below question 1 Peer reveiwed sou.docx
Need a 300 word response to the below question 1 Peer reveiwed sou.docxNeed a 300 word response to the below question 1 Peer reveiwed sou.docx
Need a 300 word response to the below question 1 Peer reveiwed sou.docx
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 

Manage security levels and users

  • 1. need help completing week 6 ilab.. i will upload what I currently have if you know the material please let me know. what the person to add on to what I currently have started. iLab 6 of 7: Login and Security Levels (30 Points) Submit your assignment to the Dropbox located on the silver tab at the top of this page. (See Syllabus "Due Dates for Assignments & Exams" for due dates.) i L A B O V E R V I E W Scenario/Summary In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not. We will assign a session variable to determine the level of security the user has and allow certain functions to be displayed or not displayed in the existing frmPersonnel form depending on the assigned security level. (NOTE: In some cases the instructions for this lab will be less specific than in earlier labs, because you are expected to apply what you have learned in earlier weeks. Refer to the detailed instructions in previous weeks' labs if you need to do so.) Instructions for Week 6 iLab: Login and Security Levels Click on the link above to view the tutorial. Please watch this tutorial before beginning the iLab. The tutorial has audio. Deliverables When you try to log in, if you use User Name = Mickey and Password = Mouse, the frmMain form should open with all links visible. If you use User Name = Minnie and Password = Mouse, the frmMain form should open with only the Salary Calculator, View Personnel, and Search options should be available. You will have a new option called Manage Users that will allow you to add new users and remove or update existing users. Once you
  • 2. have verified that it works, save your website, zip up all files, and submit in the Dropbox. Note on database connections: We are using a SQLDataSource control for the Edit employees feature we added. You should be using the connection string stored in the web.config file for your database connection for this control. Rather than creating a new connection each time, just use this connection. If you change the folder where your website is (e.g., you copy each week's work to a new location), you will need to update the web.config. The advantage of using the database connection in the web.config is that you only have to set the configuration in one location. Before starting this week's lab, make sure everything is working and that all database connections are properly configured. i L A B S T E P S STEP 1: Login Form (10 points) Open Microsoft Visual Studio.NET 2008. Click the ASP.NET website named PayrollSystem to open it. Create a new web form named frmLogin. Drop a login control onto the form. Set the properties of the login control as follows: PROPERTY VALUE DestinationPageUrl frmMain.aspx TitleText Please enter your UserName and Password in order to log into the system Add the Cool Biz Productions , Inc. logo to the frmLogin form. Do not hylerlink the logo.
  • 3. Highlight everything in the form, then click Format, Justify, Center. Save your work. Go to the Solution Explorer, right-click on frmLogin, and left-click on Set As Start Page. Then run the website to check if the web form appears correctly. Click on image to enlarge. Login Form In Browser Click here for text description of this image. STEP 2: Login Check (10 points) Create a new DataSet called dsUser. Use the table tblLogin as the database table for this dataset. Do this in the same way you added datasets in the previous labs. Open the clsDataLayer and add the following function: // This function verifies a user in the tblUser table public static dsUser VerifyUser( string Database,
  • 4. string UserName, string UserPassword) { // Add your comments here dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Add your comments here sqlConn = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Add your comments here sqlDA = new OleDbDataAdapter(
  • 5. "Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'" , sqlConn); // Add your comments here DS = new dsUser(); // Add your comments here sqlDA.Fill(DS.tblUserLogin); // Add your comments here return DS; } Double-click on the login control you added. Add the following
  • 6. code to the login control Authenticate event handler: // Add your comments here dsUser dsUserLogin; // Add your comments here string SecurityLevel; // Add your comments here dsUserLogin = clsDataLayer .VerifyUser(Server.MapPath( "PayrollSystem_DB.mdb" ), Login1.UserName, Login1.Password); // Add your comments here if (dsUserLogin.tblUserLogin.Count < 1) {
  • 7. e.Authenticated = false ; return ; } // Add your comments here SecurityLevel = dsUserLogin.tblUserLogin[0].SecurityLevel.ToString(); // Add your comments here switch (SecurityLevel) { case "A" : // Add your comments here e.Authenticated =
  • 8. true ; Session[ "SecurityLevel" ] = "A" ; break ; case "U" : // Add your comments here e.Authenticated = true ; Session[ "SecurityLevel" ] = "U" ;
  • 9. break ; default : e.Authenticated = false ; STEP 3: Test and Submit (10 points) Open the frmPersonnel form and add the following code to its Page_Load() function: // Add your comments here if (Session["SecurityLevel"] == "A") { btnSubmit.Visible = true; //Add your comments here } else { btnSubmit.Visible = false; } Set the start page as frmLogin.aspx. Run the website. Try to log in with both User Name = Mickey and Password = Mouse and User Name = Minnie and Password = Mouse. Any other user ID and password should not allow you to log in. When the user logs in we want to restrict what they can see and
  • 10. do based on their user role. The role is stored in the database table tblUserLogin. Mickey Mouse has all privileges whereas Minnie Mouse has read only privileges. We want to control the visibility of the links on the frmMain page. Initially we did not set the ID of any of the Link Button or Image Button controls that we used on frmMain. In order to make our code more maintainable we will change the IDs as follows: Option Link Button ID Image Button ID Annual Salary Calculator linkbtnCalculator imgbtnCalculator Add New Employee linkbtnNewEmployee imgbtnNewEmployee View User Activity linkbtnViewUserActivity imgbtnViewUserActivity View Personnel linkbtnViewPersonnel imgbtnViewPersonnel Search Personnel linkbtnSearch
  • 11. imgbtnSearch Edit Employees linkbtnEditEmployees imgbtnEditEmployees Modify the main form so that the following options are turned off for nonadmin users: Add New Employee View User Activity Edit Employees You now have a web application that honors the role of the logged in user. We don't have a way of managing the user roles and users in the system. Add a new form called frmManageUsers that will allow the user to add new users. The user will also need to be able to view all users and modify or delete any of the users in the database. Add a main form option called Manage Users that is only accessible to admin users. Add the link and image buttons as we have done in the past. Add the CoolBiz logo that is hyperlinked as you did in previous assignments. For the security level of the user, use a dropdown list control to allow the user to select from A or U. Name the controls with names that make sense. Add code as appropriate to the code behind and clsDataLayer. Hints: Make sure you reestablish your database connection if you
  • 12. copied the files from a previous lab. Update any DataSource controls you added with the new Payroll database location. You can turn a control on or off by setting it's Visible property. You can add a data entry form for new users and a grid displaying all users all on the same form. To force a gridView to refresh call its DataBind method. In order to use the Advanced SQL Generation option (allowing you to update/delete records) there must be a primary key defined on the table you are generating SQL for. tblUserLogin needs to have a primary key set on the UserID column. You can do this in Access. Test your application to make sure you are logging in with an invalid user id. Try to log in with both Minnie and Mickey and make sure the UI adjusts by the role properly. Make sure you can utilize the Manage Users functionality to add/modify/delete and view user information. Once you have verified that everything works, save your project, zip up all files, and submit in the Dropbox. NOTE: Make sure you include comments in the code provided where specified (where the " // Your comments here" is mentioned); also, any code you write needs to be properly commented, or else a five point deduction per item (form, class, function) will be made. Mickey Mouse (Admin)
  • 13. Click on image to enlarge. frmMain After Mickey Login Click here for text description of this image. Minnie Mouse (User) Click on image to enlarge. frmMain After Minnie Login Click here for text description of this image. frmManageUsers Click on image to enlarge. frmManageUsers Click here for text description of this image.