Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:


Desktop application in c#.net

I am preparing a project on wholesale shop mgmt..
I am getting a problem in selling multiple items at different price at same time..

I am not getting , which type of controls or format of controls should i use.. to dynamically enter multiple product items , prices and quantity and get total cost of all values.......

i have used textbox controls for entering upto 10 values .......but the problem is .....

if there are 15- 20 items user have to enter... so how can i dynamically handle them..

and how to enter and retrieve this multiple values from database......

plz reply me the solution..........


C#

Posted

1 solution

Use TextBox, MonthCalendar, NumberUpDown and other similar controls to collect the values and then add them to a ListView control. Each item will be a row in the ListView control. Provide the capability for the user to click on a row and edit the values or delete the row. When the transaction is complete traverse the ListView control items from 0 to (<controlname>.Items.Count - 1) to insert into your database. Be sure to use BeginTransaction, Commit, Rollback so that all of the inserts that are executed to do the transaction are treated as one logical transaction.

Here is a video that demonstrates a POS application written in C# that gathers the data and then adds it as a new item into a ListView control. When the transaction is completed, the rows of the ListView control are used to compose multiple SQL Insert statements to insert the data into the database.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900