Dear all
Iam in a HR project and I need to define Shift for Employees
Shift had two feilds for punchcards reading , Swipein and swipeOut . I use two datetimepicker with format as time and showupdown as true to set the swipe in and out time
and read like this
public void calculateduration()
{
TimeSpan swipein = dtp_toTime.Value.TimeOfDay;
TimeSpan swipeout = dtp_FromTime.Value.TimeOfDay;
TimeSpan duration = dtp_toTime.Value.TimeOfDay - dtp_FromTime.Value.TimeOfDay;
MessageBox.Show(duration.ToString());
}
in my SQL server database I had all these three feilds swipein ,swipeout,duration as Time datatype ,and I want to insert these values there
For testing I give four values
Swipein Swipeout Duration(output displayed)
8 am 4 pm 8 hrs >>>>its same day sday shift
3 pm 10 pm 8 hrs >> same day daynight shifty
10 pm 6 am(next day) -16 hrs >>> the prblm..8 must come here
Any Idea pls
or can any one tell me an idea to check whether the duration recieved is negative like
if(duration <0)
{
duration= 24-duration;
}