MojoDK
MojoDK

Reputation: 4528

Several applications needs to access "a central server-program"

I have like 5 different applications, that needs to create the same invoices.

Instead of putting the invoice-code in each of the 5 applications, I want to create a central server-application (running on another machine/server), that genereates the invoices and sends back a link to the invoice-wordfile.

I need to post a list of arguments like:

Public Class Order
   Public Property OrderID As Guid
   Public Property Count As Integer
End Class

Dim orders As New List(Of Order)
' fill the list
Dim invoiceFilename As String = GoToSomeSeverAndGetInvoice(customerID, orders)

I thought about making a MVC application as the server-program, but I don't see how to pass the class-argument "order" in a controller.

How would you make the central server-program? I need it to be simple as possible :)

Thanks in advance.

Upvotes: 0

Views: 66

Answers (1)

Grofit
Grofit

Reputation: 18465

You just sound like you want a webservice... where you some some inputs to it and it does some business logic and return a result.

You can make web services using MVC, WCF, ServiceStack and many more frameworks, you dont even have to use .net if you dont want to.

Assuming you do though, and are familiar with MVC then just look into model binding, so you would basically do something like:

public class MyController
{
    [HttpPost]
    public ActionResult MakeAnInvoice(Order theOrderObject)
    {
        // Do your invoice making magic
    }   
}

I would generally just store the actual invoice elsewhere and pass back an ID to retrieve it or something, but if you want to just fudge the data into the response header as pdf data or something you could.

Upvotes: 2

Related Questions