Create a new dataset called dsuser

Assignment Help Database Management System
Reference no: EM13765074

Login and Security Levels

STEP 1: Login Form

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 productions 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.

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.

Reference no: EM13765074

Questions Cloud

Forward price and the initial value of the forward contract : A one-year long forward contract on a non-dividend-paying stock is entered into when the stock price is $40 $38 and the risk-free rate of interest is; 8% per annum with continuous compounding. What are the forward price and the initial value of the f..
Explain a problem in your community : Explain a problem in your community and how you might solve this problem if you were a police officer? Who might need to be involved in the process
Describe the process of developing and testing hypotheses : In 2-3 paragraphs describe the process of developing and testing hypotheses from our research questions. Provide at least ONE hypothesis from your research topic
Cost of equity capital with the new capital structure : The company has zero debt in its capital structure. Its overall cost of capital is 9%. The firm is considering a new capital structure with 50% debt. The interest rate on the debt would be 4%. Assuming that the corporate tax rate is 34%, what would b..
Create a new dataset called dsuser : 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.
Capital gain yield and dividend yield : Guy A bought a share of stock at the beginning of 2011 and sold this share of stock at $45 today (end of 2011). During this holding period, he received $5 cash dividend. His holding period return, capital gain yield and dividend yield are __, __, and..
What is the price of a share of stock : What is the price of a share of stock if the beta is 2, its next dividend is projected to be $4, and its growth rate is expected to be a constant 5%, assuming the market return is 16% and the risk free rate is 6%?
Aviation project : Preparation is the key to giving an effective presentation and to controlling your nervousness. Know your topic well. You will be the expert on the topic in the classroom
Compute break-even point at the operating profit level : Compute Break-Even Point at the operating profit level: Ensco Lighting Company has fixed costs of $100,000, sells its units for $28 and has variable costs of $15.50 per unit. Compute the breakeven point.

Reviews

Write a Review

Database Management System Questions & Answers

  How the difference between an outer join and an inner join

Give a primary key for each relation. Are there any relations for which there is an alternate candidate key which you have not chosen as the primary key? Why or why not?

  An academic department record point

An academic department record points earned by individual students in their classes

  Design er schema to keep track of information of votes

Design an er schema for keeping track of information about votes taken in the U.S. House of Representatives during the current two year congressional session.

  Data modeling and normalization

Data Modeling and Normalization

  Create query that spans both tables

Create a query that spans both tables. Eliminate redundant fields. Modify the Query to select only those Customers that had service dates in October and November 2006.

  Simple mobile database-replication and mobile database strat

For this assignment, you will create a simple mobile database application using any mobile database of your choice consisting of one or two tables. You may use the database you created in another unit or you may choose to create a new database to ..

  Ways of implementing one-to-one relationships

Describe the difference ways of implementing one-to-one relationships. Assume you are maintaining information on offices (office numbers, building, and phone numbers)

  Describe your idea of the database

Imagine that you have been hired by a company to build a database for it and complete the following tasks - modeling of business requirements and understand the physical implementation of logical business models through the use of E-R models.

  Prepare fully attributed data model

Use the results of the transcripts of an interview with IT consultant. Prepare a Fully Attributed Data Model. Add the data attributes for each entity."

  Create a new table named sportinggoods in database

Create a new table named SportingGoods to contain the columns PartNum, Description, OhHand, Warehouse, and Priced for all rows in which the item class is SG.

  Question 1 consider that you have been presented with the

question 1 consider that you have been presented with the subsequent relation for the baxter aviation database charters

  Part a major change definition and facilitating

part a major change definition and facilitating forces1.discuss the differences between a voluntary change and an

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd