SlideShare una empresa de Scribd logo
1 de 6
HELPIDO.COM
CLICK HERE TO GET THE SOLUTION !!!!!!!!
CIS 407 A – ILAB 6 OF 7
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)
1. Open Microsoft Visual Studio.NET 2008.
2. Click the ASP.NET website named PayrollSystem to open it.
3. Create a new web form named frmLogin.
4. Drop a login control onto the form.
5. 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
6. Add the CoolBizProductions, Inc. logo to the frmLogin form. Do not hylerlink the logo.
7. Highlight everything in the form, then click Format, Justify, Center. Save your work.
8. 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
9.
Click here for text description of this image.
STEP 2: Login Check (10 points)
9. 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.
10. Open the clsDataLayer and add the following function:
// This function verifies a user in the tblUser table
public staticdsUserVerifyUser(string Database, stringUserName, stringUserPassword)
{
// Add your comments here
dsUser DS;
OleDbConnectionsqlConn;
OleDbDataAdaptersqlDA;
// Add your comments here
sqlConn = newOleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + Database);
// Add your comments here
sqlDA = newOleDbDataAdapter("Select SecurityLevel from tblUserLogin " +
"where UserName like '" + UserName + "' " +
"and UserPassword like '" + UserPassword + "'", sqlConn);
// Add your comments here
DS = newdsUser();
// Add your comments here
sqlDA.Fill(DS.tblUserLogin);
// Add your comments here
return DS;
}
11. Double-click on the login control you added. Add the following code to the login control
Authenticate event handler:
// Add your comments here
dsUserdsUserLogin;
// Add your comments here
stringSecurityLevel;
// 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)
12. 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;
}
13. 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.
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 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.
15. 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
16. Modify the main form so that the following options are turned off for nonadmin users:
o Add New Employee
o View User Activity
o Edit Employees
17. 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.
18. 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.
o For the security level of the user, use a dropdown list control to allow the user to select
from A or U.
o Name the controls with names that make sense.
o Add code as appropriate to the code behind and clsDataLayer.
19. Hints:
o Make sure you reestablish your database connection if you copied the files from a
previous lab.
o Update any DataSource controls you added with the new Payroll database location.
o You can turn a control on or off by setting it's Visible property.
o You can add a data entry form for new users and a grid displaying all users all on the
same form.
o To force a gridView to refresh call its DataBind method.
o 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.
20. 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.
Cis 407 i lab 6 of 7

Más contenido relacionado

La actualidad más candente

Automation anywhere Training Materials
Automation anywhere Training MaterialsAutomation anywhere Training Materials
Automation anywhere Training MaterialsShekar S
 
Murach : How to work with session state and cookies
Murach : How to work with session state and cookiesMurach : How to work with session state and cookies
Murach : How to work with session state and cookiesMahmoudOHassouna
 
Salesforce connector Example
Salesforce connector ExampleSalesforce connector Example
Salesforce connector Exampleprudhvivreddy
 
Murach : HOW to work with controllers and routing
Murach : HOW to work with controllers and routingMurach : HOW to work with controllers and routing
Murach : HOW to work with controllers and routingMahmoudOHassouna
 
Cakephp's Cache
Cakephp's CacheCakephp's Cache
Cakephp's Cachevl
 
Introduction to ExtJS
Introduction to ExtJSIntroduction to ExtJS
Introduction to ExtJSArun Prasad
 
Parsing in ios to create an app
Parsing in ios to create an appParsing in ios to create an app
Parsing in ios to create an appHeaderLabs .
 
Automation Anywhere Case study
Automation Anywhere Case studyAutomation Anywhere Case study
Automation Anywhere Case studyShekar S
 
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appBeginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appKaty Slemon
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 
Mule using Salesforce
Mule using SalesforceMule using Salesforce
Mule using SalesforceKhasim Cise
 
JPQL/ JPA Activity 2
JPQL/ JPA Activity 2JPQL/ JPA Activity 2
JPQL/ JPA Activity 2SFI
 
IMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to TavernaIMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to TavernaIMPACT Centre of Competence
 
Cis 407 i lab 4 of 7
Cis 407 i lab 4 of 7Cis 407 i lab 4 of 7
Cis 407 i lab 4 of 7helpido9
 
10 ways to bind multiple models on a view in mvc code project
10 ways to bind multiple models on a view in mvc   code project10 ways to bind multiple models on a view in mvc   code project
10 ways to bind multiple models on a view in mvc code projectAkshat Kumar
 

La actualidad más candente (20)

Automation anywhere Training Materials
Automation anywhere Training MaterialsAutomation anywhere Training Materials
Automation anywhere Training Materials
 
Murach : How to work with session state and cookies
Murach : How to work with session state and cookiesMurach : How to work with session state and cookies
Murach : How to work with session state and cookies
 
Salesforce connector Example
Salesforce connector ExampleSalesforce connector Example
Salesforce connector Example
 
Murach : HOW to work with controllers and routing
Murach : HOW to work with controllers and routingMurach : HOW to work with controllers and routing
Murach : HOW to work with controllers and routing
 
Cakephp's Cache
Cakephp's CacheCakephp's Cache
Cakephp's Cache
 
Wheels
WheelsWheels
Wheels
 
Introduction to ExtJS
Introduction to ExtJSIntroduction to ExtJS
Introduction to ExtJS
 
Parsing in ios to create an app
Parsing in ios to create an appParsing in ios to create an app
Parsing in ios to create an app
 
Automation Anywhere Case study
Automation Anywhere Case studyAutomation Anywhere Case study
Automation Anywhere Case study
 
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appBeginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 
Mule using Salesforce
Mule using SalesforceMule using Salesforce
Mule using Salesforce
 
Ebook8
Ebook8Ebook8
Ebook8
 
Web based development
Web based developmentWeb based development
Web based development
 
JPQL/ JPA Activity 2
JPQL/ JPA Activity 2JPQL/ JPA Activity 2
JPQL/ JPA Activity 2
 
IMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to TavernaIMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to Taverna
 
Cis 407 i lab 4 of 7
Cis 407 i lab 4 of 7Cis 407 i lab 4 of 7
Cis 407 i lab 4 of 7
 
10 ways to bind multiple models on a view in mvc code project
10 ways to bind multiple models on a view in mvc   code project10 ways to bind multiple models on a view in mvc   code project
10 ways to bind multiple models on a view in mvc code project
 
Mahoodle (English)
Mahoodle (English)Mahoodle (English)
Mahoodle (English)
 
Testy integracyjne
Testy integracyjneTesty integracyjne
Testy integracyjne
 

Destacado

Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7helpido9
 
Planning booklet
Planning bookletPlanning booklet
Planning bookletdavidjhorne
 
City of god
City of godCity of god
City of godlosane
 
Técnicas de estudio
Técnicas de estudioTécnicas de estudio
Técnicas de estudioASTRIDBONE
 
Proceso penal. personas con discapacidad.
Proceso penal. personas con discapacidad.Proceso penal. personas con discapacidad.
Proceso penal. personas con discapacidad.José María
 
Phonotonic Press Release June 2015 Eng
Phonotonic Press Release June 2015 EngPhonotonic Press Release June 2015 Eng
Phonotonic Press Release June 2015 EngPhonotonic
 
Movimientos sociales y Tecnopolítica: Tecnoactivismo
Movimientos sociales y Tecnopolítica: TecnoactivismoMovimientos sociales y Tecnopolítica: Tecnoactivismo
Movimientos sociales y Tecnopolítica: TecnoactivismoImma Aguilar Nàcher
 
Community walk keynote 2
Community walk keynote 2Community walk keynote 2
Community walk keynote 2caitlinsherlock
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7helpido9
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7helpido9
 
Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7helpido9
 
Informe de responsabilidad fiscal Septiembre 2014
Informe de responsabilidad fiscal Septiembre 2014Informe de responsabilidad fiscal Septiembre 2014
Informe de responsabilidad fiscal Septiembre 2014Eduardo Nelson German
 
Presentation IEEEmadC
Presentation IEEEmadCPresentation IEEEmadC
Presentation IEEEmadCAbir Chermiti
 

Destacado (19)

Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7
 
Exhibition pp
Exhibition ppExhibition pp
Exhibition pp
 
Planning booklet
Planning bookletPlanning booklet
Planning booklet
 
City of god
City of godCity of god
City of god
 
Técnicas de estudio
Técnicas de estudioTécnicas de estudio
Técnicas de estudio
 
Proceso penal. personas con discapacidad.
Proceso penal. personas con discapacidad.Proceso penal. personas con discapacidad.
Proceso penal. personas con discapacidad.
 
Mkk d330
Mkk d330Mkk d330
Mkk d330
 
ibuyer_Manual
ibuyer_Manualibuyer_Manual
ibuyer_Manual
 
Phonotonic Press Release June 2015 Eng
Phonotonic Press Release June 2015 EngPhonotonic Press Release June 2015 Eng
Phonotonic Press Release June 2015 Eng
 
Movimientos sociales y Tecnopolítica: Tecnoactivismo
Movimientos sociales y Tecnopolítica: TecnoactivismoMovimientos sociales y Tecnopolítica: Tecnoactivismo
Movimientos sociales y Tecnopolítica: Tecnoactivismo
 
Community walk keynote 2
Community walk keynote 2Community walk keynote 2
Community walk keynote 2
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7
 
DEEPAK[1]_(5)(1)
DEEPAK[1]_(5)(1)DEEPAK[1]_(5)(1)
DEEPAK[1]_(5)(1)
 
Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7Cis 407 i lab 2 of 7
Cis 407 i lab 2 of 7
 
Informe de responsabilidad fiscal Septiembre 2014
Informe de responsabilidad fiscal Septiembre 2014Informe de responsabilidad fiscal Septiembre 2014
Informe de responsabilidad fiscal Septiembre 2014
 
Presentation IEEEmadC
Presentation IEEEmadCPresentation IEEEmadC
Presentation IEEEmadC
 
Limitless rough final
Limitless rough finalLimitless rough final
Limitless rough final
 
1 1
1 11 1
1 1
 

Similar a Cis 407 i lab 6 of 7

need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxniraj57
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxsmile790243
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universitylhkslkdh89009
 
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
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5Akhil Mittal
 
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
 
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universityCis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universitylhkslkdh89009
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010vchircu
 
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
 
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
 
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
 
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
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGiuliano Iacobelli
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworksVishwanath KC
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)IT PROGRAMMING WORLD
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docxhoney690131
 

Similar a Cis 407 i lab 6 of 7 (20)

need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docx
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry university
 
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
 
Diving into VS 2015 Day5
Diving into VS 2015 Day5Diving into VS 2015 Day5
Diving into VS 2015 Day5
 
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
 
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universityCis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry university
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
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
 
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
 
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
 
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
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplications
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworks
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx
 

Último

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Último (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Cis 407 i lab 6 of 7

  • 1. HELPIDO.COM CLICK HERE TO GET THE SOLUTION !!!!!!!! CIS 407 A – ILAB 6 OF 7 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) 1. Open Microsoft Visual Studio.NET 2008.
  • 2. 2. Click the ASP.NET website named PayrollSystem to open it. 3. Create a new web form named frmLogin. 4. Drop a login control onto the form. 5. 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 6. Add the CoolBizProductions, Inc. logo to the frmLogin form. Do not hylerlink the logo. 7. Highlight everything in the form, then click Format, Justify, Center. Save your work. 8. 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 9. Click here for text description of this image. STEP 2: Login Check (10 points) 9. 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. 10. Open the clsDataLayer and add the following function: // This function verifies a user in the tblUser table public staticdsUserVerifyUser(string Database, stringUserName, stringUserPassword) { // Add your comments here dsUser DS; OleDbConnectionsqlConn; OleDbDataAdaptersqlDA; // Add your comments here sqlConn = newOleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database);
  • 3. // Add your comments here sqlDA = newOleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Add your comments here DS = newdsUser(); // Add your comments here sqlDA.Fill(DS.tblUserLogin); // Add your comments here return DS; } 11. Double-click on the login control you added. Add the following code to the login control Authenticate event handler: // Add your comments here dsUserdsUserLogin; // Add your comments here stringSecurityLevel; // 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;
  • 4. default: e.Authenticated = false; STEP 3: Test and Submit (10 points) 12. 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; } 13. 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. 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 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. 15. 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 16. Modify the main form so that the following options are turned off for nonadmin users: o Add New Employee o View User Activity o Edit Employees 17. 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.
  • 5. 18. 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. o For the security level of the user, use a dropdown list control to allow the user to select from A or U. o Name the controls with names that make sense. o Add code as appropriate to the code behind and clsDataLayer. 19. Hints: o Make sure you reestablish your database connection if you copied the files from a previous lab. o Update any DataSource controls you added with the new Payroll database location. o You can turn a control on or off by setting it's Visible property. o You can add a data entry form for new users and a grid displaying all users all on the same form. o To force a gridView to refresh call its DataBind method. o 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. 20. 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.