A software is an offline application, you just add a feature in it to work with online directories and databases, such as chat applications which are actually offline, but once using the Internet connection you can download the messages or send messages. Since you're talking about the .NET framework, there is a
System.Net[
^] namespace present to work with networks (including the Internet), which you can use to connect to the internet to make your
offline applications online.
The offline application, as you say, is maintained offline. You create a database, and you assign a few columns to it to store the data in it. Such as, the Invoice table would store all of the data assosiated with the Invoice you create. You create a new record, a new row is created inside the table, which would hold the data for it and all of the data, such as
invoice number.
Now the last thing, to maintain this state of the application online, is a tricky thing, but not much. If you're well introduced with databases, you might well know that a
Primary key[
^] is required to make the data easily query-able (I am really cracking up right now as I am not able to come up with the exact word for non-duplicate data, consistence or uh, I don't know). That is why, in the online database you will create the table, as if to store the client's ID too. This is the part which maintains the state of the InvoiceNumber for different users. You might consider creating a
composite key[
^], by combining the ClientID and the InvoiceID, so that every client can have every possible integer ID, incrementing by 1.
Remember, this is just my opinion of creating the tables to store the data coming from different clients. So, saying that this is always the only way of doing this would be false.