Opinions on best way to go. RRS feed

  • Question

  • Here is what I am trying to accomplish.

    I have written a TimeClock program in vb.net.  When a person clocks in i write the data to a SQL Server database.  And then when the person clocks out I write the EmployeeNumber, ClockInDate, ClockInTime, ClockOutDate and ClockOutTime to a sharepoint list using the lists.asmx web service.  Then at the end of the week a manager will reveiw all the time punches and make any changes needed. 

    Now here is where i am asking for the best way to do this.  I basically need the manager to possibly click a button "Approve for payroll" and start a workflow or something that will probablly use the Object Model. 

    I am able to use CAML Query and get all of the rows and separate them.  I need to take all entries of same EmployeeNumber and calculate the Total Hours worked and write them to a new list (called Payroll) which will basically be EmployeeNumber and TotalHours Worked.  And then I need to move on to the next set of entries and do the same. 

    So for a 5 day workweek there will be 10 entries.  A Clockin and Out  (lunch break)  another clockin clock out.  So 2 per day.  I will take the 10 entries for the week, add them together and write one entry for the payroll list. 

    I hope this is making sense.  I am at home now so I dont have access to the source code I have so far.  I will post it when I get to work in the morning but if anyone has any ideas of ways I might be able to achieve this please feel free.  Thanks.  Brad.
    Tuesday, May 6, 2008 2:52 AM

All replies

  • Bradley.

    Let me say first that this is a bit big a question for a public forum...I don't know how many people have time to do architectual review of this, especialy as hard to read the text without any line breaks as it is.


    To answer, I suggest you look at a workflow, or a custom timer job that will merge the list items. You will have to be very careful in coding to make sure you dont lose information, as sharepoint lists are not a database with transactions...but on the other hand, even if you delete the list items, you can recover them from the recycle bin - so you should be safe.


    Another option is to use infopath that has a built-in merge ability. have you looked into that?


    How about it?




    Tuesday, May 6, 2008 7:20 AM
  • Yea, I knew it was a big question so thats why Im not bothering on asking for how to do it but rather suggestions on the route others would take for this complicated workflow.  And sorry about the text.  I fixed it so there are line breaks now.

    I think I might have a way to do this.  I have the code that does the complicated looping to grab all the entries and separate them.  So I think I am gonna write an .aspx page with a button to execute the code that will post the new values into the payroll list.  Then I will just show that page in a page viewer webpart.

    I havent ever used infopath before, and you need infopath server to use that right?  One day I will get into InfoPath because I think it will help out a little but right now, i just dont have the extra time to try an learn it.

    Thanks though for taking the time to reply.  Any ideas or suggestions is greatly appreciated and welcome.
    Wednesday, May 7, 2008 1:19 AM