Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
2.23/5 (4 votes)
See more:
we have a class named Employee that has 2 properties one of them for based salary and the other one for the list of time and date of entering and exiting of employees.(from each of collections that we want).then we want to show the real information about them(name and family name & their work number)and calculate that how many days they come to work and how much time they work(in dictionary)
Posted
Updated 14-Feb-14 17:27pm
v2
Comments
OriginalGriff 14-Feb-14 3:36am    
And?
What have you tried?
Where are you stuck?
What help do you need?
Prasad Avunoori 14-Feb-14 3:41am    
What is your Database Table structure?
[no name] 14-Feb-14 5:25am    
Did you read the forum rules?
"2.Be specific! Don't ask "I need to write a booking application". Specify exactly what it is you need help with."
Member 10596185 15-Feb-14 3:07am    
ok :)
johannesnestler 14-Feb-14 6:31am    
How you write such a program? Get your requirements and write the code to fullfill it! ;-)
It seems you allready have some "system" in place. So what's the specific problem? Calculating Timespans? decide on DataStructure? Security (so employees can't trick your System)? Are there any legal implications (have to calculate max. workhours, or needed spare time...)?
What I can say from my experience about a similar topic, is that: What first seemed an "easy" task, got very complicated. (Had to calculate hollidays, shift times, security, ... replace with endless steam of requirements ...).

1 solution

You need a Database Table structure like this

Table Name: DayWorkDetails

EmployeeId: bigint FK
Date: smalldatetime
StatTime: Time
EndTime: TIme

***Numbers of Days Come in this month

DECLARE @Month INT,
@EmployeeID BIGINT

SELECT *
FROM DayWorkDetails
WHERE
Month(Date)=@Month
AND EmpolyeeId =@EmployeeID

*** Total working hours in this month

SELECT SUM(DATEDIFF('HH',StatTime,EndTime)) AS NumOfHours
FROM DayWorkDetails
WHERE
Month(Date)=@Month
AND EmpolyeeId =@EmployeeID
 
Share this answer
 
Comments
Member 10596185 15-Feb-14 3:06am    
thank u guy :*

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900