• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: How to handle the number of workers available in a record?

 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all

I need some clarification on the following statement from my assignment:

Bodgitt and Scarper ... offer the homeowner one or more contractors that can provide the required services ...


What does it mean exactly

I first thought that each one record from my data file describes one contractor. In that case I would allow the user of my application to select multiple records from the GUI view. I would not care about the number of workers available in the records.

But now, the size field comes into my eyes where the assignment says:

The number of workers available when this record is booked


Think that a contractor has 10 workers to offer for a specific location and a user want to book that contractor. Does this user then has to book the whole bunch of 10 workers or should he be able to book only 5

Any hints are welcome :roll:

Regards
Darya
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Darya,

I have interpreted the requirements such that a client books records. I did not do anything with the number of workers, except display it in the JTable.

Frans.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frans,

then how did you interpret

Bodgitt and Scarper ... offer the homeowner one or more contractors that can provide the required services ...


Did you allow the user to select multiple records and book them in one bunch for convenience or did you allow one record to be selected and booked?

Regards,
Darya
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Darya Akbari:
Did you allow the user to select multiple records and book them in one bunch for convenience or did you allow one record to be selected and booked?


I did indeed make it so that multiple records could be booked in one bunch. Although I think that the requirement is still fulfilled even if multiple clicks are needed: the CSR can still book multiple contractors for one customer.

Frans.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think a single select should be also fine. Otherwise one has to popup a new window to enter the owner id for all selected records, which I think is too much and not necessary for this assignment.

At least I hope it's not necessary

Regards,
Darya
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a text box in the main window where the customer ID could be entered. The records were displayed in a JTable (of course), which I configured in multiple select mode.
Then if the book button was clicked, all selected records would be booked for the enetered customer ID.

So the user does not need to enter a customer ID for each separate record.

Frans.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I will steel that idea from you

Thanks,
Darya
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Darya,

I implemented my project in the same way as Frans, although I did not allow for multiple clicks (It is fairly easy to implement easy way, this was just a design decision on my part). A customer can book as many contractors as he or she wants, but has to book them one at a time. I did have the customerID persist in the JTextBox when the user selected a new record so they wouldn't have to keep on entering it though.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

where did you guys placed the owner JTextBox?

I was actually allowing the user to select the row and to edit the owner column but I think your approach is cleaner, since you use the JTable only for presentation and keep the control seperate.

Or what do you think of my approach?

Regards,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic