I have a combobox that passes along values in text, but they can have different meanings, e.g.:
- 8:30 - 9:30 => slot 1
- 10:30 - 11:30 => slot 2
- 12:30 - 13:30 => slot 3
or
- 8:30 - 11:30 => slots 1 and 2.
- 10:30 - 13:30 => slots 2 and 3
Basically, I want to pass these values into a database. So if the number of hours required is two, then the option will automatically display 8:30 - 11:30 or 10:30-13:30 already. Once you click the event button, I want the program to automatically calculate how many slots are required, and the number of the slots that need to be entered. At the moment, I can only think of doing it using a gargantuan amount of if statements.
Clarification:
A job will take a number of hours. 1, 2, 3, 4 or 5. The hours that each job can be worked on are 8:30-9:30, 10:30-11:30 etc. If a job takes more than one hour, it will take up more than one 'job slot'. However, the combo box I am using right now dynamically generates the possible hours and places them as text into a combo box. Therefore, if a job takes more than one hour, instead of displaying 8:30-9:30, 10:30-11:30 etc. it will display 8:30-11:30, 10:30-13:30 etc.
I'm just wondering (just had an idea), how do you take a substring in C#? If I could take a substring, I could give each possible beginning and end a value and do it another way.
Any help would be really useful.