开发者

How to handle intranet application to work offline

开发者 https://www.devze.com 2023-02-26 06:04 出处:网络
I developed a small expense report system used to replace an excel file that was very old. The setup was pretty simple:

I developed a small expense report system used to replace an excel file that was very old. The setup was pretty simple:

-UI is jquery, asp.net, simple css

-Back end is sql server 2005

-There are some additional tiers for the business layer.

Typical tiered application. It's running on IIS 6 as an Intr开发者_开发技巧anet site. It's a lot simpler to use then the excel sheet but of course there is the guy who doesn't seem to have an internet connection so how can he submit his expense report?

I thought of an offline system that serializes objects but this again seems to be a bit complex as eventually these serialized objects need to get back to the database layer. I'm thinking more on the lines of just telling them to submit an excel spreadsheet to an "admin" who does have an internet connection and have them put in his / her expense report. But I fear the "admins" will hate this.

Even if I whip up a desktop client application, I'd still have to hit the network to get to the data layer.

Any other ideas of how to handle the guy who cannot VPN or get on the network but once loved his excel application that I havent thought of?


We implemented a few solutions where the users don't have a connection. One was a WinForms app, and others were ASP.NET apps. For the ASP.NET apps, we modified them to run using IIS on the laptop or client PC, since you can install IIS on a client OS.

What we ended up using as a pattern was to use a DataSet locally to hold/parse.manipulate data on the client PC, and then serialize it to an XML using the built in DataSet.WriteXml method. Then we created an "Upload" screen (asp.net page or WinForms page) that shows the pending uploads. This uploads the DataSet to an ASP.NET Web Service. Since the DataSet object is serializable, using it in a web service is the least amount of work. The web service handles actually inserting/updating the database.

It is actually a lot less work than it sounds like, and the pattern has been so successful for us that it's become our standard method for handling disconnected apps. The troubleshooting on these apps has been negligible, which to me speaks volumes for the simplicity and reliability, compared to other approaches we've tried.


You can implement SQL Server Merge replication. There was a little bit of a learning curve, but I figured it out and implemented it in a couple of weeks so its definitely "do-able". You can have a desktop app that updates a sql server express db and then synchronizes the changes using replication at your choosing (maybe when the user is connected to the network).

How Merge Replciation Works
http://msdn.microsoft.com/en-us/library/ms151329.aspx


You can do a variation of the email xls file to admin. Instead of the admin re-inputting the data, you could have them upload the xls file and your system could parse it and enter the data. Works quite well especially if the xls format is unified.


Using the Office toolkit and macros build into the users Excel application the functionality to export the data into an XML dataset and transmit them when the opportunity permits. On the server end build an adapter that reads those XML files as they arrive and inserts the appropriate records as required.

0

精彩评论

暂无评论...
验证码 换一张
取 消