Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Friends,

I am developing a software which handling attendance management in three shifts. I am stuck in the area where which handling night shift starting from 11pm In my software we are allowing a swipe in time duration like early check in and late check in some times late check in lies on the next day in this case I am not able to track whether it is a swipe in because the shift ending on the next day thats why my code treat that swipe in as swipe out.

for example: Early check in is 60 min before actual time ( ie 10 PM) and late check in is 120 min after actual time (01:00 AM)

my actual swipe in time is 11PM

Is there any one have the solution for this pls reply

Hope a good response for this query

Regards
Anilraj
Posted
Comments
Zoltán Zörgő 17-Mar-13 3:34am    
Solution for what exactly? Of course you can do this, but to answer to "how?" we have to know more about the technical context. You wrote about your user specification, but nothing technical. At least tell us is it Windows Forms, Web Forms, or what? What kind of data persistence are you using? And, and, and...
achutty123 17-Mar-13 4:58am    
its windows form application and sql as back end. I want to use this software to handle the live swipe data from my finger print device.

Zoltán Zörgő 17-Mar-13 6:17am    
Ok. And you want to do something every day at T-60min and T+120min? Two different things or the same? I suppose you can not guarantee, that the windows forms application itself is running at that time. Have you considered writing a service or it is enough to use windows scheduler?
achutty123 17-Mar-13 6:45am    
No currently we are not thinking about make this as a service its just a scheduler. During T-60 and T+120 the same process is happening employee is getting into the factory, that means during this time inteval all the swipe is considering as in swipe or INTIME. After T+120 what ever the swipe considering them as swipe out.
Zoltán Zörgő 17-Mar-13 13:17pm    
Ok, this is the meaning of this interval, and I understand what's happening outside you application. But what do you intend to do inside your application during this interval?

Simply always use Date&Time rather than just Time.

So 3rd June 2013 23:00 will always be less than 4th June 2013 00:30 for example.

If for some reason you don't have the date available from the clocking in clock then you will have to make a decision as to how to 'guestimate' what the date should be. for example if the check in time expected is 23:00 on 3rd and you have a time swiped of 09:00 you could assume this is a check out for the 4th
 
Share this answer
 
you have present date & Time,

So when ever you filter or validate datetime

you can add one day to datetime then automatically you can get the result.

ex:

punchdate:03/17/2013 punchtime:10:10pm
nextday punchlogout:03/18/2013 punchtime:1:00AM

you validation:

add the one day to datetime:

1. you have ShiftBeginDate,ShiftBegintime and ShiftEndtime.

2. required date that is nextday date?

Solution: DateTime ShiftEndTime=ShiftBeginDate.AddDays(1);

3. then finally condition

var result=from row in objpunches
where(row.ShiftBeginDate>ShiftBegintime) && (row.ShiftBeginDate<shiftendtime))>
select row).ToList();

you can esily get the results.
 
Share this answer
 
Comments
achutty123 18-Mar-13 8:46am    
Dear Bojjaiah,

Thanks for ur reply, my scenario like
Punch Date:- 03/17/2013
punch in Time: from 17/03/2013 10:10pm to 18/03/2013 1.00 AM

Puch Out Date:- 18/03/2013
Punch Out Time: from 18/03/2013 09:00 AM to 18/03/2013 09:30 AM

After 18/03/2013 01:00 AM all puncges are considering as Punch out till 18/03/2013 10:12 AM

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