I'm developing a desktop application in Swing for a retail shop. Using MySQL database. This application
Registers customers, employees with their personal information, also registers products and generates unique Id for each customer, employee and product.
While registering a customer we have to select an employee who will deliver products to that customer everyday. For selection of employee as delivery boy I used JCombobox in which employee surname and name ( combined surname and name with a space) will be added from existing employee records in database. In same manner I used JCombobox for adding customer's sold product information, where I have to choose employee name first in JCombobox and then all customer names registered with this employee name will be added to another JCombobox then select product from another next JCombobox. Here next to each JCombobox I kept labels which will have Id set once I chose employee name (Ex. label will have EMP101 as employee Id) amd same with customer selection(Ex. 'ÇUST109') and product. I'm using Ids to add records in database but just using names of emp, cust and product so user can understand whom he/ she is selecting to add their records.
But
problem is what if more than one customers having same surname, first name and middle name ? (For employee taking surname and name only because they are only 20 max but for customers surname, first name and middle name because they may be around 4000 - 5000). Here
I don't allow duplicate surname, first name and middle name but if two customers have same name then I can adjust adding initial character or making little change in their name but
what If I have 100 customers having same name fileds ?
Should I use their mobile numbers which I hope be unique or name fields and mobile no ?
I can't use their Ids for entering records because user can't remember and recognize whose id that is.
For searching records I used JCombobox(String surname and first name and last name with a space in each of them) If an employee has 200 customers and 50 of them have surname "Patil" so when JCombobox is focused and I press key P then it will select first element in JCombobox with customer suname "Patil" if this is not the customer I'm looking for then press P key again then next or click on arrow on JCombobox then scroll down 100 records then select customer name . This seems not user friendly
Should I use JTextfiled to search customers records by asking user to enter surname , first name so it will show all records of customer having specified surname and name and user will select one of them ?
Customer table structure has :
customerinfo_records:
cust_id varchar(10) PK NOT NULL, cust_surname varchar(30) NOT NULL , cust_fname varchar(30) NOT NULL, cust_mname varchar(30) NOT NULL, cust_mobno1 varchar(10) NOT NULL, cust_mobno2 varchar(10), cust_balance float(10,2) NOT NULL, cust_address varchar(200) NOT NULL, cust_accstatus boolean NOT NULL, emp_id varchar(10) NOT NULL (This is id of an employee assigned to this customer while registering customer)
so please need help