Vb.net Appplication Integration with RMS qsRules

Dec 14, 2005 0 Replies

Hello everyone,



I have designed a VB.Net function as follows in order to post a transaction into RMS Via Qsrules (for a very critical project in our company)



The database connection executes ok The batch number is being generated ok I have verified the Inventory items are ok HOWEVER NO TRANSACTION IS GENERATED Where did I go wrong with my function?



Thanks in anticipation for your advice



Declaration: Private info as QSRules.ConnectionInfo = New QSRules.connectionInfoClass Private mySession as QSRules.SessionClass =New QSRules.SessionClass


Function PostTrans()



info.RegisterNumber = 1 info.Provider = "SQLOLEDB.1" info.UserID = "sa" info.Password = "" info.InitialCatalog = "RMSDatabase" info.DataSource = "RMSServer" info.ConnectTimeout = "30"



Dim result As Boolean = False



mySession.LogIn(1, "password")



If mySession.Database.OpenConnection(info, result) = False Then Return False End If



Dim isPos As Boolean = True Dim r As QSRules.StatusCategoryEnum = mySession.Build(1, isPos) ' isPos = Manager mySession.License.MarkAsRegistered() ' for license control..



Dim currentBatch As QSRules.Batch = mySession.Register.Batch



If Not currentBatch Is Nothing AndAlso currentBatch.BatchStatus CInt(QSRules.batchstatusEnum.batchstatusClosed) Then Dim zzBatch As Boolean = False Dim batchNumber As Integer = 0 currentBatch.MakeNewBatch(zzBatch, batchNumber)



End If MessageBox.Show(currentBatch.BatchNumber)


mySession.Transaction.SetTransactionType(transactiontypeEnum.transactiontypeSales) mySession.InitializeTransaction() mySession.Transaction.Entries.Add(7, "25000-010101", 1, 0, True,



12.99, "", "", False) Dim TotalAmountIn As Double = 1000 mySession.Transaction.Tenders(1).AmountIn = TotalAmountIn mySession.Transaction.Post(1, Now, False)

End Function


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required