Some advice please

desperado

Well-known member
Joined
Oct 7, 2006
Messages
68
Programming Experience
Beginner
Hi I was wondering if you could offer me some help and advice me the best way around the following project. I have attached a link in which it shows what is required in a table and what I have created so far in Vb.NET. The link pretty much explains everything, a user loads the program and they input some information. Whatever matches anything in the table, a message box appears saying "The room which is most ideal for you is Room1"

However if nothing matches then the message box appears saying "Sorry there are no matches found" but if the user input more than 35 in the pupil textbox, or 32 in the computer textbox then after the message that has just been typed out the message box should say "The number of pupils is too much" or "The number of computers is too much".

The printer part is simple, if the combobox remains on "No" then the radiobuttons will remain disabled, but when the user selects "Yes" from the combobox they must select one of the radiobuttons. IF they select Yes from the combobox and dont select a printer and select search, then a message box appears saying "Please select a printer" I know it might sound confusing, and I dont require anyone to actually do the work but if anyone could offer me any help I would really appreciate it.

So far for the coding I have:

VB.NET:
If ComboBox3.Text = "No" Then
RadioButton1.Enabled = False
RadioButton2.Enabled = False
Else
RadioButton1.Enabled = True
RadioButton2.Enabled = True
End If
lol, well its a start.

http://i18.tinypic.com/499ufxk.jpg
 
Last edited by a moderator:
Create a datatable in a dataset, of suitable structure to hold the data pictured and fill it with the data (manually, for now)
Design the form shown
Use the SELECT command of the datatable to search for sensible criteria
Learn about the string.format command
The search command text might look something like: "NoPupil > {0} AND NoComp > {1} AND Projector = {2} ...." and so on
Learn how string.format can help you turn this into a string usable for searching the table with SELECT
Select returns an array of rows. Work out how to order the rows so that the most suitable one is at the top.

Consider whether a resource required "No" means that a room with that resource should be returned (just because they dont need a projector should they be provided witha room without one?) - in this case you wont want to use the search command text above, you'll want to have a coding structure like:

VB.NET:
IF user has asked for resource = yes THEN
  add another clause to the search string for that resource
END IF

Most important of all.. SIT DOWN WITH A PENCIL AND PAPER and write out in PLAIN ENGLISH, how the logic of this program will work. Even "pro" programmers like (er.. me :D ) who have been coding for years, still use pen and paper as a design tool.
Actually we probably write comments in the code before we even write code, then code to the comments but its the same thing.. :D

If youre silly, then start bashing at the keyboard immediately: Weeks of coding can save you hours of planning.
 
Back
Top