Reconfigure for GIT
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,19 @@
|
||||
Imports DevExpress.Xpo
|
||||
Imports DevExpress.Persistent.AuditTrail
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
|
||||
Public Module AuditTrailHandler
|
||||
Public Sub InitAuditTrail(_uow As UnitOfWork)
|
||||
AuditTrailService.Instance.SetXPDictionary(_uow.Dictionary)
|
||||
AuditTrailService.Instance.AuditDataStore = New AuditDataStore(Of AuditDataItemPersistent, AuditedObjectWeakReference)()
|
||||
AuditTrailService.Instance.BeginSessionAudit(_uow, AuditTrailStrategy.OnObjectChanged, ObjectAuditingMode.Full)
|
||||
AddHandler AuditTrailService.Instance.QueryCurrentUserName, AddressOf AuditTrailService_Instance_QueryCurrentUserName
|
||||
End Sub
|
||||
Public Sub SaveAuditTrail(_uow As UnitOfWork)
|
||||
AuditTrailService.Instance.SaveAuditData(_uow)
|
||||
End Sub
|
||||
Private Sub AuditTrailService_Instance_QueryCurrentUserName(sender As Object, e As QueryCurrentUserNameEventArgs)
|
||||
e.CurrentUserName = "SysAdmin"
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,168 @@
|
||||
Imports System.Xml
|
||||
Imports DevExpress.Xpo
|
||||
Imports System.Configuration
|
||||
Imports SISBusiness.RabbitMQ.Module
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports System.Collections.Specialized
|
||||
Imports DevExpress.Persistent.BaseImpl
|
||||
Imports SISBusiness.Module
|
||||
|
||||
Public Module GetCustomers
|
||||
Public Sub CustomerImport(_XML As XmlDocument, _RootXMLTag As String, _errorLogFile As String, _Session As DevExpress.Xpo.Session, Optional IsService As Boolean = False)
|
||||
Try
|
||||
Dim _Oid_DH As String = _XML.SelectSingleNode(_RootXMLTag + "/id").InnerText
|
||||
Dim _uow As UnitOfWork
|
||||
If _Session.IsConnected Then
|
||||
_uow = New UnitOfWork(_Session.DataLayer)
|
||||
_uow.Dictionary.GetDataStoreSchema(GetType(Customers).Assembly)
|
||||
InitAuditTrail(_uow)
|
||||
If Not IsService Then
|
||||
WriteErrorLog(String.Format("Fogadás... {0} OID_DH:{1} Ügyfélszám:{2}", GLOBAL_Index.ToString, _Oid_DH, _XML.SelectSingleNode(_RootXMLTag + "/ugyfelszam").InnerText), _errorLogFile)
|
||||
End If
|
||||
GLOBAL_Index += 1
|
||||
|
||||
|
||||
Dim _Customers As Customers = _uow.FindObject(Of Customers)(CriteriaOperator.Parse("CustomerNumber=?", _Oid_DH))
|
||||
If _Customers Is Nothing Then
|
||||
_Customers = _uow.FindObject(Of Customers)(CriteriaOperator.Parse("Oid_DH=?", _Oid_DH))
|
||||
End If
|
||||
|
||||
If _Customers IsNot Nothing Then
|
||||
_Customers.Oid_DH = _Oid_DH
|
||||
If _Customers.Name <> _XML.SelectSingleNode(_RootXMLTag + "/nev").InnerText Then
|
||||
_Customers.Name = _XML.SelectSingleNode(_RootXMLTag + "/nev").InnerText
|
||||
_Customers.FullName = _Customers.Name
|
||||
End If
|
||||
_Customers.Url_DH = _XML.SelectSingleNode(_RootXMLTag + "/dh_url").InnerText
|
||||
Dim _konyvelesi_parameter As String = _XML.SelectSingleNode(_RootXMLTag + "/konyvelesi_parameter").InnerText
|
||||
Dim _NameValueCollection As NameValueCollection = ConfigurationManager.GetSection("CustomersGLParameters")
|
||||
|
||||
Dim _CustomersGLParameters As CustomersGLParameters = _uow.FindObject(Of CustomersGLParameters)(CriteriaOperator.Parse("Oid=?", _NameValueCollection(_konyvelesi_parameter)))
|
||||
_Customers.CustomersGLParameters = _CustomersGLParameters
|
||||
Dim _Address1City As String = _XML.SelectSingleNode(_RootXMLTag + "/varos").InnerText
|
||||
Dim _Address1Street As String = _XML.SelectSingleNode(_RootXMLTag + "/utca").InnerText + " " + _XML.SelectSingleNode(_RootXMLTag + "/hazszam").InnerText
|
||||
Dim _Address1ZipPostal As String = _XML.SelectSingleNode(_RootXMLTag + "/irszam").InnerText
|
||||
Dim _Address1 As Address = _uow.FindObject(Of Address)(CriteriaOperator.Parse("City=? AND Street=? AND ZipPostal=?", _Address1City, _Address1Street, _Address1ZipPostal))
|
||||
|
||||
If _Address1 Is Nothing Then
|
||||
_Address1 = New Address(_uow)
|
||||
With _Address1
|
||||
.City = _Address1City
|
||||
.Street = _Address1Street
|
||||
.ZipPostal = _Address1ZipPostal
|
||||
End With
|
||||
|
||||
_Customers.Address1 = _Address1
|
||||
End If
|
||||
|
||||
Dim _Address2City As String = _XML.SelectSingleNode(_RootXMLTag + "/levelezesivaros").InnerText
|
||||
Dim _Address2Street As String = _XML.SelectSingleNode(_RootXMLTag + "/levelezesiutca").InnerText + " " + _XML.SelectSingleNode(_RootXMLTag + "/levelezesihazszam").InnerText
|
||||
Dim _Address2ZipPostal As String = _XML.SelectSingleNode(_RootXMLTag + "/levelezesiirszam").InnerText
|
||||
Dim _Address2 As Address = _uow.FindObject(Of Address)(CriteriaOperator.Parse("City=? AND Street=? AND ZipPostal=?", _Address2City, _Address2Street, _Address2ZipPostal))
|
||||
|
||||
If _Address2 Is Nothing Then
|
||||
_Address2 = New Address(_uow)
|
||||
With _Address2
|
||||
.City = _Address2City
|
||||
.Street = _Address2Street
|
||||
.ZipPostal = _Address2ZipPostal
|
||||
End With
|
||||
|
||||
_Customers.Address1 = _Address1
|
||||
End If
|
||||
|
||||
Dim _XmlNodeList As XmlNodeList = _XML.SelectNodes(_RootXMLTag + "/bankszamlaszamok")
|
||||
|
||||
For Each _XmlNode As XmlNode In _XmlNodeList
|
||||
If _XmlNode.HasChildNodes Then
|
||||
For Each _XmlNode_Bank As XmlNode In _XmlNode.ChildNodes
|
||||
Dim _AccountNumber As String = _XmlNode_Bank.SelectSingleNode("bankszamlaszam").InnerText
|
||||
Dim _ShortName As String = _Customers.FullName + " " + _AccountNumber
|
||||
|
||||
Dim _CustomerBankAccounts As CustomerBankAccounts = _uow.FindObject(Of CustomerBankAccounts)(CriteriaOperator.Parse("AccountNumber=? AND ShortName=?", _AccountNumber, _ShortName))
|
||||
If _CustomerBankAccounts Is Nothing Then
|
||||
_CustomerBankAccounts = New CustomerBankAccounts(_uow)
|
||||
With _CustomerBankAccounts
|
||||
.AccountNumber = _XmlNode_Bank.SelectSingleNode("bankszamlaszam").InnerText
|
||||
.Customers = _Customers
|
||||
.ShortName = _Customers.FullName + " " + .AccountNumber
|
||||
Select Case _XmlNode_Bank.SelectSingleNode("automatikusfeldolgozas").InnerText
|
||||
Case "1"
|
||||
.AutomaticProcessing = True
|
||||
Case "0"
|
||||
.AutomaticProcessing = False
|
||||
Case Else
|
||||
.AutomaticProcessing = False
|
||||
End Select
|
||||
End With
|
||||
_Customers.CustomerBankAccounts.Add(_CustomerBankAccounts)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
_Customers.QueueUpdated = GetSQLTime(_uow)
|
||||
If IsService Then
|
||||
' Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Fogadás: [Customer:" + _Customers.Oid_DH + "]")
|
||||
End If
|
||||
Else
|
||||
_Customers = New Customers(_uow)
|
||||
With _Customers
|
||||
.Oid_DH = _Oid_DH
|
||||
.CustomerNumber = _XML.SelectSingleNode(_RootXMLTag + "/ugyfelszam").InnerText
|
||||
.Name = _XML.SelectSingleNode(_RootXMLTag + "/nev").InnerText
|
||||
.FullName = .Name
|
||||
.Url_DH = _XML.SelectSingleNode(_RootXMLTag + "/dh_url").InnerText
|
||||
Dim _konyvelesi_parameter As String = _XML.SelectSingleNode(_RootXMLTag + "/konyvelesi_parameter").InnerText
|
||||
Dim _NameValueCollection As NameValueCollection = ConfigurationManager.GetSection("CustomersGLParameters")
|
||||
|
||||
Dim _CustomersGLParameters As CustomersGLParameters = _uow.FindObject(Of CustomersGLParameters)(CriteriaOperator.Parse("Oid=?", _NameValueCollection(_konyvelesi_parameter)))
|
||||
.CustomersGLParameters = _CustomersGLParameters
|
||||
|
||||
Dim _Address1 As New Address(_uow)
|
||||
With _Address1
|
||||
.City = _XML.SelectSingleNode(_RootXMLTag + "/varos").InnerText
|
||||
.Street = _XML.SelectSingleNode(_RootXMLTag + "/utca").InnerText + " " + _XML.SelectSingleNode(_RootXMLTag + "/hazszam").InnerText
|
||||
.ZipPostal = _XML.SelectSingleNode(_RootXMLTag + "/irszam").InnerText
|
||||
End With
|
||||
.Address1 = _Address1
|
||||
|
||||
Dim _Address2 As New Address(_uow)
|
||||
With _Address2
|
||||
.City = _XML.SelectSingleNode(_RootXMLTag + "/levelezesivaros").InnerText
|
||||
.Street = _XML.SelectSingleNode(_RootXMLTag + "/levelezesiutca").InnerText + " " + _XML.SelectSingleNode(_RootXMLTag + "/levelezesihazszam").InnerText
|
||||
.ZipPostal = _XML.SelectSingleNode(_RootXMLTag + "/levelezesiirszam").InnerText
|
||||
End With
|
||||
.Address2 = _Address2
|
||||
Dim _XmlNodeList As XmlNodeList = _XML.SelectNodes(_RootXMLTag + "/bankszamlaszamok")
|
||||
|
||||
For Each _XmlNode As XmlNode In _XmlNodeList
|
||||
If _XmlNode.HasChildNodes Then
|
||||
For Each _XmlNode_Bank As XmlNode In _XmlNode.ChildNodes
|
||||
Dim _CustomerBankAccounts As New CustomerBankAccounts(_uow)
|
||||
With _CustomerBankAccounts
|
||||
.AccountNumber = _XmlNode_Bank.SelectSingleNode("bankszamlaszam").InnerText
|
||||
.Customers = _Customers
|
||||
.ShortName = "Bank-" & _Customers.CustomerNumber
|
||||
End With
|
||||
.CustomerBankAccounts.Add(_CustomerBankAccounts)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End With
|
||||
_Customers.QueueUpdated = GetSQLTime(_uow)
|
||||
'If IsService Then
|
||||
' Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Fogadás: [Customer:" + _Customers.Oid_DH + "]")
|
||||
'End If
|
||||
End If
|
||||
_uow.CommitChanges()
|
||||
SaveAuditTrail(_uow)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
If IsService Then
|
||||
'Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Fogadás HIBA: " + ex.Message)
|
||||
Else
|
||||
WriteErrorLog(Now + " : " + ex.Message, _errorLogFile)
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
End Module
|
||||
@@ -0,0 +1,199 @@
|
||||
Imports System.Xml
|
||||
Imports System.Configuration
|
||||
Imports DevExpress.Xpo
|
||||
Imports SISBusiness.Module
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports System.Collections.Specialized
|
||||
|
||||
Public Module GetGLAccounts
|
||||
Public Sub GLAccountImport(_XML As XmlDocument, _errorLogFile As String, _Session As DevExpress.Xpo.Session, Optional IsService As Boolean = True)
|
||||
Dim _StartTime As DateTime = Now
|
||||
|
||||
GetCustomers.CustomerImport(_XML, "JsonXML/params/ugyfel", _errorLogFile, _Session, True)
|
||||
|
||||
Dim _decimalSeparator As String = Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
|
||||
Dim _groupSeparator As String = Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator
|
||||
Dim _uow As UnitOfWork
|
||||
Dim _Customers As Customers
|
||||
|
||||
If _Session.IsConnected Then
|
||||
_uow = New UnitOfWork(_Session.DataLayer)
|
||||
_uow.Dictionary.GetDataStoreSchema(GetType(GLAccounts).Assembly)
|
||||
InitAuditTrail(_uow)
|
||||
|
||||
Dim _GLAccounts As GLAccounts = _uow.FindObject(Of GLAccounts) _
|
||||
(CriteriaOperator.Parse("PartnerType=0 and CustomersFrom=? and Customers.CustomerNumber=? and DocumentNumber=?", _
|
||||
ConfigurationManager.AppSettings("CustomersFrom").ToString, _XML.SelectSingleNode("JsonXML/params/ugyfelszam").InnerText.ToString, _
|
||||
_XML.SelectSingleNode("JsonXML/params/szamlasorszam").InnerText.ToString))
|
||||
Dim _GLRows As GLRows
|
||||
Dim _BruttoHUF As Double = 0, _BruttoDEV As Double = 0
|
||||
Dim _VATHUF As Double = 0, _VATDEV As Double = 0
|
||||
Dim _NettoHUF As Double = 0, _NettoDEV As Double = 0
|
||||
Dim _GUID As Guid = Guid.NewGuid
|
||||
Dim _NV_Controlling As NameValueCollection = ConfigurationManager.GetSection("Services_Controlling")
|
||||
Dim _NV_CostHolder As NameValueCollection = ConfigurationManager.GetSection("Services_CostHolder")
|
||||
Dim _NV_VAT As NameValueCollection = ConfigurationManager.GetSection("Services_VAT")
|
||||
|
||||
If _GLAccounts Is Nothing Then
|
||||
|
||||
|
||||
_Customers = _uow.FindObject(Of Customers)(CriteriaOperator.Parse("CustomerNumber=?", _XML.SelectSingleNode("JsonXML/params/ugyfelszam").InnerText.ToString))
|
||||
|
||||
If _Customers Is Nothing Then
|
||||
WriteErrorLog("Nincs ügyfél rögzítve ! -> " + _XML.SelectSingleNode("JsonXML/params/ügyfelszam").InnerText.ToString, _errorLogFile)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
_GLAccounts = New GLAccounts(_uow)
|
||||
_GLAccounts.IsEditable = True
|
||||
_GLAccounts.IsStorno = False
|
||||
_GLAccounts.PartnerType = ePartnerType.eReceivables
|
||||
_GLAccounts.Customers = _Customers
|
||||
_GLAccounts.CustomersFrom = _uow.FindObject(Of CustomersFrom)(CriteriaOperator.Parse("Oid=?", ConfigurationManager.AppSettings("CustomersFrom").ToString))
|
||||
_GLAccounts.ConnectInfo = _XML.SelectSingleNode("JsonXML/params/szamlasorszam").InnerText.ToString
|
||||
_GLAccounts.DocumentNumber = _XML.SelectSingleNode("JsonXML/params/szamlasorszam").InnerText.ToString
|
||||
_GLAccounts.DateCreated = _XML.SelectSingleNode("JsonXML/params/kiallitas").InnerText.ToString
|
||||
_GLAccounts.DateExecution = _XML.SelectSingleNode("JsonXML/params/teljesites").InnerText.ToString
|
||||
_GLAccounts.DatePayment = _XML.SelectSingleNode("JsonXML/params/hatarido").InnerText.ToString
|
||||
_GLAccounts.NoteHeader = _XML.SelectSingleNode("JsonXML/params/megjegyzes").InnerText.ToString
|
||||
_GLAccounts.CurrencyName = _uow.FindObject(Of CurrencyName)(CriteriaOperator.Parse("ShortName='HUF'"))
|
||||
_GLAccounts.PaymentOption = _uow.FindObject(Of PaymentOption)(CriteriaOperator.Parse("ShortName='ÁTUTALÁS'"))
|
||||
|
||||
Dim _XmlNodeList As XmlNodeList = _XML.SelectNodes("JsonXML/params/szamlasorok")
|
||||
For Each _XmlNode As XmlNode In _XmlNodeList
|
||||
If _XmlNode.HasChildNodes Then
|
||||
For Each _XmlNode_szamlasorok As XmlNode In _XmlNode.ChildNodes
|
||||
|
||||
|
||||
_GLAccounts.row_Controlling = _uow.FindObject(Of Controlling)(CriteriaOperator.Parse("Oid=?", _NV_Controlling(_XmlNode_szamlasorok.SelectSingleNode("szolgaltatas/szolgaltatascsoport/id").InnerText)))
|
||||
_GLAccounts.row_CostHolder = _uow.FindObject(Of CostHolder)(CriteriaOperator.Parse("Oid=?", _NV_CostHolder(_XmlNode_szamlasorok.SelectSingleNode("szolgaltatas/szolgaltatascsoport/id").InnerText)))
|
||||
_GLAccounts.row_VAT = _uow.FindObject(Of VAT)(CriteriaOperator.Parse("Oid=?", _NV_VAT(_XmlNode_szamlasorok.SelectSingleNode("afanev").InnerText)))
|
||||
|
||||
_GLAccounts.row_ChartOfAccounts = _GLAccounts.row_Controlling.GetChartOfAccounts(_GLAccounts.DateExecution.Year, False)
|
||||
|
||||
_GLAccounts.row_AmountDEV = 0
|
||||
_GLAccounts.row_AmountHUF = CDbl(Replace(_XmlNode_szamlasorok.SelectSingleNode("nettoar").InnerText, ".", _decimalSeparator))
|
||||
|
||||
_GLAccounts.row_DateVAT = _GLAccounts.DateExecution
|
||||
|
||||
|
||||
_GLAccounts.row_NoteRows = _XmlNode_szamlasorok.SelectSingleNode("megnevezes").InnerText + vbNewLine + _XmlNode_szamlasorok.SelectSingleNode("megjegyzes").InnerText
|
||||
_GLAccounts.row_UniqueObjects = Nothing
|
||||
_GLAccounts.row_JobNumberObjects = Nothing
|
||||
_GLAccounts.row_CostPlace = Nothing
|
||||
|
||||
_GLAccounts.row_ConnectInfo = _GLAccounts.ConnectInfo
|
||||
|
||||
If _GLAccounts.PartnerType = ePartnerType.eReceivables Then
|
||||
_GLAccounts.PartnerType = ePartnerType.eReceivables
|
||||
_GLAccounts.row_CreditChartOfAccounts = _GLAccounts.row_ChartOfAccounts
|
||||
_GLAccounts.row_DebitChartOfAccounts = _GLAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
Else
|
||||
_GLAccounts.PartnerType = ePartnerType.ePayabels
|
||||
_GLAccounts.row_CreditChartOfAccounts = _GLAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eIn)
|
||||
_GLAccounts.row_DebitChartOfAccounts = _GLAccounts.row_ChartOfAccounts
|
||||
End If
|
||||
|
||||
|
||||
_BruttoHUF = _GLAccounts.row_AmountHUF
|
||||
If _GLAccounts.row_VAT IsNot Nothing Then
|
||||
If _GLAccounts.row_VAT.InversState = True Then
|
||||
_VATHUF = Math.Round(_BruttoHUF * _GLAccounts.row_VAT.InversKeyValue, 0, MidpointRounding.AwayFromZero)
|
||||
_NettoHUF = _BruttoHUF
|
||||
_BruttoHUF = _NettoHUF + _VATHUF
|
||||
Else
|
||||
_VATHUF = Math.Round(_BruttoHUF / (1 + _GLAccounts.row_VAT.KeyValue) * _GLAccounts.row_VAT.KeyValue, 0, MidpointRounding.AwayFromZero)
|
||||
_NettoHUF = _BruttoHUF - _VATHUF
|
||||
End If
|
||||
Else
|
||||
_VATHUF = 0
|
||||
_NettoHUF = _BruttoHUF - _VATHUF
|
||||
End If
|
||||
|
||||
' -- ÁFA vizsgálata --------------------------------------------------------------------------------------------
|
||||
' -- Létrehoz egy sort a nettó összegre ------------------------------------------------------------------------------------------
|
||||
|
||||
_GLRows = New GLRows(_uow)
|
||||
_GLRows.PartnerType = _GLAccounts.PartnerType
|
||||
If _GLRows.PartnerType = ePartnerType.eReceivables Then
|
||||
_GLRows.DebitAmountHUF = _NettoHUF
|
||||
_GLRows.DebitAmountDEV = _NettoDEV
|
||||
Else
|
||||
_GLRows.CreditAmountHUF = _NettoHUF
|
||||
_GLRows.CreditAmountDEV = _NettoDEV
|
||||
End If
|
||||
_GLRows.AddGLRows(_GLAccounts, _GLAccounts.row_DebitChartOfAccounts, _GLAccounts.row_CreditChartOfAccounts, _
|
||||
_NettoDEV, _NettoHUF, Nothing, _
|
||||
_GLAccounts.Customers, _GLAccounts.row_DateVAT, _GLAccounts.row_VAT, _
|
||||
_GLAccounts.row_NoteRows, _GLAccounts.row_UniqueObjects, _
|
||||
_GLAccounts.row_Controlling, _GLAccounts.row_JobNumberObjects, _GLAccounts.row_CostPlace, _
|
||||
_GLAccounts.row_CostHolder, _GLAccounts.row_ConnectInfo, eGLRowsTypeVAT.eNettoRow, _GUID, _
|
||||
eTransactionType.eNotSet, eCashType.ePartner, _GLAccounts.PartnerType)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
'-- ÁFA összesítés egy, egy sorban !
|
||||
Dim _XmlNodeList_afaosszesites As XmlNodeList = _XML.SelectNodes("JsonXML/params/afaosszesitesek")
|
||||
For Each _XmlNode As XmlNode In _XmlNodeList_afaosszesites
|
||||
If _XmlNode.HasChildNodes Then
|
||||
For Each _XmlNode_afaosszesites As XmlNode In _XmlNode.ChildNodes
|
||||
_VATHUF = CDbl(Replace(_XmlNode_afaosszesites.SelectSingleNode("afa").InnerText, ".", _decimalSeparator))
|
||||
_GLAccounts.row_VAT = _uow.FindObject(Of VAT)(CriteriaOperator.Parse("Oid=?", _NV_VAT(_XmlNode_afaosszesites.SelectSingleNode("afakulcs").InnerText)))
|
||||
|
||||
_GLAccounts.row_CreditChartOfAccounts = _GLAccounts.row_VAT.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
_GLAccounts.row_DebitChartOfAccounts = _GLAccounts.Customers.CustomersGLParameters.GetChartOfAccounts(_GLAccounts.DateExecution.Year, eVATMode.eOut)
|
||||
_GLRows = New GLRows(_uow)
|
||||
_GLRows.PartnerType = _GLAccounts.PartnerType
|
||||
If _GLRows.PartnerType = ePartnerType.eReceivables Then
|
||||
_GLRows.DebitAmountHUF = _VATHUF
|
||||
_GLRows.DebitAmountDEV = _VATDEV
|
||||
Else
|
||||
_GLRows.CreditAmountHUF = _VATHUF
|
||||
_GLRows.CreditAmountDEV = _VATDEV
|
||||
End If
|
||||
_GLRows.AddGLRows(_GLAccounts, _GLAccounts.row_DebitChartOfAccounts, _GLAccounts.row_CreditChartOfAccounts, _
|
||||
_VATDEV, _VATHUF, _GLAccounts.row_LiquidAssets, _
|
||||
_GLAccounts.Customers, _GLAccounts.row_DateVAT, _GLAccounts.row_VAT, _GLAccounts.row_NoteRows, _
|
||||
_GLAccounts.row_UniqueObjects, _GLAccounts.row_Controlling, _GLAccounts.row_JobNumberObjects, _
|
||||
_GLAccounts.row_CostPlace, _GLAccounts.row_CostHolder, _GLAccounts.row_ConnectInfo, _
|
||||
eGLRowsTypeVAT.eVATRow, Nothing, eTransactionType.eNotSet, eCashType.ePartner, _GLAccounts.PartnerType)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
'// Számla véglegesítése
|
||||
_GLAccounts.IsEditable = False
|
||||
For Each _GLRows In _GLAccounts.GLRows
|
||||
_GLRows.ConnectInfo = _GLAccounts.row_ConnectInfo
|
||||
_GLRows.DateVAT = _GLAccounts.row_DateVAT
|
||||
If _GLRows.GLHeader.CurrencyName.ShortName <> "HUF" Then
|
||||
If _GLAccounts.PartnerType = ePartnerType.ePayabels Then
|
||||
If _GLRows.GLRowsTypeVAT <> eGLRowsTypeVAT.eVATRow Then
|
||||
_GLRows.AmountHUF = Math.Round(Math.Round(_GLAccounts.CurrencyRate, 2, MidpointRounding.AwayFromZero) * Math.Round(_GLRows.AmountDEV, 2, MidpointRounding.AwayFromZero), 0, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
If _GLRows.GLRowsTypeVAT = eGLRowsTypeVAT.eVATRow Then
|
||||
_GLRows.AmountHUF = Math.Round(Math.Round(_GLAccounts.CurrencyRateVAT, 2, MidpointRounding.AwayFromZero) * Math.Round(_GLRows.AmountDEV, 2, MidpointRounding.AwayFromZero), 0, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
Else
|
||||
_GLRows.AmountHUF = Math.Round(Math.Round(_GLAccounts.CurrencyRate, 2, MidpointRounding.AwayFromZero) * Math.Round(_GLRows.AmountDEV, 2, MidpointRounding.AwayFromZero), 0, MidpointRounding.AwayFromZero)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
_GLAccounts.RecalculateTotal()
|
||||
End If
|
||||
_uow.CommitChanges()
|
||||
SaveAuditTrail(_uow)
|
||||
GLFunctions.ReconfigurePCI(_uow, _GLAccounts.CustomersFrom, _GLAccounts.Customers, _GLAccounts.PartnerType, _GLAccounts.ConnectInfo)
|
||||
_uow.CommitChanges()
|
||||
|
||||
Dim _EndTime As DateTime = Now
|
||||
Dim _ActTime As TimeSpan = _EndTime.Subtract(_StartTime)
|
||||
If IsService Then
|
||||
'Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Küldés : " + String.Format("Record: [Customer: {1}, GLAccounts: {2}]", _Customers.Oid_DH, _GLAccounts.DocumentNumber))
|
||||
Else
|
||||
WriteStatisticFile(String.Format("Current time: {0}, Record: [Customer: {1}, GLAccounts: {2}]", _ActTime.ToString, _Customers.Oid_DH, _GLAccounts.DocumentNumber), Environment.CurrentDirectory + "Statistic.txt")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Module
|
||||
@@ -0,0 +1,16 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Module GlobalVariables
|
||||
Public GLOBAL_Index As Int32 = 0
|
||||
Public Sub WriteErrorLog(_ex As String, _errorLogFile As String)
|
||||
Dim _StreamWriter As New StreamWriter(_errorLogFile, True)
|
||||
_StreamWriter.WriteLine(_ex)
|
||||
_StreamWriter.Close()
|
||||
End Sub
|
||||
Public Sub WriteStatisticFile(_Text As String, _StatLogFile As String)
|
||||
Dim _StreamWriter As New StreamWriter(_StatLogFile, True)
|
||||
_StreamWriter.WriteLine(_Text)
|
||||
_StreamWriter.Close()
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,38 @@
|
||||
Imports System.Resources
|
||||
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("SISBusiness.RabbitMQ.Module")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("SIS Rendszerház")>
|
||||
<Assembly: AssemblyProduct("SISBusiness RabbitMQ Module")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2014")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("8381d3e7-487d-4b75-a51c-c2f3a43df103")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
|
||||
<Assembly: AssemblyVersion("13.2.6.1001")>
|
||||
<Assembly: AssemblyFileVersion("13.2.6.1001")>
|
||||
|
||||
<Assembly: NeutralResourcesLanguageAttribute("")>
|
||||
@@ -0,0 +1,240 @@
|
||||
Imports DevExpress.Xpo
|
||||
Imports System.Configuration
|
||||
Imports SISBusiness.Module
|
||||
Imports DevExpress.Data.Filtering
|
||||
Imports System.Threading
|
||||
Imports RabbitMQ.Client
|
||||
|
||||
|
||||
Public Module PublishCustomers
|
||||
Public Sub PublishCustomers(_errorLogFile As String, _Session As DevExpress.Xpo.Session, Optional IsService As Boolean = False)
|
||||
Try
|
||||
If _Session IsNot Nothing Then
|
||||
Dim _Customers As Customers = Nothing
|
||||
If _Session.IsConnected Then
|
||||
Dim _uow As New UnitOfWork(_Session.DataLayer)
|
||||
' Dim _Customers_Collection As New XPCollection(Of Customers)(_uow, CriteriaOperator.Parse("IsNull(Oid_DH)=False AND Oid_DH<>'' AND ObjectChanged > QueueUpdated")) 'CriteriaOperator.Parse("ObjectChanged>QueueUpdated"))
|
||||
Dim _Customers_Collection As New XPCollection(Of Customers)(_uow, CriteriaOperator.Parse("ObjectChanged > QueueUpdated")) 'CriteriaOperator.Parse("ObjectChanged>QueueUpdated"))
|
||||
If _Customers_Collection.Count > 0 Then
|
||||
Dim _factory As ConnectionFactory
|
||||
Dim _connection As IConnection
|
||||
Dim _channel As IModel
|
||||
|
||||
_factory = New ConnectionFactory
|
||||
_factory.HostName = ConfigurationManager.AppSettings("Factory_HostName")
|
||||
_factory.UserName = ConfigurationManager.AppSettings("Factory_UserName")
|
||||
_factory.Password = ConfigurationManager.AppSettings("Factory_Password")
|
||||
_factory.VirtualHost = ConfigurationManager.AppSettings("Factory_VirtualHost")
|
||||
|
||||
_connection = _factory.CreateConnection
|
||||
_channel = _connection.CreateModel
|
||||
|
||||
Dim _Exchange_Name = ConfigurationManager.AppSettings("Exchange_Name")
|
||||
Dim _Exchange_RoutingKey As String = ConfigurationManager.AppSettings("Exchange_RoutingKey")
|
||||
Dim _IBasicProperties As IBasicProperties = _channel.CreateBasicProperties
|
||||
|
||||
For Each _Customers In _Customers_Collection
|
||||
If _Customers.ObjectChanged > _Customers.QueueUpdated Then
|
||||
Dim _Text4Send As String = CreateCustomerText(_Customers, _uow, _errorLogFile)
|
||||
Dim uTime As Integer
|
||||
uTime = (DateTime.UtcNow - New DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds
|
||||
|
||||
_IBasicProperties.Timestamp = New AmqpTimestamp(uTime)
|
||||
_IBasicProperties.MessageId = Guid.NewGuid().ToString
|
||||
_IBasicProperties.ContentType = "application/json"
|
||||
_IBasicProperties.ContentEncoding = "UTF-8"
|
||||
|
||||
|
||||
_IBasicProperties.Headers = New Collections.Generic.Dictionary(Of String, Object)
|
||||
_IBasicProperties.Headers.Add("mq3c-message-type", "MQ3CMessage_JSON_RPC")
|
||||
|
||||
_channel.BasicPublish(_Exchange_Name, _Exchange_RoutingKey, _IBasicProperties, StrToByteArray(_Text4Send))
|
||||
_Customers.QueueUpdated = GetSQLTime(_uow)
|
||||
_Customers.Save()
|
||||
_uow.CommitChanges()
|
||||
If IsService Then
|
||||
' Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Küldés: [Customer: " + _Customers.Oid_DH + "]")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
_channel.Close()
|
||||
_connection.Close()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
If IsService Then
|
||||
'Diagnostics.EventLog.WriteEntry(ConfigurationManager.AppSettings("ServiceName"), "Küldés HIBA : " + ex.Message)
|
||||
Else
|
||||
WriteErrorLog(Now + " : " + ex.Message, _errorLogFile)
|
||||
End If
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
Public Function StrToByteArray(str As String) As Byte()
|
||||
Dim encoding As New System.Text.UTF8Encoding()
|
||||
Return encoding.GetBytes(str)
|
||||
End Function
|
||||
Private Function CreateCustomerText(_Customers As Customers, _Session As Session, _errorLogFile As String) As String
|
||||
Dim _CustomersText As String = ""
|
||||
Try
|
||||
_CustomersText += "{""jsonrpc"":""2.0"",""method"":""ugyfelimport"",""params"":{ ""ugyfel"":{"
|
||||
_CustomersText += """id"":""" + _Customers.Oid_DH + ""","
|
||||
_CustomersText += """ugyfelszam"":""" + _Customers.CustomerNumber + ""","
|
||||
'_CustomersText += """kulsougyfelazonosito"":"""","
|
||||
_CustomersText += """nev"":""" + _Customers.Name + ""","
|
||||
'_CustomersText += """nev"":""" + "ÁRVÍZTŰRŐTÜKÖRFÚRÓGÉP árvíztűrőtükörfúrógép" + ""","
|
||||
If _Customers.Address1 IsNot Nothing Then
|
||||
If _Customers.Address1.Country IsNot Nothing Then
|
||||
_CustomersText += """orszag"":""" + _Customers.Address1.Country.Name + ""","
|
||||
Else
|
||||
_CustomersText += """orszag"":"""","
|
||||
End If
|
||||
_CustomersText += """varos"":""" + _Customers.Address1.City + ""","
|
||||
'_CustomersText += """emajto"":"""","
|
||||
_CustomersText += """irszam"":""" + _Customers.Address1.ZipPostal + ""","
|
||||
_CustomersText += """utca"":""" + _Customers.Address1.Street + ""","
|
||||
Else
|
||||
_CustomersText += """orszag"":"""","
|
||||
_CustomersText += """varos"":"""","
|
||||
''_CustomersText += """emajto"":"""","
|
||||
_CustomersText += """irszam"":"""","
|
||||
_CustomersText += """utca"":"""","
|
||||
End If
|
||||
|
||||
'_CustomersText += """hazszam"":"""","
|
||||
'_CustomersText += """szigsz"":"""","
|
||||
'_CustomersText += """jogositvanyszam"":"""","
|
||||
'_CustomersText += """utlevelszam"":"""","
|
||||
'_CustomersText += """lakcimkartyaszam"":"""","
|
||||
If _Customers.MotherName IsNot Nothing Then
|
||||
_CustomersText += """anyjaneve"":""" + _Customers.MotherName + ""","
|
||||
Else
|
||||
_CustomersText += """anyjaneve"":"""","
|
||||
End If
|
||||
_CustomersText += """szuletesidatum"":""" + Format(_Customers.BirthDate.Date, "yyyy-MM-dd") + ""","
|
||||
If _Customers.BirthAddress IsNot Nothing Then
|
||||
_CustomersText += """szuletesihely"":""" + _Customers.BirthAddress.City + ""","
|
||||
Else
|
||||
_CustomersText += """szuletesihely"":"""","
|
||||
End If
|
||||
'_CustomersText += """szuletesinev"":"""","
|
||||
'_CustomersText += """meghatalmazott_nev"":"""","
|
||||
'_CustomersText += """meghatalmazott_szuletesinev"":"""","
|
||||
'_CustomersText += """meghatalmazott_anyjaneve"":"""","
|
||||
'_CustomersText += """meghatalmazott_szigsz"":"""","
|
||||
'_CustomersText += """meghatalmazott_jogositvanyszam"":"""","
|
||||
'_CustomersText += """meghatalmazott_utlevelszam"":"""","
|
||||
'_CustomersText += """meghatalmazott_lakcimkartyaszam"":"""","
|
||||
'_CustomersText += """telefonszam"":"""","
|
||||
'_CustomersText += """fax"":"""","
|
||||
_CustomersText += """email"":""" + _Customers.Email + ""","
|
||||
''_CustomersText += """eszamla_email"":"""","
|
||||
_CustomersText += """megjegyzes"":""" + _Customers.Description + ""","
|
||||
'_CustomersText += """kiemelt"":"""","
|
||||
'_CustomersText += """letrehozva"":"""","
|
||||
'_CustomersText += """letrehozta"":"""","
|
||||
'_CustomersText += """modositva"":"""","
|
||||
'_CustomersText += """modositotta"":"""","
|
||||
'_CustomersText += """torolve"":"""","
|
||||
'_CustomersText += """torolte"":"""","
|
||||
'_CustomersText += """jelleg"":"""","
|
||||
_CustomersText += """cegjegyzekszam"":""" + _Customers.CompanyRegistrationNumber + ""","
|
||||
If _Customers.VATNumber IsNot Nothing Then
|
||||
_CustomersText += """adoszam"":""" + _Customers.VATNumber + ""","
|
||||
Else
|
||||
_CustomersText += """adoszam"":"""","
|
||||
End If
|
||||
'_CustomersText += """belsomegjegyzes"":"""","
|
||||
'_CustomersText += """levelezesinev"":"""","
|
||||
'If _Customers.Address2 IsNot Nothing Then
|
||||
' If _Customers.Address2.Country IsNot Nothing Then
|
||||
' _CustomersText += """levelezesiorszag"":""" + _Customers.Address2.Country.Name + ""","
|
||||
' Else
|
||||
' _CustomersText += """levelezesiorszag"":"""","
|
||||
' End If
|
||||
|
||||
' _CustomersText += """levelezesivaros"":""" + _Customers.Address2.City + ""","
|
||||
' _CustomersText += """levelezesiemajto"":"""","
|
||||
' _CustomersText += """levelezesiutca"":""" + _Customers.Address2.Street + ""","
|
||||
' _CustomersText += """levelezesihazszam"":"""","
|
||||
' _CustomersText += """levelezesiirszam"":""" + _Customers.Address2.ZipPostal + ""","
|
||||
'Else
|
||||
' _CustomersText += """levelezesiorszag"":"""","
|
||||
' _CustomersText += """levelezesivaros"":"""","
|
||||
' _CustomersText += """levelezesiemajto"":"""","
|
||||
' _CustomersText += """levelezesiutca"":"""","
|
||||
' _CustomersText += """levelezesihazszam"":"""","
|
||||
' _CustomersText += """levelezesiirszam"":"""","
|
||||
'End If
|
||||
If _Customers.CanUseMarketingInfo Then
|
||||
_CustomersText += """adataimarketingcelrahasznalhatok"":""1"","
|
||||
Else
|
||||
_CustomersText += """adataimarketingcelrahasznalhatok"":""0"","
|
||||
End If
|
||||
If _Customers.CanUseMarketingInfoThirdParts Then
|
||||
_CustomersText += """adataimarketingcelraharmadikfelnekkiadhatok"":""1"","
|
||||
Else
|
||||
_CustomersText += """adataimarketingcelraharmadikfelnekkiadhatok"":""0"","
|
||||
End If
|
||||
'_CustomersText += """telefonszam2"":"""","
|
||||
'_CustomersText += """telefonszam3"":"""","
|
||||
'_CustomersText += """szorszag"":"""","
|
||||
'_CustomersText += """sznev"":"""","
|
||||
'_CustomersText += """szadoszam"":"""","
|
||||
'_CustomersText += """szvaros"":"""","
|
||||
'_CustomersText += """szemajto"":"""","
|
||||
'_CustomersText += """szutca"":"""","
|
||||
'_CustomersText += """szhazszam"":"""","
|
||||
'_CustomersText += """szirszam"":"""","
|
||||
'_CustomersText += """ugyfeljutalek"":"""","
|
||||
'_CustomersText += """befizeteskonyvelendo"":"""","
|
||||
'_CustomersText += """email_penzugy"":"""","
|
||||
'_CustomersText += """iszamla_ugyfelazon"":"""","
|
||||
'_CustomersText += """felszolitando"":"""","
|
||||
'_CustomersText += """hangbemondastartozas"":"""","
|
||||
'_CustomersText += """megjegyzes_szamlara"":"""","
|
||||
'_CustomersText += """kapcsolattarto"":"""","
|
||||
'_CustomersText += """viszonteladokod"":"""","
|
||||
'_CustomersText += """viszontelado"":"""","
|
||||
'_CustomersText += """vevo"":"""","
|
||||
'_CustomersText += """szallito"":"""","
|
||||
'_CustomersText += """konyvelesi_parameter"":"""","
|
||||
'_CustomersText += """partner_ugyfelszam"":"""","
|
||||
'_CustomersText += """partner_viszonteladokod"":"""","
|
||||
'_CustomersText += """partner_nev"":"""","
|
||||
'_CustomersText += """szulo_ugyfel_ugyfelszam"":"""","
|
||||
'_CustomersText += """szulo_ugyfel_viszonteladokod"":"""","
|
||||
'_CustomersText += """szulo_ugyfel_nev"":"""","
|
||||
'_CustomersText += """terulet"":"""","
|
||||
_CustomersText += """sis_oid"":""" + _Customers.Oid.ToString + ""","
|
||||
_CustomersText += """bankszamlaszamok"":{"
|
||||
|
||||
Dim _Index As Long = 0
|
||||
For Each _CustomerBankAccounts As CustomerBankAccounts In _Customers.CustomerBankAccounts
|
||||
_CustomersText += """" + CInt(Math.Ceiling(Rnd() * 100000)).ToString + """: {"
|
||||
'_CustomersText += """id"": """","
|
||||
_CustomersText += """bankszamlaszam"": """ + _CustomerBankAccounts.AccountNumber + """"
|
||||
'_CustomersText += """szamlatulajdonos"": """","
|
||||
'_CustomersText += """megjegyzes"": """","
|
||||
If _Index = (_Customers.CustomerBankAccounts.Count - 1) Then
|
||||
_CustomersText += "}"
|
||||
Else
|
||||
_CustomersText += "},"
|
||||
End If
|
||||
_Index += 1
|
||||
Next
|
||||
|
||||
_CustomersText += "}" 'bankszámlaszámok vége vége
|
||||
_CustomersText += "}},""MQ3CMessage_JSON_RPC"":{"
|
||||
|
||||
_CustomersText += "}}" 'params vége és utolsó szekció
|
||||
Catch ex As Exception
|
||||
WriteErrorLog(Now + " : " + ex.Message, _errorLogFile)
|
||||
_CustomersText = ""
|
||||
End Try
|
||||
Return _CustomersText
|
||||
End Function
|
||||
End Module
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AC6169DB-F71A-4C6F-AA54-E21C3057E2A7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>SISBusiness.RabbitMQ.Module</RootNamespace>
|
||||
<AssemblyName>SISBusiness.RabbitMQ.Module</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Empty</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SISBusiness.Module\SISBusiness.Module.vbproj">
|
||||
<Project>{60bf693f-7dea-4cf6-85bd-ea96829d79dd}</Project>
|
||||
<Name>SISBusiness.Module</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.ExpressApp.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.ExpressApp.Xpo.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Persistent.Base.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Persistent.BaseImpl.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Xpo.v15.2, Version=15.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\..\..\..\jSON\Bin\Net\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RabbitMQ.Client">
|
||||
<HintPath>..\..\..\..\..\rabbirmq_client\bin\RabbitMQ.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RabbitMQ.ServiceModel">
|
||||
<HintPath>..\..\..\..\..\rabbirmq_client\bin\RabbitMQ.ServiceModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AuditTrailHandler.vb" />
|
||||
<Compile Include="GetCustomers.vb" />
|
||||
<Compile Include="GetGLAccounts.vb" />
|
||||
<Compile Include="GlobalVariables.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="PublishCustomers.vb" />
|
||||
<Compile Include="SISVersion.vb" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports System
|
||||
Imports System.Linq
|
||||
Imports System.Text
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Xml
|
||||
Imports RabbitMQ.Client
|
||||
Imports System.Diagnostics
|
||||
Imports System.Reflection
|
||||
Imports System.Configuration
|
||||
|
||||
Public Module SISVersion
|
||||
Public Sub SendSISVersion(_XML As System.Xml.XmlDocument, _BasicProperties As IBasicProperties)
|
||||
Dim _ReplyTo As String = _BasicProperties.ReplyTo
|
||||
Dim _RoutingKey As String = ""
|
||||
Dim _Excahnge As String = ""
|
||||
Dim _MessageBodyId As String = _XML.SelectSingleNode("JsonXML/id").InnerText.ToString
|
||||
If _ReplyTo.Contains("@") Then
|
||||
Dim _Data() As String = _ReplyTo.Split(New Char() {"@"})
|
||||
_RoutingKey = _Data(0)
|
||||
_Excahnge = _Data(1)
|
||||
If String.IsNullOrEmpty(_Excahnge) Then
|
||||
_Excahnge = ConfigurationManager.AppSettings("Exchange_Name")
|
||||
End If
|
||||
Else
|
||||
_RoutingKey = _ReplyTo
|
||||
_Excahnge = ConfigurationManager.AppSettings("Exchange_Name")
|
||||
End If
|
||||
|
||||
Dim _factory As ConnectionFactory
|
||||
Dim _connection As IConnection
|
||||
Dim _channel As IModel
|
||||
|
||||
_factory = New ConnectionFactory
|
||||
_factory.HostName = ConfigurationManager.AppSettings("Factory_HostName")
|
||||
_factory.UserName = ConfigurationManager.AppSettings("Factory_UserName")
|
||||
_factory.Password = ConfigurationManager.AppSettings("Factory_Password")
|
||||
_factory.VirtualHost = ConfigurationManager.AppSettings("Factory_VirtualHost")
|
||||
|
||||
_connection = _factory.CreateConnection
|
||||
_channel = _connection.CreateModel
|
||||
|
||||
Dim _IBasicProperties As IBasicProperties = _channel.CreateBasicProperties
|
||||
|
||||
Dim _UserId As String = System.Configuration.ConfigurationManager.AppSettings("Factory_UserName")
|
||||
Dim _CorrelationId As String = _BasicProperties.CorrelationId
|
||||
Dim uTime As Integer = (DateTime.UtcNow - New DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds
|
||||
Dim _Expiration As String = "17200000"
|
||||
Dim _MessageID As String = Guid.NewGuid.ToString
|
||||
|
||||
With _IBasicProperties
|
||||
.UserId = _UserId
|
||||
.Timestamp = New AmqpTimestamp(uTime)
|
||||
.MessageId = _MessageID
|
||||
.Headers = New Collections.Generic.Dictionary(Of String, Object)
|
||||
.CorrelationId = _CorrelationId
|
||||
.ContentType = "application/json"
|
||||
.ContentEncoding = "UTF-8"
|
||||
With .Headers
|
||||
.Add("mq3c-message-type", "MQ3CMessage_JSON_RPC")
|
||||
.Add("mq3clib-version", "1.0")
|
||||
.Add("mq3clib-appname", "SISBusiness")
|
||||
.Add("mq3clib-workername", "")
|
||||
.Add("mq3clib-workerid", "")
|
||||
.Add("mq3clib-environment", "testing/production")
|
||||
.Add("mq3clib-appversion", "1.0 RC")
|
||||
.Add("mq3clib-runtime", "")
|
||||
.Add("mq3clib-uniquid", Guid.NewGuid.ToString)
|
||||
End With
|
||||
End With
|
||||
|
||||
Dim _MessageText As String = GetSISVersion(_MessageBodyId)
|
||||
|
||||
_channel.BasicPublish(_Excahnge, _RoutingKey, _IBasicProperties, StrToByteArray(_MessageText))
|
||||
End Sub
|
||||
Public Function GetSISVersion(_MessageBodyId As String) As String
|
||||
Dim _Message As String
|
||||
_Message = "{""jsonrpc"": ""2.0"",""id"": """ + _MessageBodyId
|
||||
_Message += """,""result"": """
|
||||
Dim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly().Location)
|
||||
_Message += "ProductName: " + myFileVersionInfo.ProductName + "; "
|
||||
_Message += "FileVersion: " + myFileVersionInfo.FileVersion + "; "
|
||||
_Message += "ProductVersion: " + myFileVersionInfo.ProductVersion + "; "
|
||||
_Message += "OSVersion: " + Environment.OSVersion.VersionString + "; "
|
||||
_Message += "OSPlatform" + Environment.OSVersion.Platform.ToString + "; "
|
||||
_Message += "OSServicePack: " + Environment.OSVersion.ServicePack + ";"
|
||||
_Message += """,""MQ3CMessage_JSON_RPC"": {}}"
|
||||
|
||||
Return _Message
|
||||
End Function
|
||||
End Module
|
||||
Reference in New Issue
Block a user