IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
EFA_WS.Service Class Reference

Summary description for Service1 More...

+ Inheritance diagram for EFA_WS.Service:
+ Collaboration diagram for EFA_WS.Service:

Classes

class  InsertPaketData
 Class that is used to pass data to the InsertPaketXml() method that is launched in a parallel thread. Thread is launched just because for SQLXML the thread must be STA, and thread launched by WS is not of this kind. More...
 

Public Member Functions

 Service ()
 Konstruktor. More...
 
bool GetAppSettingFlag (string flagname)
 
void ReportError (Exception ex)
 
string PosljiPaket_Base (string paketXml)
 
string PosljiPaket (string paketXml)
 Metoda je namenjena pošiljanju Xml paketa podatkov za fakturiranje. Z argumentom paketTipId povemo ali gre za ovrednoten ali neovrednoten paket podatkov. Podatek o viru (virId) je del sheme po kateri mora biti zgrajen paketXml; velja namreč pravilo, da lahko v enem paketu pošljemo podatke iz več virov (npr. UPO1 in UPO2), ki pa morajo biti vsi ovrednoteni ali neovrednoteni. More...
 
string PosljiPaketZip (byte[] paketZip)
 Metoda je namenjena pošiljanju Xml paketa podatkov za fakturiranjev komprimirani obliki. Z argumentom paketTipId povemo ali gre za ovrednoten ali neovrednoten paket podatkov. Podatek o viru (virId) je del sheme, po kateri mora biti zgrajen paketXml; velja namreč pravilo, da lahko v enem paketu pošljemo podatke iz več virov (npr. UPO1 in UPO2), ki pa morajo biti vsi ovrednoteni ali neovrednoteni. More...
 
int StevilkaSeje ()
 Vrne številko seje. Zaenkrat se metoda uporablja za testiranje, ali je WS sploh postavljen (vrniti mora št.>=0). More...
 
string PaketStatus (decimal paketid)
 Metoda vrne Xml (kot string) s podatki o statusu paketa. More...
 
byte[] PaketShema ()
 Metoda vrne byte[] serializiranega file-a (type FileInfo) PaketShema.xsd. More...
 
byte[] PaketStatusShema ()
 Metoda vrne byte[] serializiranega file-a (type FileInfo) PaketStatusShema.xsd. More...
 
DataSet PaketTipZalogaVrednosti ()
 Metoda vrne zalogo vrednosti za tipe paketa. More...
 
DataSet PaketStatusZalogaVrednosti ()
 
DataSet PodrocjaZalogaVrednosti ()
 

Static Public Member Functions

static byte[] CompressBytes (byte[] Original)
 
static byte[] UncompressBytes (byte[] zippedArray)
 
static byte[] UncompressBytes (byte[] zippedArray, int BufferSize)
 

Properties

bool DebugMode [get, set]
 
bool RemoteMode [get, set]
 

Events

ExceptionEventDelegate exEvent
 

Private Member Functions

string DecompressToString (byte[] paketZip, string ResultFilename)
 
void onExEvent (ExceptionEventArgs args)
 This triggers the exEvent. The point is that the eventhandler is called in the basic web service thread (in the thread where the event is initialized!). IMPORTANT: The event handler THROWS AN EXCEPTION (which happens in the basic thread, therefore execution of that thread is broken). If onExEvent() method is called in a parallel thread that was launched form the basic one then the event handler will be executed at approximately the same time as Join() is called for the parallel thread. More...
 
void Service_exEvent (object sender, ExceptionEventArgs e)
 
void ReadSettings ()
 
void Connect ()
 
void Disconnect ()
 
int CountStzapisov_EfaGlava (int PaketId)
 Returns number of entries in EfaGlava with a specified PaketId. More...
 
int CountStzapisov_EfaGlava (int PaketId, System.Data.SqlClient.SqlTransaction transaction)
 Returns number of entries in EfaGlava with a specified PaketId. More...
 
void SetPaketStatusZavrnjen (int PaketId)
 Sets status More...
 
void SetPaketStatus (int PaketId, int StatusId)
 Sets status of packet with a given PaketId to StatusId. More...
 
int InsertIntoEfaPaket (int podrocjeId, byte paketTipId, DateTime paketDatum, int stZapisov, decimal vsotaDokumentDatum, decimal vsotaCenaNeto, int paketStatusId)
 
void UpdateGlavaPostavke (decimal paketId)
 
void SaveXmlToDisk (string paketXml, decimal paketId, string FileName)
 
void InsertPaketXml (object arg)
 
string GetPaketStatusXml (decimal paketId, string ErrorFileName)
 
string GetPaketStatusXml (decimal paketId, string ErrorFileName, string ErrorString)
 Returns an XML document containing status of the given Packet. ErrorFileName should only be specified when the packet is inserted. More...
 
void SetPaketStatus (decimal paketId, int paketStatusId)
 Updates the field PaketStatusId for a given entry of the EfaPaket table, with the specified value. More...
 
void InsertIntoEfaPaketPovratnica (decimal paketId, string paketStatusXml, string exMessage, string exStackTrace)
 Insert a new entry for the given packet into the table EfaPaketPovratnica. More...
 
void InsertIntoEfaPaketPovratnica (decimal paketId, string paketStatusXml)
 
string GetXmlFileName (decimal paketId)
 
string GetXmlErrorFileName (decimal paketId)
 
string GetPaketSchemaPathName ()
 
string GetPaketStatusSchemaPathName ()
 
string GetPathName ()
 
string GetSQLServerTempFilePath ()
 
string GetCnnString ()
 
string GetCnnStringBulk ()
 
void InitializeComponent ()
 

Static Private Member Functions

static void IsertErrorInfoStatusXml (XmlDocument status, string filename)
 Adds to the XML document a node with a list of errors, which is extracted from a file created by the SqlXml tool (if the file exists). More...
 
static string IsertErrorMessageStatusXml (string status, string errorstring)
 Adds to the XML document a node with the error message. This is intended for errors that occur during insertion of XML document into the database. XML document is specified as a string argument, and a string containing an updated document is returned./// More...
 
static void IsertErrorMessageStatusXml (XmlDocument status, string errorstring)
 Adds to the XML document a node with the error message. This is intended for errors that occur during insertion of XML document into the database. More...
 

Private Attributes

bool flag_debug =false
 
bool queried_debug = false
 
bool flag_remote = false
 
bool queried_remote = false
 
string cnnString
 
string cnnStringBulk
 
string _paketSchemaPathName
 
string _paketStatusSchemaPathName
 
string _pathName
 
string _SQLServerTempFilePath
 
System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection()
 
System.Data.SqlClient.SqlTransaction trans = null
 
int paketId = -1
 
string result = "<Napaka/>"
 
string ErrorFileName = null
 

Static Private Attributes

static int _stevilkaSeje =0
 
static string selectPaketStatusZalogaVrednosti = "SELECT * FROM EfaPaketStatus"
 
static string selectPaketTipZalogaVrednosti = "SELECT * FROM EfaPaketTip"
 
static string selectPodrocjaZalogaVrednosti = "SELECT * FROM EfaPodrocjaView"
 
static readonly object syncObject = new object()
 

Detailed Description

Summary description for Service1

Constructor & Destructor Documentation

Member Function Documentation

bool EFA_WS.Service.GetAppSettingFlag ( string  flagname)
inline
string EFA_WS.Service.PosljiPaket ( string  paketXml)
inline

Metoda je namenjena pošiljanju Xml paketa podatkov za fakturiranje. Z argumentom paketTipId povemo ali gre za ovrednoten ali neovrednoten paket podatkov. Podatek o viru (virId) je del sheme po kateri mora biti zgrajen paketXml; velja namreč pravilo, da lahko v enem paketu pošljemo podatke iz več virov (npr. UPO1 in UPO2), ki pa morajo biti vsi ovrednoteni ali neovrednoteni.

Parameters
paketXml
Returns
Metoda vrne Xml s podatki o sprejetem paketu. V njem so podatki o Id-ju paketa, morebitnih napakah, itd.

References EFA_WS.Service.PosljiPaket_Base().

static byte [] EFA_WS.Service.CompressBytes ( byte[]  Original)
inlinestatic
static byte [] EFA_WS.Service.UncompressBytes ( byte[]  zippedArray)
inlinestatic
static byte [] EFA_WS.Service.UncompressBytes ( byte[]  zippedArray,
int  BufferSize 
)
inlinestatic
string EFA_WS.Service.DecompressToString ( byte[]  paketZip,
string  ResultFilename 
)
inlineprivate
string EFA_WS.Service.PosljiPaketZip ( byte[]  paketZip)
inline

Metoda je namenjena pošiljanju Xml paketa podatkov za fakturiranjev komprimirani obliki. Z argumentom paketTipId povemo ali gre za ovrednoten ali neovrednoten paket podatkov. Podatek o viru (virId) je del sheme, po kateri mora biti zgrajen paketXml; velja namreč pravilo, da lahko v enem paketu pošljemo podatke iz več virov (npr. UPO1 in UPO2), ki pa morajo biti vsi ovrednoteni ali neovrednoteni.

Parameters
paketXml
Returns
Metoda vrne Xml s podatki o sprejetem paketu. V njem so podatki o Id-ju paketa, morebitnih napakah, itd.

References EFA_WS.Service.DebugMode, EFA_WS.Service.DecompressToString(), EFA_WS.Service.PosljiPaket_Base(), EFA_WS.Service.ReportError(), and EFA_WS.Service.UncompressBytes().

int EFA_WS.Service.StevilkaSeje ( )
inline

Vrne številko seje. Zaenkrat se metoda uporablja za testiranje, ali je WS sploh postavljen (vrniti mora št.>=0).

Returns
Current ession number.

References EFA_WS.Service._stevilkaSeje.

string EFA_WS.Service.PaketStatus ( decimal  paketid)
inline

Metoda vrne Xml (kot string) s podatki o statusu paketa.

Parameters
paketIdId paketa, ki smo ga dobili ob pošiljanju paketa.
Returns

References EFA_WS.Service.GetPaketStatusXml(), and EFA_WS.Service.result.

byte [] EFA_WS.Service.PaketShema ( )
inline

Metoda vrne byte[] serializiranega file-a (type FileInfo) PaketShema.xsd.

Returns

References EFA_WS.Service._paketSchemaPathName, and EFA_WS.Service.ReportError().

byte [] EFA_WS.Service.PaketStatusShema ( )
inline

Metoda vrne byte[] serializiranega file-a (type FileInfo) PaketStatusShema.xsd.

Returns

References EFA_WS.Service._paketStatusSchemaPathName, and EFA_WS.Service.ReportError().

DataSet EFA_WS.Service.PaketTipZalogaVrednosti ( )
inline
DataSet EFA_WS.Service.PaketStatusZalogaVrednosti ( )
inline
DataSet EFA_WS.Service.PodrocjaZalogaVrednosti ( )
inline
void EFA_WS.Service.onExEvent ( ExceptionEventArgs  args)
inlineprivate

This triggers the exEvent. The point is that the eventhandler is called in the basic web service thread (in the thread where the event is initialized!). IMPORTANT: The event handler THROWS AN EXCEPTION (which happens in the basic thread, therefore execution of that thread is broken). If onExEvent() method is called in a parallel thread that was launched form the basic one then the event handler will be executed at approximately the same time as Join() is called for the parallel thread.

Parameters
args

References EFA_WS.Service.exEvent.

Referenced by EFA_WS.Service.GetPaketStatusXml(), EFA_WS.Service.InsertIntoEfaPaketPovratnica(), EFA_WS.Service.InsertPaketXml(), EFA_WS.Service.SaveXmlToDisk(), EFA_WS.Service.SetPaketStatus(), and EFA_WS.Service.UpdateGlavaPostavke().

void EFA_WS.Service.Connect ( )
inlineprivate
void EFA_WS.Service.Disconnect ( )
inlineprivate
int EFA_WS.Service.CountStzapisov_EfaGlava ( int  PaketId)
inlineprivate

Returns number of entries in EfaGlava with a specified PaketId.

Parameters
PaketIdPaketId whose corresponding entries in EfaGlava are counted.
Returns
Number of entries in EfaGlava with a given PaketId.
int EFA_WS.Service.CountStzapisov_EfaGlava ( int  PaketId,
System.Data.SqlClient.SqlTransaction  transaction 
)
inlineprivate

Returns number of entries in EfaGlava with a specified PaketId.

Parameters
PaketIdPaketId whose corresponding entries in EfaGlava are counted.
Returns
Number of entries in EfaGlava with a given PaketId.

References EFA_WS.Service.cnn.

void EFA_WS.Service.SetPaketStatusZavrnjen ( int  PaketId)
inlineprivate

Sets status

Parameters
PaketId

References EFA_WS.Service.SetPaketStatus().

Referenced by EFA_WS.Service.PosljiPaket_Base().

void EFA_WS.Service.SetPaketStatus ( int  PaketId,
int  StatusId 
)
inlineprivate

Sets status of packet with a given PaketId to StatusId.

Parameters
PaketIdId of entry in EfaPaket.
StatusIdValue to which PaketStatusId is set.

References EFA_WS.Service.cnn.

Referenced by EFA_WS.Service.Service_exEvent(), and EFA_WS.Service.SetPaketStatusZavrnjen().

int EFA_WS.Service.InsertIntoEfaPaket ( int  podrocjeId,
byte  paketTipId,
DateTime  paketDatum,
int  stZapisov,
decimal  vsotaDokumentDatum,
decimal  vsotaCenaNeto,
int  paketStatusId 
)
inlineprivate
void EFA_WS.Service.UpdateGlavaPostavke ( decimal  paketId)
inlineprivate
void EFA_WS.Service.SaveXmlToDisk ( string  paketXml,
decimal  paketId,
string  FileName 
)
inlineprivate
static void EFA_WS.Service.IsertErrorInfoStatusXml ( XmlDocument  status,
string  filename 
)
inlinestaticprivate

Adds to the XML document a node with a list of errors, which is extracted from a file created by the SqlXml tool (if the file exists).

Parameters
statusXML document that is updated with error information.
filenameName of the file that contains information on errors.

Referenced by EFA_WS.Service.GetPaketStatusXml().

static string EFA_WS.Service.IsertErrorMessageStatusXml ( string  status,
string  errorstring 
)
inlinestaticprivate

Adds to the XML document a node with the error message. This is intended for errors that occur during insertion of XML document into the database. XML document is specified as a string argument, and a string containing an updated document is returned.///

Parameters
statusString containing the original XML document representing the packet status.
errorstringError message to be inserted in the XML document.
Returns
String representing the updated document.

Referenced by EFA_WS.Service.GetPaketStatusXml(), and EFA_WS.Service.PosljiPaket_Base().

static void EFA_WS.Service.IsertErrorMessageStatusXml ( XmlDocument  status,
string  errorstring 
)
inlinestaticprivate

Adds to the XML document a node with the error message. This is intended for errors that occur during insertion of XML document into the database.

Parameters
statusXML document that is updated with error information.
errorstringString containing error messages.
string EFA_WS.Service.GetPaketStatusXml ( decimal  paketId,
string  ErrorFileName 
)
inlineprivate
string EFA_WS.Service.GetPaketStatusXml ( decimal  paketId,
string  ErrorFileName,
string  ErrorString 
)
inlineprivate

Returns an XML document containing status of the given Packet. ErrorFileName should only be specified when the packet is inserted.

Parameters
paketIdId of the packet whose information is returned as XML string.
ErrorFileNameEventual error file that was created by SqlXML, or null if no error file is provided. This parameter can only be passed immediately after inserting the packet into the database, when the error file still exists. If ErrorFile is specified then the method inserts information form the file to the returned XML string.
Returns
An Xml string containing information about packet status.

References EFA_WS.Service._paketStatusSchemaPathName, EFA_WS.ExceptionEventArgs.Ex, EFA_WS.Service.IsertErrorInfoStatusXml(), EFA_WS.Service.IsertErrorMessageStatusXml(), EFA_WS.Service.onExEvent(), and EFA_WS.Service.ReportError().

void EFA_WS.Service.SetPaketStatus ( decimal  paketId,
int  paketStatusId 
)
inlineprivate

Updates the field PaketStatusId for a given entry of the EfaPaket table, with the specified value.

Parameters
paketIdID of the packet for which the entry must be updatet.
paketStatusIdThe value of the PaketStatusId field that should be set for the given entry.

References EFA_WS.Service.cnn, EFA_WS.ExceptionEventArgs.Ex, EFA_WS.Service.onExEvent(), EFA_WS.Service.paketId, and EFA_WS.Service.ReportError().

void EFA_WS.Service.InsertIntoEfaPaketPovratnica ( decimal  paketId,
string  paketStatusXml,
string  exMessage,
string  exStackTrace 
)
inlineprivate

Insert a new entry for the given packet into the table EfaPaketPovratnica.

Parameters
paketIdID of the packet for which data is inserted.
paketStatusXmlXML document describing the status of the packet that was sent to the web service.
exMessageEventual exception's message.
exStackTraceEventual exception's stack trace.

References EFA_WS.Service.cnn, EFA_WS.ExceptionEventArgs.Ex, EFA_WS.Service.onExEvent(), EFA_WS.Service.paketId, and EFA_WS.Service.ReportError().

Referenced by EFA_WS.Service.InsertIntoEfaPaketPovratnica(), EFA_WS.Service.PosljiPaket_Base(), and EFA_WS.Service.Service_exEvent().

void EFA_WS.Service.InsertIntoEfaPaketPovratnica ( decimal  paketId,
string  paketStatusXml 
)
inlineprivate
string EFA_WS.Service.GetXmlFileName ( decimal  paketId)
inlineprivate
string EFA_WS.Service.GetXmlErrorFileName ( decimal  paketId)
inlineprivate
string EFA_WS.Service.GetPaketSchemaPathName ( )
inlineprivate
string EFA_WS.Service.GetPaketStatusSchemaPathName ( )
inlineprivate
string EFA_WS.Service.GetPathName ( )
inlineprivate
string EFA_WS.Service.GetSQLServerTempFilePath ( )
inlineprivate
string EFA_WS.Service.GetCnnString ( )
inlineprivate
string EFA_WS.Service.GetCnnStringBulk ( )
inlineprivate
void EFA_WS.Service.InitializeComponent ( )
inlineprivate

Member Data Documentation

bool EFA_WS.Service.flag_debug =false
private
bool EFA_WS.Service.queried_debug = false
private
bool EFA_WS.Service.flag_remote = false
private
bool EFA_WS.Service.queried_remote = false
private
int EFA_WS.Service._stevilkaSeje =0
staticprivate
string EFA_WS.Service.cnnStringBulk
private
string EFA_WS.Service._paketSchemaPathName
private
string EFA_WS.Service._paketStatusSchemaPathName
private
string EFA_WS.Service._pathName
private
string EFA_WS.Service._SQLServerTempFilePath
private
string EFA_WS.Service.selectPaketStatusZalogaVrednosti = "SELECT * FROM EfaPaketStatus"
staticprivate
string EFA_WS.Service.selectPaketTipZalogaVrednosti = "SELECT * FROM EfaPaketTip"
staticprivate
string EFA_WS.Service.selectPodrocjaZalogaVrednosti = "SELECT * FROM EfaPodrocjaView"
staticprivate
readonly object EFA_WS.Service.syncObject = new object()
staticprivate
System.Data.SqlClient.SqlTransaction EFA_WS.Service.trans = null
private
string EFA_WS.Service.ErrorFileName = null
private

Property Documentation

bool EFA_WS.Service.DebugMode
getset
bool EFA_WS.Service.RemoteMode
getset

Event Documentation

ExceptionEventDelegate EFA_WS.Service.exEvent
private

The documentation for this class was generated from the following file: