Employee Record

Hello, Ive just wanted to get the idea for my problem. Im making payroll system now.

I just wanna know what is the way of tracking the record of employee when i save theyre info in payroll. Like if the employee got paid in these date lets just say he will get paid every 15 days of his work not including sat and sunday. If i save the info the error will say.

"You have been paid on this day / week" .

All i got is save the info but when it comes to checking i cant do it. Please help guyz ^^

Recommended Answers

All 5 Replies

I'd add the number of days to the last payment and check if it's greater than today's date. (or subtract number of days from todays date and check with last payment date)

PS: I've never heard of somebody getting paid every 15 working days. I've heard of every other Friday or on the 15th and last day (or 1st and 15th) of each month, but this is new to me.

so u mean if example march 1 to march 15 only is that it ? . :)

well , there is another way to do this , for example if you save record of a person save the date of that saving in db ,now at every time before saving it first check it whether the last date and the current date has the difference of 15 days if true then save it other wise give a msg . hope this will give you an idea.

so u mean if example march 1 to march 15 only is that it ? . :)

I'm not sure I get the question.

You can use a date/time picker and date objects.

For date objects you can try:

'Create a date object.
        'You can default the date to a date from the database.
        Dim datobj As Date = Now

        'For 15 days from the day of execution.
        Dim nextPay As Date = Now.AddDays(15)

        'You can also pass a date in from the database.
        'Value is from a datatable.
        Dim datobj As Date = dt.Rows(0).Item(0)

        'To check if the day is a weekend, try this:
        If datobj = DayOfWeek.Saturday Or datobj = DayOfWeek.Sunday Then
            MsgBox("Payment will fall on weekend.", MsgBoxStyle.OkOnly)
        End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.