I have product price management application, where I can modify data of users, products and price lists. I use Entity-Framework. User can have only one price list and the price list have products which have been added to the application.
I have already done windows with datagrids for adding, modifying and deleting users and products.
I want to have datagrid which shows users price list, which is basically list of product and price data. Every user have same products.
The main problem is now creating the price list and showing its details in datagrid. When user is created in User Management window, it only creates a row to User table, so there isn't any price list data in database yet. I should have price list rows as many as there is Products added to db. Should I create price list and price list rows at the same time when I create the new user? How I should implement that? Maybe stored procedures or C#?
Database tables:
User
- Id
- Name
Price list
- Id
- User id (fk)
Price list row
- Id
- Price
- Price list id (fk)
- Product id (fk)
Product
- Id
- Name
- Description
- Price category id (fk)
Price category
- Id
- Name
- Option 1
- Option 2
- Option 3