views:

46

answers:

2

Hello, I have a problem I need to create a desktop WPF application in .NET. The application receives and sends data from Web- server, and the application can work in offline mode when the Web server isn't available. For example the application need to calculate how much time the user work on a project, the application connect to the server and get list of projects, user select one project, and press button to start timer and user can stop timer,the data project start and stop time need to be send on the server. How to implement this task when the application works in offline mode. Help me please, may be there are some existing solution or some libraries to simplify this task. Thanks in advance.

+1  A: 

You'll need to do a couple of things differently in order to work offline.

First, you'll need to cache a list of projects. This way, the user doesn't have to go online to get the project list - you can pull it from your local cache when the user is offline.

Secondly, you'll need to save your timing results locally. Once you go online again, you can update the server will all of the historic timing data.

This just requires saving the information locally. You can choose to save it anywhere you wish, and even a simple XML file would suffice for the information you're saving, since it's simple - just a project + a timespan.

It sounds like this is a timing application for business tracking purposes, in which case you'll want to prevent the user from easily changing the data. Personally, I would probably save this in Isolated Storage, and potentially encrypt it.

Reed Copsey
Thank you for answer, I also thought to store data in local XML file. But I don't know how to determine when the server is available.
Serghei
It sounds like this is a timing application for business tracking purposes, - Yes that is timing application.
Serghei
If you have some advise please help me.
Serghei
@Serghei: Just try to connect - if you get an exception, handle this locally for that run...
Reed Copsey
Thank you for answer I will try to do this.
Serghei
A: 

You can use Sql Server Compact for you local storage and then you microsoft sync framework to sync your local database to the server database. I recommend doing some research on the Microsoft Sync Framework.

pdiddy
Thank you for answer. I thought about SQL Server CE but the Web Server is implemented in PHP. and I don't know if the Sync Framework works with MySql and PHP Server
Serghei
You could implement a WCF service on the server side that connects to mysql for synchronization part. Sync framework on the server side should be able to talk to your MySql database since its using standard ADO.net framework to do synchronization.
pdiddy
Thank you for answer.
Serghei