Click here to Skip to main content
Click here to Skip to main content

A Restaurant and Waiter helper app in WPF and Windows Mobile

By , 22 Jan 2012
 
Pro

Introduction

In 2009 when I was a student in Southern Cross University of Australia (SCU), I was supposed to do a project as my final project. It was quite a while that I was heard about Windows Presentation Foundation (WPF) and I was in love with that. So I thought it would be great if I create a WPF application as my final project. So I decided to write an application to learn WPF in action and this project came to existence. After that, when I graduated from SCU I decided to make a video demo of the app in action and put that on the Youtube.

After putting this video on Youtube, I received many feedback and requests from students in academia to share the code with them. They were interested in how I had created this app using WPF technology. I hadn't decided to share the code in public mostly because it was my first try on WPF and I knew that it is not well developed to be considered a guide for new learners. In fact, I was a newbie in WPF and I didn't want to put others in a wrong direction. Therefore, when I was receiving such requests I was forwarding them to the open source Family.Show application from Verrtigo and Pro WPF in C# book by Matthew MacDonald that were among my best resources in learning WPF.

It's almost 3 years passed now from when I did this project but I still receive such requests and feedback from academia students. To be honest, I am tired of replying such insistent student who ask for the code even though I reveal this fact with them. Therefore I've decided to share the source code of the app with everyone who is interested by the subject as is.

But I highly emphasize that this is a project that was done by a WPF newbie, hence you should consider that there might be better ways to do the things that were done in this application in terms of coding, designing and etc. In fact, If I'd wanted to create this application now, I would do that differently and in a more standard way.

Anyway, here is the whole thing you need to know about this project.


Background

This project consists of two separate parts; Restaurant app and Waiter app. The Waiter app is a Pocket PC based application based on Windows Mobile 5 that helps waiters to place customers’ orders besides getting informed of orders’ states to serve them to customers. This application works in an online environment in a WiFi network.

On the other side, the Restaurant app is a PC application based on WPF which is used in three different stations by three different users; Manager, Kitchen organizer and Cashier. The Manager, defines users of the applications and assigns different permissions to them. Moreover, he/she can defines initial data of the application and also can get different reports by the app. Kitchen organizer uses the Restaurant application to be informed of new or edited orders to prepare them besides, updating orders state and also availability of orders’ items. And finally the Cashier, who will use this application for printing receipt and doing check out processes.

Important notice: I definitely know that the processes inside Restaurants might be different in real situations. Better say, the processes in this application are just imaginary.

Using the code

After you download the files, you should attach the database files in Microsoft SQL Server 2005 or higher versions. Then you need to change the connection strings used in both Restaurant and Waiter apps accordingly.

For changing the connection string in the Restaurant app, open Settings.settings file in visual studio and change ConnectionStr property to point to your SQL Server instance.

Setting the connection string for the Waiter app will be done through frmConfiguration form.

That's it! Hope it helps.

Resources

Keep in touch!

If you were interested to know what am I doing now? Please feel free to visit me at http://daneshmandi.com


License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

About the Author

Ali Daneshmandi
Software Developer DAN
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
Member
XAML Designer & Developer | Passionate about UX | Founder of www.PortraitPad.com
 
Follow me on Twitter at: @daneshmandi
My website: www.daneshmandi.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
AnswerRe: Waiter app in VS2010 PinmemberAli Daneshmandi15 Sep '12 - 5:42 
GeneralRe: Waiter app in VS2010 Pinmembervolley198917 Sep '12 - 11:43 
AnswerRe: Waiter app in VS2010 Pinmembervolley198920 Sep '12 - 6:00 
GeneralRe: Waiter app in VS2010 PinmemberAli Daneshmandi20 Sep '12 - 10:44 
GeneralRe: Waiter app in VS2010 Pinmembervolley198920 Sep '12 - 22:59 
QuestionPassword PinmemberJoan Kay21 Aug '12 - 13:29 
Hi,
 
I downloaded the Restaurant app some time ago and just wanted to run the app to view the features well spoken of, but am stuck at login.
 
Please help.
 
Joan
AnswerRe: Password PinmemberAli Daneshmandi21 Aug '12 - 21:00 
QuestionExcellent PinmemberRugbyLeague3 Aug '12 - 7:23 
Well, I like it it. If that had been my first WPF I would have been thrilled. So what if it isn't built using the lastest pattern flavours. A lot of great apps aren't
GeneralMy vote of 5 PinmemberChristian Amado3 Aug '12 - 7:16 
Funny title! =)
Questionhow to update the transparent WPF window Pinmembershowny20 Jun '12 - 20:15 
Could I ask a question about WPF window?
 
I create a WPF window(WindowState = "Maxisized" WindowStyle="None" AllowTransparen="True") ,then there is canvas on that window with two gird of image that have click_event.Process of Click_event is to call a button. All the code is completed.
I execute the project.Then , I use the tool of TaskSwitch(Microsoft tool) to switch the app.After some time to switch, to turn on WPF Window to click the image, click_event is happend.But the button is not shown.When I press the Ctl+Alt+del and cancel it, click the image,button is shown.
I think this problem is that WPF window cannot be updated.Do you give me some advices to resolute it? Thanks.
Questionrestaurant project Pinmemberugur35_3512 Jun '12 - 21:02 
Hello.
very nice work. I was wondering if there are any restrictions regarding personal or commercial use. With your permission, I would like to use it in a commercial project currently in development.
AnswerRe: restaurant project PinmemberAli Daneshmandi12 Jun '12 - 22:32 
QuestionHow to "check_out_a_table" PinmemberMember 423688912 Jun '12 - 18:03 
Hi Ali,
 
Maybe it is big request, but I can't do it.
 
How to check out all orders of a table?
 
this is your code for "Check_out_an_order"
 
-- Author:		Ali Daneshmandi
-- Description:	This procedure will do the process of checking out of an order
-- =============================================
ALTER PROCEDURE [dbo].[Check_Out_Order]
	@OrderNo BIGINT,
	@TotalPrice DECIMAL(18,2),
	@CustomerName NVARCHAR(50)
AS
BEGIN
	DECLARE @NoOFActiveOrders INT, @TableNo VARCHAR(10)
	SET @NoOFActiveOrders=-1
	BEGIN TRAN T1;
	BEGIN TRY
		-- Update the OrderHeader
		UPDATE OrderHeader SET TotalPrice=@TotalPrice,CustomerName=@CustomerName,[State]=5 WHERE OrderNo=@OrderNo
 
		--Retreive the TableNo of the order
		SELECT @TableNo=TableNo FROM OrderHeader WHERE OrderNo=@OrderNo
		
		-- Get the no of active orders for an specified tableNo
		SELECT @NoOFActiveOrders=COUNT(*) FROM OrderHeader WHERE ([State]=0 OR [State]=1 OR [State]=3 OR [State]=4) AND TableNo=@TableNo
		IF @NoOFActiveOrders=0
		BEGIN
			--Frees the table
			EXEC Update_Table_State @TableNo,0
		END
		COMMIT TRAN T1;
		SELECT 1 AS RowsAffected
	END TRY
	BEGIN CATCH
		-- returns 0
		SELECT 0 AS RowsAffected
	END CATCH;
END
 
 
thnx very much...
AnswerRe: How to "check_out_a_table" PinmemberAli Daneshmandi12 Jun '12 - 19:50 
QuestionPassword Pinmemberrigelfb8 Jun '12 - 11:53 
firstly,so gratefully project.ıts so good.
thanks for sharing.but ı've got a problem.ı dont login because ı dont know enter password and name.please help me for that,
thnx Ali Daneshmandi for now..
QuestionHow to hide cancel orders? PinmemberMember 423688929 May '12 - 11:44 
Hi there,
 
I'm asking, if I cancel 100 orders all of them will be appear all of the time to the kitchen window. Is there any way to hide them or should I change the TSql procedure.
 
thnx very much...
AnswerRe: How to hide cancel orders? PinmemberAli Daneshmandi29 May '12 - 19:17 
QuestionThank you very much, 5 PinmemberMember 423688927 May '12 - 11:31 
I have visual studio 2008 and 2010.
I can't connect with Waiter!
It's appear an error like this "Unable to connect to server"
AnswerRe: Thank you very much, 5 PinmemberAli Daneshmandi27 May '12 - 19:34 
GeneralMy vote of 5 Pinmembermanoj kumar choubey19 Apr '12 - 22:54 
Nice
QuestionVery Nice Application PinmemberSathish Kanna19 Apr '12 - 5:59 
I am beginner in wpp but ur application helps me to very much, thank u
Generalthanks Pinmemberenessakrak11 Apr '12 - 23:52 
very good, thanks a lot Smile | :)
GeneralThanks Pinmemberper1per226 Mar '12 - 2:25 
Very Nice
Good Luck
Questionنیاز به کمک Pinmemberaminsoro28 Feb '12 - 21:23 
سلام
من تافته هستم
مسئول شبکه شرکت فولاد گلستان
برنامه نویسی می کنم با سی شارپ
واسه باسکول و ... برنامه نوشتم اینجا
یه پروژه گرفتم واسه مدیریت مدرسه
میخوام برنامه هفتگی رو خود برنامه تولید کنه
وقتی خواستم شروع کنم برنامه رستوران شما رو دیدم
میخوام با
wpf
بنویسمش
مشکل اینجاست که از پس هوشمند کردن برنامه برنمیام
چیکار باید کنم؟
دیتابیسش باید چه جوری باشه؟
اصلا میشه کاری کرد که با دادن برنامه معلمان به برنامه و ساعت کاریشون
خود برنامه یه برنامه هفتگی تولید کنه واسه هر کلاس؟
تو رو خدا کمکم کنید .
میخوام wpf یاد بگیرم
مرسی
GeneralMy vote of 5 PinmemberHassan Shafipour23 Jan '12 - 22:49 
Ali joon, mamnoon az lotfet.
Be omide roozhaie behtar...
Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 23 Jan 2012
Article Copyright 2012 by Ali Daneshmandi
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid