Professional Documents
Culture Documents
CSUSB ScholarWorks
2008
Recommended Citation
Parikh, Arpita Prashant, "Itimecard timesheet management system" (2008). Theses Digitization Project.
3421.
https://scholarworks.lib.csusb.edu/etd-project/3421
This Project is brought to you for free and open access by the John M. Pfau Library at CSUSB ScholarWorks. It has
been accepted for inclusion in Theses Digitization Project by an authorized administrator of CSUSB ScholarWorks.
For more information, please contact scholarworks@csusb.edu.
ITIMECARD TIMESHEET MANAGEMENT SYSTEM
A Project
Presented to the
Faculty of
San Bernardino
In Partial Fulfillment
Master of Science
in
Computer Science
by
March 2008
ITIMECARD TIMESHEET MANAGEMENT SYSTEM
A Project
Presented to the
Faculty of
San Bernardino
by
March 2008
Approved by:
Dr.
Dr.
ABSTRACT
iii
only a few steps to fill out the time sheet using a web
iv
ACKNOWLEDGEMENTS
this paper.
v
TABLE OF CONTENTS
ABSTRACT................................................. iii
ACKNOWLEDGEMENTS........................................ v
LIST OF FIGURES......................................... x
1.2 Background.................................... 2
4.1 Overview...................................... 37
vi
CHAPTER FIVE: TESTING
5.2 Problems...................................... 71
REFERENCES............................................... .123
vii
LIST OF TABLES
viii
Table 23. Test Case of Manage Submitted Timesheet...... 65
ix
LIST OF FIGURES
x
Figure 23. Add Employee Screen....'..................... 94
xi
CHAPTER ONE
INTRODUCTION
1
also allows employees to resubmit or modify their
timesheets.
1.2 Background
2
transactions, iSpace has decided to develop the iTimeCard
System.
5 -•
) Staff Member Name)
a
3
Phone Number i For Week Ended Friday 05/25/07
I: SA SU M TU .W . TH F Totals
0 Client 5/19/2007 5/20/2007 5/21/2007 5/22/2007 5/23/2007 5/24/2007 5/25/2007
2 Project 0.00
3 Project 0.00
4: Project 0.00
5: Project 0.00
6 Holiday 0.00
0.00
9 • 0.00
3
projects for the same client, only one timesheet needs to
name they are working on and the number of hours they have
process.
4
Figure 2. Timesheet Submission Process
5
CHAPTER TWO
roles:
• Administrator (admin)
• Users
6
Figure 3. Use Case Diagram
7
Add a New Employee:
billing purpose.
Business
Step User Action System Response
Rules
- Add new
Employee page
is displayed
User clicks on
- All projects
Add button on
1 None must be listed
Employee List
in Available
page
Project list
box
assign to added to
8
employee (> Assigned
from Available
Project list
box
- The selected
project must be
projects to Available
Project list
box
Name displayed in
9
and are met, data
be in database
t format displayed to
- View Employee
list screen
must be
displayed
- View Employee
page is
displayed
User click on
5 None - Will not save
Go Back button
any changes
made in any
field
10
Add a New Project:
Business
Step User Action System Response
Rules
User clicks on
- Add new Project
Add button on
1 None page is
Project List
displayed
page
Name displayed in
11
be in database
t format displayed to
- View Project
list screen
must be
displayed
- Project Name,
Client Name,
Client Manager,
User click on
3 None Is Active and
Clear button
Is billable
field should be
empty
- View Project
page is
User click on
4 None displayed
Go Back
- Will not save
any changes
12
made in any
field
View employee:
Business
Step User Action System Response
Rules
- View Employee
page is
displayed
- Employee name,
User clicks on
1 None Login ID, Email
Employee link
and IsRSM
should be
display in data
grid
13
- Refer to Delete
User clicks on
2 None Employee Use
Delete link
Case
button Case
View project:
system.
Business
Step User Action System Response
Rules
14
displayed
- Project Name,
i
i
Client Name,
Client Manager,
l
i Is Active and
1
1 Is Billable
1
i should be
■ 1
display in data
i
i
grid
i
1 - Refer to Delete
User clicks on
2 1 None Project Use
Delete link
i
Case
15
Delete a project:
I
This gse case deals with deleting a project in case
i
project is 'wrongly entered in the system.
Business
Step User1 Action System Response
Rules
- Should delete
1
the selected
1
1 proj ect
User , click on
information
Delete Link on
I - If project is
1 the data grid None
assigned to
of the Project
employee then
list
user should not
I
able to delete
I
the record
16
I
Delete an Employee:
with iSpace1.
i
Business
Step User Action System Response
Rules
User j click on
- Should delete
Delet,e Link on
i the selected
1 the data grid None
I
employee
of the
information
Employee list
i
17
Edit Employee information:
Business
Step User Action System-Response
Rules
Update Employee
page
up in the
update employee
page.
18
- Email validated
be in database
t format displayed to
- View Employee
list screen
must be
displayed
19
Edit Project information:
Business
Step User Action System Response
Rules
Update Project
page
up in the
update employee
page.
20
be blank rules are
- Client validated
must be saved
in database
- Message must be
displayed to
the user,
stating that
-
data is saved '
- View Project
list screen
must be
displayed
21
Administration manages submitted timesheet:
resubmission if required.
Business
Step User Action System Response
Rules
Submitted timesheet
Admin click on
2 None must be open in view
Timesheet link
mode
Delete the
TimeCard must be
3 timesheet if None
deleted
any
22
information is
incorrect
Create a Timecard:
Business
Step User Action System Response
Rules
the Timesheet.
- A timesheet
User click on
should open
the Timesheet
2 None using Window
link to open
Authentication.
the Timesheet
- Project should
23
be populated
into dropdown
each user.
Select the
Project from
3 None None
drop down
list.
Ending day
Select the
cannot be
4 ending day for -
greater than
that week
today's date
- Should open up
timesheet page
business rules
Click on
are met.
5 "Create the None
- The employee
Timecard"
name, Client
Name and
Project Name
should be
24
carried forward
to next page
- Initially all
hours should be
zero.
- Date should be
filled out
according to
previous screen
information
- Submit button
should be
inactive
25
Submitting the timesheet:
- Total= hour
work +
Holiday +
Users fills - Should show
Paid Time
out hours they total according
1 Out
for selected to business
- Hours
proj ect rule
cannot be
great than
24 hrs
26
acknowledgement is correct
- Send email
to account
into
SharePoint
27
2.2 Conceptual Model
Relationship) diagram.1
28
Project is an entity type that contains attributes
HolidayHrs.
many relationship.
try
{
loginlD = e.Inputparameters["login"] ;
}
catch (Exception ex)
{
loginlD = "ruship";
}
29
All code is written in a try block and if exception is
tables.
screen.
30
iTimeCard, the login id is retrieved by code written in
VSTA.
applicable.
31
CHAPTER THREE
Markup Language).
InfoPath forms can get data from many data sources and
32
Visual Studio IDE in order to write custom code in .Net
languages.
Application (VSTA).
33
Runtime) is the core part of the Microsoft Framework and
also of ASP.NET.
is required.
friendly.
34
stored procedures, views, triggers and user defined
functions.
technology.
35
that help to store and supply information essential to an
organization.
using the web browser. The end users need not have InfoPath
36
CHAPTER FOUR
4.1 Overview
37
4.2 Architecture
38
fill out and submit this form, he/she needs to login to the
out a timesheet.
39
contains project information. Whereas, the ProjectEmployee
Project * '
ProjeccID
*
Employee:
ai. EmployeelD
LogonlD
u ProjectName
ClientName
F FullName
! ClientManager
IsActive
Email.
r~ IsRSM
F IsBillable
ProjectEmployee
|i~T| ProjectlD^
P?| EmployeelD
40
Table 12. Employee Table Description
Name Null
the table
- Auto Generate by
the system.
Domain\Username
the table
regular or not
address of an
employee
41
Table 13. Project Table Description
type Null
the table
- Auto Generate by
the system.
50) client
50) manager
project or not
billable or not
42
Table 14. ProjectEmployee' Table Description
Name Null
Employee table
43
CHAPTER FIVE
TESTING
billing purposes.
44
Table 15. Test Case of Add Employee
Actual
Resu
Output
Test User It
Expected Output in case
ID Action (P/F
of
)
Failure
User
clicks on -
Employee
List page
User
Add be listed in
2 P -
button on Available Project
List page
45
to and removed from
button)
User
to added to Available
button)
User
clicks on
save & go
Message must be
back
displayed for the
5 button p
same
and
Employee
Name is
blank
46
User
clicks on
save & go
is blank
or
incorrect
format
User
clicks on
and
LoginlD
is blank
clicks on in database
8
P
save & go And Message must
back be displayed to
47
button the user, stating
business
-
rules are
met
User
clicks on
save & go
back
View Employee list
button
screen must be
and all
9 displayed with the -
P
business
new records added
rules are
to the list
met and
data is
saved to
database
48
Add a New Project:
Actual
Resu
Output
Test User It
Expected Output in case
ID Action (P/F
of
)
Failure
User
clicks on -
Proj ect
List page
User
Message must be
clicks on
displayed for the
2 save & go
P
same
back
button
49
and
Pro j ect
Name is
blank
User
clicks on
save & go
Message must be
back
displayed for the .
3 button -
P
same
and
Client
Name is
blank
User
clicks on
Data must be saved
save & go
in database
back
And Message must
4 button -
P
be displayed to
and all
the user, stating
business
that data is saved
rules are
met
50
User
clicks on
save & go
back
View Project list
button
screen must be
and all
5 displayed with the -
P
business
new records added
rules are
to the list
met and
data is
saved to
database
51
View employee:
Actual
Resu
Output
Test User It
Expected Output in case
ID Action (P/F
of
)
Failure
User
clicks on -
Master
page
Master grid
52
page
User -
on
User
Record must be
clicks on
4 deleted from the -
P
delete
database
link
User
button
53
View project:
system.
Actual
Resu
Output
Test User It
Expected Output in case
ID Action (P/F
of
)
Failure
User
clicks on
Master
page
54
proj ect the database must
Master grid
page
User
name link
User
Record must be
clicks on
4 deleted from the -
P
delete
database
link
User
button
55
Delete an Employee:
with iSpace.
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
User
clicks on
Employee
page
56
Delete a project:
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
User
Record must be
clicks on
deleted from the
delete
database if
1 link the -
P
project is not
View
assigned to
Proj ect
employee
page
57
assigned to database
employee if
proj ect
is
assigned
to
employee
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
58
employee And all
informati
on on
View
Employee
page
User
clicks on
save & go
Message must be
back
displayed for the
2 button -
P
same
and
Employee
Name is
blank
back
59
button
and Email
is blank
or
incorrect
format
User
clicks on
and
LoginlD
is blank
User
rules are
60
met
User
clicks on
save & go
back
View Employee List
button
screen must be
and all
6 displayed with the -
P
business
updated records to
rules are
the list
met and
data is
saved to
database
61
Edit Project information:
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
User
click on
proj ect
Add New Project
name link
page is displayed.
to edit
All information of
1 employee -
P
selected project
informati
must be populated
on on the
into that page.
View
Proj ect
page
62
User
clicks on
save & go
Message must be
back
displayed for the
2 button -
P
same
and
Proj ect
Name is
blank
User
clicks on
save & go
Message must be
back
displayed for the
3 button -
P
same
and
Client
Name is
blank
clicks on in database
4 -
P
save & go And Message must
back be displayed to
63
button the user, stating
business
rules are
met
User
clicks on
save & go
back
View Project List
button
screen must be
and all
5 displayed with the -
P
business
updated record to
rules are
the list
met and
data is
saved to
database
64
Administration manages submitted timesheet:
resubmission if required.
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
Admin
type the
submitted
timesheet
65
timesheet listed
link
Delete
the
timesheet
Timecard is
3 if any -
P
deleted
informati
on is
incorrect
Create a Timecard:
Actual
66
Failure
Employee
1 URL to timesheet is
P
-
create a displayed.
timesheet
User
click on
2
Timesheet
link to
to that employee
is populated into
P
-
create dropdown list box
the
Timesheet
User
click on
"Create Message is
3
the
Timecard"
Displayed for the
same P
-
and
Ending
date is
not
greater
than
today's
date
User
click on
Timesheet page is
"Create
displayed with
the
employee name,
4 Timecard" -
ir
client name and
and all
project name
business
populated
rules are
met
On load
Initially all
of
5 hours is zero. -
Jr
timesheet
page
of according to
6
p
timesheet previous screen
page information
68
On load
7
of
timesheet
Submit button is
inactive P
-
page
1
Actual
Output
Test User Resu
Expected Output It in case
ID Action (P/F
) of
Failure
1
Users
fills out
Total is updated
accordingly
P
-
69
hours
they have
worked
for
selected
proj ect
Check the
checkbox
Submit button is
2 regarding -
P
activated
acknowled
gement
Click on
Email sent to
3 submit -
P
account department
button
Click on A timesheet is
70
5.2 Problems
got two errors. One was that the product required .Net
repairing.
71
To solve these errors, first I installed Framework 3.0
needs repairing.
72
After repairing .Net Framework 2.0, Microsoft
73
CHAPTER SIX
74
SharePoint Products and Technologies Configuration Wizard
A
Connect to a server farm
A server farm is a collection of two or more computers that share configuration data, Do you’want to
connect to an existing server farm? . ‘ :
5 i
1-
0-Yes, I want to connect to an existing server farm
<■
® No, I want to create a new server farm
S4-
------- f
»
' < Back |< Next >’ Cancel
:-7 < 7<< i -
. ...I " ■■■ ■■■' .
75
Step 2: In database settings screen, enter Database server
name and Database name (as shown below). Fill out the
Next.
j
Specify Configuration Database Settings
•J
All servers in a server farm must share a configuration database. Type the database server and database -
name. If the. databasecioes not exist, .it.will.be created. To reuse an existing database,1 the database.must be
empty. For’additional information regarding database server security configuration and network access
please see help, . ...- ..; ... J
• C%1
Database server: |sharepoint03
Database name: |5harePoint Config
r
Specify Database Access Account .
Select an existing Windows-account that this machine will always use to connect to the’configuration
database. If your configuration database is hosted on another server, you must specify a domain account.
i
S Type the username in the form DOMAIN\User JJame and password for the account. . <
Username: IsHAREPOINTOS^Administrator-
Password: !••••••••
is
5,
.-M, ||/~Cancel
•L
76
Step 3: On SharePoint Central Administration configuration
@NTLM
Q Negotiate (Kerberos)
'1
i
r_
... * ..... ♦
Cancel- :
77
Step 4: Verify the information. To make changes, Click
SharePoint.
-?
Configuration Database Name
‘.■9
Host the Central Administration Web Application
;.’l • . ..
r"~->
<Back Next > i| Cancel .
Vy’.'.'A
.,,-AS *-Ar ,-X.
78
Once installed, Sharepoint server screen as shown
Home - Central Administration - Microsoft Internet Explorer " ‘F? * " ‘000
1 Fie
f$Bad, *
Edt View
n
Favorites
3 j2)
Tools
| /^Search
tJelp ••
Favorites j 5^ $$ - 0 ££& ,
l«
lAjJdress J<J£] http://sharepoint03:21614/defau!t.a$px Sj'Ei® l|un£ "
Central Administration 1 ’ , *
' '. " C ' ■ , , „ < < WelcomeSystem Account -r | ®
' ' V.
? CoNoSentrCvfkeoprmFpatrfemotne.’ *?■i•
Central Administration
feHOiel^r Opwabons ■j^ppkatfon Management j | ____ ______ ______ __ ____ '
Inch
Enk“ below.
For.more hfofmation , J Initial d^ymert: Add servers to farm I U, Not Started’$
E Add new link i
1 Initial deployment: Assign services to servers 1 Not Sarted
View Al Site Content
j.’ r Configure server farm’s shared services Not Started"}
Central . ; ;
Administraticn _ E Add new task
■ Operations
' ■ Application Farm Topology .__________________________ ____________
Management' j Server _ ; , ' . - _ Services Running_____ . _ ;• i
—J
Shared Services sharepointO3 Central Administration
Admfnlstratiah • Windows SharePoint Services'Database
Windows:SharePoint Services Incoming E-Mail
® Recyde Bin Windows SharePoint Services Web Application
* .
79
6.2 Client Setup
Continue
80
CHAPTER SEVEN
1
3
* iSpace- Online Forms -Microsoft Internet Explorer
h ge EcR View Fawtes- Tools Help .. \ .
- .<
[Qhdt ’ <$ *’Q @ $|p5earch ^Favorites 0 | @-0 , »
liSpace^ ft
IForms
Welcome lo iForms
iTimeCard
EtpenseReport F
fl
I
81
Step 2: All the forms that can be used by an employee of
82
iTimeCard - Microsoft Internet Explorer
j File Edit View Favorites Tools Help . ' ■ 1
83
7.2 Submitting Timesheet
in these boxes.
84
iTimeCard - Microsoft Internet Explorer
File .Edit View ^Favorites Tools Help
(©Back - Search ^Favorites ^]|0’ Ik ($i V ® fiif
Client: Demo
Accelerating ute pace ofvour growth r*
ft
Project : Demo Project
® Close IB PrinhVtew
85
Step 2: Submit button will be enabled once you acknowledge
Address ht^/2^ar^P^t03/sites/^W^?Hts^FoI!!???[Y?r,asPx?xsnLocatIon=^ttP%3a%2f%2fs^areP0'nt030‘/o2f:site50''02f5I%2ff:crm5erverTemplates%2fiTirne+Versi
[~
*
Submit~'~~| |~~~rciear~~~T| [T New'~~~j
86
CHAPTER EIGHT
87
Step 1: Type http://sharepoint03/sites/SI on a web browser
Site Actions ’
WewAlSft&Cootent.
iSapce IT Solutions
Documents"
Announcements
■ Shared Doaments
There are anentiy no active announcements. To add a new amareement, dick‘Add new.amoireerrent' below.
■ iTimeCard
S Add new announcement
ust»~ ~ ‘
■ Cckfrfsr Calendar__________________________________________ SharePolntServIces
■ Tasks
There are curfehtiy no upcoming events. To add a new event, dck'Add new event" below.
Discussions 3 Add new event Links
Team Dscussfcn There are onently no favorite links to cfctfay. To add a
new IrJg did; ‘Add new GnfrT below.
_______
9 Add new link
People and Groups . ■’
.0 Recycle Bm
TH
88
Step 2: Click on the iTimeCard link under Documents section
BEE3I
q.
[^ITimeCard-MicrosoftInternet Explorer
!@e- Mt View * Favorites Took jjelp • ■
89
Step 3: In order to view the latest submitted time sheet
Employee
Proiect
90
Step 2: List of employees will be displayed as shown in
3.
to Step 4
91
Untitled Page - Microsoft Internet Explorer
[j ifr| Go *
@ ▼ .[ Bookmarks^ §bo blacked Check AutoLink -r 'Q ftlJtoJrft Send to-
t
Google
Adtj'Bii^oy^f | ■ | Go"Back
page.
92
The following business rules apply to while adding an
employee:
format
93
"31 Untitled Page - Microsoft Internet Explorer
.Google iGj'" . .. *
ElGolf^l St'- |;©. Bookmarks. -,@B Deblocked 1 Check • ▼* AutoLihk'
Full Name
Login ID
IsRSM
Go Back
94
Microsoft Internet Explorer [El
Record Saved!
page.
employee:
95
• Email must not be blank and should be incorrect
format
96
'3 Untitled Page - Microsoft Internet Explorer
97
8.3 Managing Project Data
98
To add a project, click on Add Project Button to go to
Address
Google [Igp F| go
http://localhost:4535/AddEmployee/EditProject.aspx
0- 1
j
*
Bookmarks 0 blocked 1 Check *
>5^ AutoLink ■*
Messenger*-.^ Ma
99
Step 3: Fill out the project information as shown below in
list page.
employee:
saved.
100
<3 Untitled Page - Microsoft Internet Explorer
address http://localhost:4535/AddEmployee/AddProject,aspx
Project Name
Client Name
Client Manager
Is Active
Is Billable
• Project Name
cannot be blank
101
The following business rules apply to while editing an
employee:
saved.
102
Untitled Page - Microsoft Internet Explorer
103
CHAPTER NINE
CONCLUSION
9.1 Summary
104
with the same feature. The powerful search feature of
information quickly.
payroll purposes.
module.
105
APPENDIX
APPLICATION CODE
106
Add a new Employee
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
conn.Open();
cmd.Connection = conn;
cmdl.Connection = conn;
cmdProjEmp.Connection = conn;
cmd.CommandType = CommandType.Text;
cmdl.CommandType = CommandType.Text;
cmdProjEmp.CommandType = CommandType.Text;
107
str = Request.QueryString["id"].Trim();
// populating the data for selected update
reader = cmdl.ExecuteReader();
while (reader.Read())
{
// Response.Write(str);
if
(str.Equals(reader["EmployeeID"].ToString()))
{
txtEmail.Text =
reader["Email"].ToString();
txtLogonlD.Text =
reader["LogonlD"].ToString();
txtName.Text =
reader["FullName"].ToString();
cklsRSM.Checked =
bool.Parse(reader["IsRSM"].ToString());
//flag = true;
}
}
reader.Close();
}
reader.Close();
108
cmdProjEmp.CommandText = " select
Project.ProjectID, Project.ProjectName from Project where
projectid not in(select projectid from ProjectEmployee
where Employeeid = " + str +
reader = cmdProjEmp.ExecuteReader();
while (reader.Read())
{
IbAvailProject.Items[IbAvailProject.Items.Count - 1].Value
= reader["ProjectID"].ToString();
}
reader.Close();
}
// if newly added employee then populating the
data for Available Project List box
else
{
reader = cmd.ExecuteReader();
while (reader.Read())
{
IbAvailProject.Items[IbAvailProject.Items.Count - 1].Value
= reader["ProjectID"].ToString();
}
reader.Close();
}
conn.Close ();
}
ListboxSize();
}
109
{
SqlConnection conn = new SqlConnection();
conn.Open();
cmdl.Parameters["SLogonlD"].Value =
txtLogonlD.Text.Trim().ToUpper();
cmdl.Parameters["@Email"].Value =
txtEmail.Text.Trim().ToUpper();
cmdl.Parameters["QFullName"].Value =
txtName.Text.Trim().ToUpper();
cmdl.Parameters["@IsRSM"].Value =
bool.Parse(cklsRSM.Checked.ToString ());
cmdl.Parameters["QEmployeelD"].Value =
int.Parse(str.Trim());
cmdl.ExecuteNonQuery();
110
i
//Update the Pro j ectEmployee- table
SqlCommand cmdprojemp = new SqlCommand();
cmdprojemp.Connection = conn;
cmdprojemp.CommandType = CommandType.Text;
if (IbAssignProj.Items.Count != 0)
<
//Adding records for ProjectEmployee table
foreach (Listitem listitem in
IbAssignProj.Items)
{
SqlCommand cmdprojempl = new
SqlCommand();
cmdprojempl.Connection = conn;
cmdproj empl.CommandType =
CommandType.Text;
cmdprojempl.CommandText = "INSERT INTO
PROJECTEMPLOYEE(ProjectID,EmployeelD)" +
"values(@Proj ectID,@EmployeeID)";
cmdprojempl.Parameters.Add("@EmployeeID", SqlDbType.Int);
cmdprojempl.Parameters["@ProjectID"].Value =
listItem.Value;
cmdprojempl.Parameters["QEmployeelD" ].Value =
int.Parse(str.Trim());
111
cmdpro j einpl. ExecuteNonQuery () ;
}
}
}
// 'Add a new employee
else
{
SqlCommand cmd = new
SqlCommand("AddEmployee", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("SLogonlD",
SqlDbType.VarChar);
cmd.Parameters.Add("@Email",
SqlDbType.VarChar);
cmd.Parameters.Add("SFullName",
SqlDbType.VarChar);
cmd.Parameters.Add("@IsRSM", SqlDbType.Bit);
cmd.Parameters.Add("QoEmpID", SqlDbType.Int);
cmd.Parameters["SoEmpID"].Direction =
ParameterDirection .Output;
cmd.Parameters["@LogonID" ].Value =
txtLogonlD.Text.Trim().ToUpper();
cmd.Parameters["SEmail"].Value =
txtEmail.Text.Trim().ToUpper();
cmd.Parameters["@FullName"].Value =
txtName.Text.Trim().ToUpper();
cmd.Parameters["@IsRSM"].Value =
bool.Parse(cklsRSM.Checked.ToString ());
//SqlParameter sqlParam =
cmd.Parameters.Add("@EmpID", SqlDbType.Int);
//int EmpID =
(int)cmd.Parameters["@EmpID"J.Value;
cmd.ExecuteNonQuery() ;
int EmpID =
(int)cmd.Parameters["QoEmpID"].Value;
//sqlParam.Direction =
ParameterDirection.ReturnValue;
112
Console.Write(EmpID);
cmdEmpProj.Connection = conn;
cmdEmpProj.CommandType =
CommandType.Text;
cmdEmpProj.CommandText = "INSERT INTO
PROJECTEMPLOYEE(ProjectID,EmployeelD)" +
"values(@Proj ectID,@EmployeelD)";
cmdEmpProj.Parameters.Add("SProjectID",
SqlDbType.Int);
cmdEmpProj.Parameters.Add("@EmployeeID", SqlDbType.Int);
}
}
//Response.Write("<script
language^'j avascript'>alert('Record saved! ');</script>");
conn.Close();
Response.Write("<script language='javascript'>
alert ('Record Saved!'); window.location.href =
'EditEmployee.aspx';</script>");
113
}
IbAssignProj.Items.Add(IbAvailProject.Selectedltem.ToString
0 ) ;
IbAssignProj.Items[IbAssignProj.Items.Count
- 1].Value '= IbAvailProject .Selectedltem.Value;
IbAvailProj ect.Items.Add(IbAssignProj.Selectedltem.ToString
());
IbAvailProject.Items[IbAvailProject.Items.Count - 1].Value
= IbAssignProj.Selectedltem.Value;
IbAssignProj.Items.Remove(IbAssignProj.Selectedltem);
//IbAssignProj.Selectedltem.Enabled =
false;
}
}
catch (NullReferenceException ex)
{
throw (ex);
114
}
}
protected void btBack_Click(object sender, EventArgs e)
{
Response.Redirect("EditEmployee.aspx");
}
protected void ListboxSize()
{
IbAssignProj.Height = 150;
IbAssignProj.Width = 200;
IbAvailProject.Height = 150;
IbAvailProject.Width = 200;
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
View Employee
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
115
public partial class AddEmployee : System.Web.UI.Page
{
public static String str;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlConnection conn = new SqlConnection();
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
// Response.Write(str);
if
(str.Equals(reader["Proj ectID"] .ToString()))
{
txtClient.Text =
reader["ClientName"].ToStringO; ;
txtManager.Text =
reader["ClientManager"].ToString(); ;
. txtProject.Text =
reader["ProjectName"].ToStringO; ;
cklsActive.Checked =
bool.Parse(reader["IsActive"].ToString());
116
CklsBillable.Checked =
bool.Parse(reader["IsBiliable"].ToString());
}
}
}
reader.Close();
conn.Close();
}
}
conn.Open ();
if (Request.Querystring ["id"]!=null)
{
SqlCommand cmdl = new SqlCommand();
cmdl.Connection = conn;
cmdl.CommandType = CommandType.Text;
cmdl.CommandText = "UPDATE PROJECT SET
ProjectName=@ProjectName," +
" ClientName=@ClientName,"
+
n
ClientManager=@ClientManager," +
" IsActive=@IsActive, " +
" IsBillable=@IsBillable "
+
" WHERE (ProjectID =
QProjectlD)";
117
cmdl.Parameters.Add("©ProjectName",
SqlDbType.VarChar);
cmdl.Parameters.Add("©ClientName",
SqlDbType.VarChar);
cmdl.Parameters.Add("©ClientManager",
SqlDbType.VarChar);
cmdl.Parameters.Add("©IsActive",
SqlDbType.Bit);
cmdl.Parameters.Add("@IsBillable",
SqlDbType.Bit);
cmdl.Parameters.Add("@Proj ectID",
SqlDbType.Int);
cmdl.Parameters["@ProjectName"].Value =
txtProj ect.Text.Trim() .ToUpper();
cmdl.Parameters["@ClientName"].Value =
txtClient.Text.Trim().ToUpper();
cmdl.Parameters["©ClientManager"].Value =
txtManager.Text.Trim().ToUpper();
cmdl.Parameters["©IsActive"].Value =
bool.Parse(cklsActive.Checked.ToString()) ;
cmdl.Parameters["©IsBillable"].Value =
bool.Parse(CklsBillable .Checked.ToString());
cmdl.Parameters["@ProjectID"].Value =
int.Parse(str.Trim() ) ;
cmdl.ExecuteNonQuery() ;
Response.Write("Record Updated Successfully");
}
else
{
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = " INSERT INTO
PROJECT(ProjectName,ClientName,ClientManager,IsActive,IsBil
lable)" +
"values(©ProjectName,©ClientName,©ClientManager,©IsActive,©
IsBillable)";
118
cmd.Parameters.Add("@ Proj ectName",
SqlDbType.VarChar) ;
cmd.Parameters.Add("@ClientName",
SqlDbType.VarChar);
cmd.Parameters.Add("@ClientManager" ,
SqlDbType.VarChar);
cmd.Parameters.Add("@IsActive", SqlDbType.Bit);
cmd.Parameters.Add("QlsBillable",
SqlDbType.Bit);
cmd.Parameters[ "@ProjectName"].Value =
txtProj ect.Text.Trim() .ToUpper();
cmd.Parameters["@ClientName"].Value =
txtClient.Text.Trim().ToUpper();
cmd.Parameters["@ClientManager"].Value =
txtManager.Text.Trim().ToUpper();
cmd.Parameters["QlsActive"].Value =
bool.Parse(cklsActive .Checked.ToString());
cmd.Parameters["SlsBillable"].Value =
bool.Parse(CklsBillable.Checked.ToString());
cmd.ExecuteNonQuery() ;
)
protected void btBack_Click(object sender, EventArgs e)
{
Response.Redirect("EditProj ect.aspx");
}
View Project
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
119
protected void BtAddProj_Click(object sender, EventArgs
e)
{
Response.Redirect("AddProj ect.aspx");
}
protected void btBack_Click(object sender, EventArgs e)
{
Response.Redirect("HomePage.aspx");
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Stored Procedures
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SET NOCOUNT ON
120
SET NOCOUNT OFF
ALTER PROCEDURE [dbo].[GetActiveProjectsForEmployee]
-- Add the parameters for the stored procedure here
SlogonlD VARCHAR(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets
from
— interfering with SELECT statements.
SET NOCOUNT ON;
SELECT Project.ProjectID,
Proj ect.Proj ectName,
Proj ect.ClientName,
Proj ect.ClientManager,
Proj ect.IsBillable,
Employee.FullName as EmployeeName
FROM Project
INNER JOIN ProjectEmployee
ON ProjectEmployee.ProjectID = Project.ProjectID
INNER JOIN Employee
ON Employee.EmployeelD = ProjectEmployee.EmployeelD
END
121
SET NOCOUNT ON
values(SiLogonlD,@iFullName,SiEmail,SilsRSM) Select
@@identity
END
RETURN @@identity
122
REFERENCES
123