TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amit
1.5k
213
35.2k
employee hours calculation in c#.
Feb 18 2015 4:54 AM
hello sir i want to calculate total working hours of employee in c#.
like IN=10:00
OUT=12:00
IN:1:00
OUT:5:00
duration=2+5=7;
below code calculate only last in and out duration i want all in and out dueation time.
if (dt1.Rows.Count > 0)
{
for (int j = 0; j < dt1.Rows.Count; j++)
{
DateDay = Convert.ToDateTime(dt1.Rows[j]["emp_ToDate"]);
string st = dt1.Rows[j]["emp_InOut"].ToString();
string time1 = (dt1.Rows[j]["emp_Time"]).ToString();
if (st == ("IN"))
{
Input = Convert.ToString((time1));
}else
if (st == "OUT")
{
Output = Convert.ToString((time1));
}
try
{
duration2 = duration + (DateTime.Parse(Input).Subtract(DateTime.Parse(Output)).Duration());
}
catch { }
}
Reply
Answers (
10
)
scanning image in windows phone 8.1
crystal report is not showing large image in (mb)