Link to home
Start Free TrialLog in
Avatar of mgcarney
mgcarney

asked on

Help with setting up a employee attendance interface.....

I am setting up an employee interface to keep track of start date, salary, hourly pay rate, vacation days, sick days (adding and subtracting), etc....  Can anyone point me into the right direction for some tutorial or something that will help out with this project?

Greatly appreciated...
Avatar of ktrimmer
ktrimmer

I am assuming that you are planning this to be a web-based application correct?

Is this going to be an Intranet site or an extranet site? (This choice will decide the type of security you will have)

I am also assuming that you plan to use a database to hold this information correct?

I am also assuming that the database is not created correct?

So First things first.
1. Create your database (ms-Access, MS-Sql, or MYSQL)

Let me know if my assumtions are correct and what type of database you wish to use then we will go from there.


Avatar of mgcarney

ASKER

Yes all of your assumptions are correct.
sql database
What program do you plan to develop this in?

Visual Studio,Front page, dreamweaver, or by hand?
front page and also I have set up the input for the employees, but now I need to know how to query the database and pull all of the employees up on a page, and each name with a link to their own.
I am assuming that you don't want employees to see each others information. So, we will need to have some type of log in.
Are your user all authenticaing to a windows domain? Or do you want them to fill out a login form. ?
well the only person besides myself having access at all is the HR Manager....
That being the case, you can always just set the securtiy on the folder in which the file is stored in.

Okay, let me process this I get back to you soon.
Okay 1st step
build your database.

Run this in Quary Analyzer

CREATE TABLE [dbo].[Employee] (
      [Id] [int] IDENTITY (1, 1) NOT FOR REPLICATION  NOT NULL ,
      [Start_Date] [datetime] NULL ,
      [Salary] [money] NULL ,
      [Pay_Rate] [decimal](18, 0) NULL ,
      [Total_Vac_Days] [int] NULL ,
      [Used_Vac_Days] [int] NULL ,
      [Total_Sck_Days] [int] NULL ,
      [Used_Sck_Days] [int] NULL ,
      [First_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
      [Middle_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
      [Last_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
      [Soc_Num] [varchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

You can make changes as needed.
Step Two
Put a test record in your database. Just open it up and fill in a record.

Step Three. Set up Authentication - Becuase we are using windows security, All we need to do is make a change in our Web.Config File. So,
1. At the root of your web site, add a file called Web.Config
Place this block of text in your file.

<configuration>
      <system.web>
            <identity impersonate="true" />
            <authorization>
                  <allow roles="DomainName\DomainGroup" />
                  <deny users="*" />
            </authorization>
      </system.web>
</configuration>

2. Change the Allow Roles section to match your domain. This allows only the group you identify and denies all other users.
3.Remove Anonymus users from IIS.
Step Three Test to make sure that your database and Web Server are going to function properly

1. create the page listed below.

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<Script runat="server">

Sub Page_Load
      Dim ConEmployees as SQLConnection
      Dim cmdSQL as SQLCommand
            
      ConEmployees = New SQLConnection ("Server=DatabaseServer;Database=DatabaseName;Integrated Security=SSPI")
      cmdSQL = New SQLCommand ("Select * from Employee",ConEmployees)
      ConEmployees.Open()
      dgrdEmployees.Datasource = cmdSQL.Executereader()
      dgrdEmployees.Databind()
      ConEmployees.Close()
End Sub

</Script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<asp:DataGrid
      ID="dgrdEmployees"
      Runat=Server />
</body>
</html>

2. change this line
ConEmployees = New SQLConnection ("Server=DatabaseServer;Database=DatabaseName;Integrated Security=SSPI")
to match the name of your database server and database name. The Integrated Security means that it uses windows authentication.

3. Browse out to your page and make sure you don't get any errors. You should see a table of you information.
Let me know when you get this far
OK done, but I am getting an access denied error
Are the error coming from when you veiw the web page. is it an SQL error or is it a windows error.
You are not authorized to view this page
You do not have permission to view this directory or page using the credentials that you supplied.
--------------------------------------------------------------------------------

Please try the following:

Contact the Web site administrator if you believe you should be able to view this directory or page.
Click the Refresh button to try again with different credentials.
HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Go to Microsoft Product Support Services and perform a title search for the words HTTP and 401.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Authentication, Access Control, and About Custom Error Messages.  
Server Error in '/' Application.
--------------------------------------------------------------------------------

Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: You do not have permission to view this directory or page using the credentials you supplied. Contact the Web server's administrator for help.

It looks like you need to goto the folder that has your website. Rigth Click , goto properties, on the security Tab, Add the group you want to have access to this site.

Just a thought, are you hosting this site on your own server or is someone else hosting it?
own server but I did that a very long time ago
Try createing this page called test.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
test
</body>
</html>

See if you can browse out to it. or check to see if you get the permission error
yep see it fine
Double check to make sure your useer account has access to that folder, give yourself full control for now. Also add the following account.

ASP.NET Machine acocunt

Give that account
Read & Execute
List Folders
Read
Write

Then try the page again.
OK done....now what?
Do you see a table of data from the .aspx page.?
yes I do
ASKER CERTIFIED SOLUTION
Avatar of ktrimmer
ktrimmer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial