views:

56

answers:

3

I am building a small web app for a pharmacy to keep track of sales and stocks, so in short, in one page, the pharmacist will enter a bar-code and the item is displayed, pharmacist enters quantity (price will be automatically calculated) then next item and next and so on, I haven't worked with such a problem before so I would appreciate any advices/tips on how to do it, what to use and wither its already done in some tidy neat way I can just import into my page.

Am using ASP.net and VB.net, SQL 2008 and all express withing Visual Web Developer (also ExpresS)

A: 

I think you are looking for how to maintain state. see following link

http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

Saar
A: 
  1. Add a textbox to your page and create an event handler for the OnTextChanged event. Important: set the property AutoPostBack true. When the user enters a value in the textbox and the textbox loses the focus a postback will be fired.

  2. Work with a datagrid, or any way of displaying your data in a table kind of view, and bind it to a collection.

  3. When the event is fired from your textbox, lookup the product in your database and add it to the grid.

  4. The grid needs to have at least a textbox. With this textbox you can do the same as mentioned above to calculate the price.

The only problem in this solution is that the user needs to "blur" the textbox. In other words, the textbox needs to lose the focus before the event is fired. To make it all more smooth you need to implement some javascript. Then you can work with the keyup/keydown event and fire a custom postback yourself.

I hope this gives you something to work with?

Joop
A: 

I'd definitely go with a shopping cart. Their needs are small now, but pretty soon you may find yourself building/supporting a full-blown shopping cart.

nopCommerce is a nice open-source ASP.Net shopping cart.

Vevo Cart is commercial but inexpensive and has a decent install base.

kervin