views:

234

answers:

3

A fast paced foodservice company is wanting me to develop a web order form so customers can place orders online for pickup or delivery. One of requested requirements is to automatically print a newly generated order to the service counter.

I'm using c#, asp.net, SQL on 3rd party hosted server. What type (web, console, winforms) of app would you deploy for the service counter to view/review orders, but also automatically print new orders?

+2  A: 

Since your overall project needs to include at least a web application (for the customer order form), the simplest solution is to make this just a web application with one part for the order form and another part for the service counter to review orders. Printing from a web application to a printer connected to the web server is easy in ASP.Net, so there's no need to introduce a WinForms component.

Edit: if the web server is hosted, you could still make this an all-web app solution, but printing client-side from a browser is a pain and relatively unreliable. It's probably easier to have a web app for the customer ordering page, along with a web service that returns orders to be printed, and then a WinForms app (running on one PC, presumably) that displays the orders and prints them to a connected printer. The WinForms app could poll the web service every 30 seconds or so (you can also set up a web service so that it makes "callbacks" to a registered client "push"-style, but this is sort of a bother) and get outstanding orders that need to be printed and displayed.

MusiGenesis
Yes, but the web server will be hosted... not onsite.
Sorry, I didn't catch that part the first time through.
MusiGenesis
+1  A: 

One way to do it would be to store orders in a database (or a file on the web server), then have a polling application on site that sees if a new order has been entered. If so, it will print it and set a flag (if database) or delete the order request (if file-base) to indicate that it's been handled.

Michael Todd
A: 

I'd agree with Michael. You could write a very simple application with RestClient that would print an order ticket to a serial printer – the Epson TM series works great. It's as simple as reading the data using RestClient and writing a text file to the serial printer.

Using a scripting language would make this a quick job, and since it really is assembling data from different services, scripting would be appropriate. I'm sure there are equivalent ways of accomplishing it using native API's and with whichever language you like, but often the simplest way is the best.

arbales