wage calculator HELP

Joined
Nov 24, 2006
Messages
6
Programming Experience
Beginner
Hi there im very new to VB.net. However ive bee told its the best place for me to start if i want to program a small application for use with my family business.

Basically i want to be able to enter the type of employee. Either (Manager, Help Desk or sales) and the system to output the amount i should pay them based on the hours they work in a week.

I pay my Sales people: £6.43 per hour
I pay my Help desk emoyees: £5.63
I pay my manager: £8.23

Please any help would be appreciated, ive purchased a VB.NET book, but i have no idea where to start. Thankyou
 
Are you going to be keeping these records for a significant period of time? Part of me wants to say go for a database like Access etc. But i can't help thinking it's overkill in this scenario unless this is going to grow into a bigger application. If not then writing it out as Xml should suffice here. You need to do some reading on Datasets/Datatables and Databinding. The Dataset can write Xml and persist the information you have entered to disk and it can also read Xml to bring the changes back for review.
Simply plonk a Dataset onto the form and add a table to it. Add 4 columns (all this can be done form the designer, No code to write) First column to keep track of the WeekEnding (point of reference to check disputes etc) second column can be for your Manager, etc.. etc... Add some Textboxes (for hourlyrate, hours worked, total pay for each employee) and bind them to the appropriate datatables columns. See how you go to get that far and then we'll move on.
 
nah im not bothered about keeping the records or storing them, i just want to make a simple calculator, and im sure that i want to use VB.NET to do it. Apparently i should use an IF statement for the 3 tpes of worker, but im struggling to do this.

Im simply wanna click the type of worker from either a drop down box or radio buttons, enter the amount of hours they have worked, click a button and for it to tell me how much to pay the employee.
 
Here's a setup to get you started. It does exactly what your asking right now, but hopefully can provide you a framework to build on so that you can learn more from playing around with it.
 

Attachments

  • WageCalc.zip
    55.4 KB · Views: 22
Thanks very much, this looks very good, now all ive got to do is add a password to the system. I understand that i could simply ask for the password in the beginning, Then, check to see if the entered word equals the defined password, "trebor". If it does, allow the program to continue, otherwise show an error message and then close the program.

But i have no idea how to do this. does anyone have the line of code which says, "enter password, if correct let user, use program and if not an error message appears and the program closes. Thanks
 
Last edited:
Public Function CheckPassword(ByVal Password as String)
If Password = "trebor" Then
Return True​


Else
Return False​
End If
End Function

i understand that this would be a good piece of code to use to implement a password on my system. I dont get what i'd replace the "true" and "false" with. I want the form to run if the password is correct and close if the password is wrong. Can someone help me pls. Thanks​
 
Last edited:
Thankyou all, this is basically what i want to achive by the end of this, any help would be greatly appreciated. I realise that if i knew what i was doing i could complete this in ten mins, but i dont. So im struggling big time. HELP PLEASE.

OK sorry here we go, i want the system to:

  • Have a password. (trebor is the password i wish to use)
  • Have a dropdown box with three employee types
  1. Sales - can work for a min of 10 hours and max of 20 hours @ £6.43 per hour.
  2. Help Desk - has to work a fixed 35 hour week at £5.63 per hour
  3. Manager - fixed 30 hour week = £516.87 per week
Overtime - is available for Sales & Help Desk ONLY - paid at double time.

Tax - None for the first £50, then £50+ 13p per pound


Outputs

  • Gross Pay
  • Net Pay (after tax deductions)
 
OK sorry here we go, i want the system to:
  • Have a password. (trebor is the password i wish to use)
-- You need to put a new form on the project, and set that as the startup form.
Add a Textbox, set the textmode to Password - change the name to txtPassword
Add a button, set the text of the button to Submit.
Add the following code behind the button:
VB.NET:
If txtPassword.text="trebor" then
Dim frmMainForm as new ?????
frmMainform.Show
me.close
else
Msgbox("Login Failed")
me.close
end if
Replace the ???? with the class name of your main form.

Oh, and make sure you set the Application shutdown in the projects properties to 'When the last form closes'
rather than 'When startup form closes'

You are closing the startup form on purpose - you do not want the application to shut down as well.
 
Back
Top