Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Brayan Sarmiento
API-Gateway-CHEC
Commits
2e963f0b
Commit
2e963f0b
authored
Jul 11, 2023
by
bsarmiento31
Browse files
Initial commit
parents
Changes
105
Show whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
2e963f0b
# Created by https://www.toptal.com/developers/gitignore/api/csharp
# Edit at https://www.toptal.com/developers/gitignore?templates=csharp
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
# End of https://www.toptal.com/developers/gitignore/api/csharp
\ No newline at end of file
gatewayGK.sln
0 → 100644
View file @
2e963f0b
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gatewayGK", "gatewayGK\gatewayGK.csproj", "{3E81A0D0-DF98-4680-89D2-B1FA801A42E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E81A0D0-DF98-4680-89D2-B1FA801A42E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E81A0D0-DF98-4680-89D2-B1FA801A42E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E81A0D0-DF98-4680-89D2-B1FA801A42E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E81A0D0-DF98-4680-89D2-B1FA801A42E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8974E0ED-D119-4199-A02C-FC25846EA5B6}
EndGlobalSection
EndGlobal
gatewayGK/Adaptadores/AdaptadorAddCustomerBirthdateRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Linq
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Adaptador para manejar la lógica de Restriccion de edad
/// </summary>
public
class
AdaptadorAddCustomerBirthdateRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddCustomerBirthdate"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./AddCustomerBirthdateRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
AddCustomerBirthdateRequest
));
AddCustomerBirthdateRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
AddCustomerBirthdateRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
dto
.
CustomerBirthdate
=
Util
.
LeeStringEnNodo
(
nodo
,
"./CustomerBirthdate"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
///
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorAddCustomerBirthdateRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorAddCustomerRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Adaptador para manejar la lógica de de agregar cliente
/// </summary>
public
class
AdaptadorAddCustomerRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddCustomer"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./AddCustomerRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
AddCustomerRequest
));
AddCustomerRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
AddCustomerRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
//if(dto.CustomerIdentifier.CustomerID > 0)
dto
.
CustomerIdentifier
.
CustomerID
=
Util
.
LeeStringEnNodo
(
nodo
,
".//CustomerID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
///
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorAddCustomerRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorAddItemRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador de agregar articulo
/// </summary>
public
class
AdaptadorAddItemRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddItem"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./AddItemRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
AddItemRequest
));
AddItemRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
AddItemRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
if
(
dto
.
ItemIdentifier
.
BarCode
!=
null
)
dto
.
ItemIdentifier
.
BarCode
.
ScanDataLabel
=
Util
.
LeeLongEnNodo
(
nodo
,
".//ScanDataLabel"
);
if
(
dto
.
ItemIdentifier
.
Quantity
>
0
)
dto
.
ItemIdentifier
.
Quantity
=
Util
.
LeeIntEnNodo
(
nodo
,
".//Quantity"
);
if
(
dto
.
ItemIdentifier
.
VoidFlag
==
true
)
dto
.
ItemIdentifier
.
VoidFlag
=
Util
.
LeeBoolEnNodo
(
nodo
,
".//VoidFlag"
);
if
(
dto
.
ItemIdentifier
.
ScaleWeight
>
0
)
dto
.
ItemIdentifier
.
ScaleWeight
=
Util
.
LeeLongEnNodo
(
nodo
,
".//ScaleWeight"
);
if
(
dto
.
ItemIdentifier
.
KeyedItemID
>
0
)
dto
.
ItemIdentifier
.
KeyedItemID
=
Util
.
LeeLongEnNodo
(
nodo
,
".//KeyedItemID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorAddItemRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorAddReceiptLinesRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador "Agregar a la bolsa"
/// </summary>
public
class
AdaptadorAddReceiptLinesRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddReceiptLines"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./AddReceiptLinesRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
AddReceiptLinesRequest
));
AddReceiptLinesRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
AddReceiptLinesRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorAddReceiptLinesRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorAddTenderDebitRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase creado para metodos de pago con tarjeta de debito o credito
/// </summary>
public
class
AdaptadorAddTenderDebitRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddTender"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./AddTenderRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
AddTenderRequest
));
AddTenderRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
AddTenderRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorAddTenderDebitRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorCancelAction.cs
0 → 100644
View file @
2e963f0b
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Linq
;
using
System.Xml.Serialization
;
using
static
EvaPOS_API_FRAME
.
DTO
.
CancelActionDTO
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para cancelar acción en el datáfono
/// </summary>
public
class
AdaptadorCancelAction
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:CancelAction"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./CancelActionRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
CancelActionRequest
));
CancelActionRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
CancelActionRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorCancelAction
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorGetTotalsRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador "Obtener Totales"
/// </summary>
public
class
AdaptadorGetTotalsRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:GetTotals"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./GetTotalsRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
GetTotalsRequest
));
GetTotalsRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
GetTotalsRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorGetTotalsRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorInitializeRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador Inicializar Chec
/// </summary>
public
class
AdaptadorInitializeRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:Initialize"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./InitializeRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
var
dto
=
new
InitializeRequestDTO
(
idSesion
,
tipoMensaje
);
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
OperatorID
=
Util
.
LeeStringEnNodo
(
nodo
,
"./OperatorID"
);
dto
.
TerminalNumber
=
Util
.
LeeIntEnNodo
(
nodo
,
"./TerminalNumber"
);
dto
.
Recovery
=
Util
.
LeeBoolEnNodo
(
nodo
,
"./Recovery"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorInitializeRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorPrintCurrentReceipts.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// En este adaptador, manejamos el proceso para imprimir el Ticket en la impresora
/// </summary>
public
class
AdaptadorPrintCurrentReceipts
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:PrintCurrentReceipts"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./PrintCurrentReceiptsRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
PrintCurrentReceiptsRequest
));
PrintCurrentReceiptsRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
PrintCurrentReceiptsRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorPrintCurrentReceipts
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorQueryStatusRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador Query Status
/// </summary>
public
class
AdaptadorQueryStatusRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:QueryStatus"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./QueryStatusRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
var
dto
=
new
QueryStatusRequestDTO
(
idSesion
,
tipoMensaje
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorQueryStatusRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorRemoveReceiptLines.cs
0 → 100644
View file @
2e963f0b
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
using
static
EvaPOS_API_FRAME
.
DTO
.
RemoveReceiptLinesDTO
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador Remover Lineas de CHEC
/// </summary>
public
class
AdaptadorRemoveReceiptLines
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:RemoveReceiptLines"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./RemoveReceiptLinesRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
RemoveReceiptLinesRequest
));
RemoveReceiptLinesRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
RemoveReceiptLinesRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorRemoveReceiptLines
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorReportStatusEventsRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Entrada ReportStatusEventsRequest
/// </summary>
public
class
AdaptadorReportStatusEventsRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:ReportStatusEvents"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./ReportStatusEventsRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
var
dto
=
new
ReportStatusEventsRequestDTO
(
idSesion
,
tipoMensaje
);
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorReportStatusEventsRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorReprintReceiptsRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador cuando se va a reimprimir una transacción
/// </summary>
public
class
AdaptadorReprintReceiptsRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:ReprintReceipts"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./ReprintReceiptsRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
ReprintReceiptsRequestDTO
));
ReprintReceiptsRequestDTO
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
ReprintReceiptsRequestDTO
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorReprintReceiptsRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorSignOffRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
public
class
AdaptadorSignOffRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:SignOff"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./SignOffRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
var
dto
=
new
SignOffRequestDTO
(
idSesion
,
tipoMensaje
);
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
OperadorID
=
Util
.
LeeStringEnNodo
(
nodo
,
"./OperatorID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorSignOffRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorSuspendTransactionRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Adaptador para suspender transacción
/// </summary>
public
class
AdaptadorSuspendTransactionRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:Suspend"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./SuspendTransactionRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
SuspendTransactionRequest
));
SuspendTransactionRequest
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
SuspendTransactionRequest
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
///
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorSuspendTransactionRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadorTerminateRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Crear adaptador para cerrar la lane
/// </summary>
public
class
AdaptadorTerminateRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:Terminate"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./TerminateRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
TerminateRequestDTO
));
TerminateRequestDTO
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
TerminateRequestDTO
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
//Cambio: LeeIntEnNodo por LeeStringEnNodo
dto
.
DestroySession
=
Util
.
LeeBoolEnNodo
(
nodo
,
"./DestroySession"
);
return
dto
;
}
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadorTerminateRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Adaptadores/AdaptadoresVoidTransactionRequest.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
EvaPosUtil
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
EvaPOS_API_FRAME.Adaptadores
{
/// <summary>
/// Clase para crear el adaptador de cancelar transacción
/// </summary>
public
class
AdaptadoresVoidTransactionRequest
:
IAdaptadorDTO
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:VoidTransaction"
;
public
string
NombreElementoXMLDatos
{
get
;
set
;
}
=
"./VoidTransactionRequest"
;
public
DTOBase
ObtieneDTO
(
int
idSesion
,
TipoMensaje
tipoMensaje
,
XmlElement
docXml
)
{
XmlNode
?
nodo
=
docXml
.
SelectSingleNode
(
NombreElementoXMLDatos
);
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
VoidTransactionDTO
));
VoidTransactionDTO
dto
;
XmlNodeReader
elemento
=
new
XmlNodeReader
(
nodo
);
dto
=
(
VoidTransactionDTO
)
serializer
.
Deserialize
(
elemento
);
if
(
nodo
==
null
)
throw
new
Exception
(
$"Elemento '
{
NombreElementoXMLDatos
}
'."
);
dto
.
IdSesion
=
idSesion
;
dto
.
TipoMensaje
=
tipoMensaje
;
dto
.
RequestID
=
Util
.
LeeIntEnNodo
(
nodo
,
"./RequestID"
);
return
dto
;
}
/// <summary>
/// Retorna una "shallow copy" del objeto.
/// </summary>
public
IAdaptadorDTO
CreaCopia
()
{
return
(
AdaptadoresVoidTransactionRequest
)
this
.
MemberwiseClone
();
}
}
}
gatewayGK/Comandos/AddCustomerBirthdateCmd.cs
0 → 100644
View file @
2e963f0b
using
EvaPOS_API_FRAME.DTO
;
using
EvaPOS_API_FRAME.RespuestasXML
;
using
EvaPOS_API_FRAME.RespuestasXML.RestriccionEdad
;
using
EvaPosSrvCmd
;
using
EvaPosSrvDTO
;
using
EvaPosSrvResp
;
using
Serilog
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EvaPOS_API_FRAME.Comandos
{
///<summary>
/// Comando para la construcción de la logica "Restricción de edad"
/// </summary>
public
class
AddCustomerBirthdateCmd
:
IComando
{
public
string
Referencia
{
get
;
set
;
}
=
"scsns:AddCustomerBirthdate"
;
/// <summary>
/// DTO con solicitud.
/// </summary>
public
AddCustomerBirthdateRequest
Request
{
get
;
private
set
;
}
/// <summary>
/// Procesa y responde AddCustomerBirthdateRequest.
/// </summary>
public
Respuestas
Ejecutar
()
{
Log
.
Debug
(
"Cmd AddCustomerBirthdateRequestCmd ejecutado. AddCustomerBirthdateRequest : {AddCustomerBirthdateRequest}"
,
Request
.
RequestID
);
int
requestId
=
Request
.
RequestID
;
var
addCustomerBirthdate
=
new
AddCustomerBirthdateResponse
(
1
,
TipoMensaje
.
Resp
,
requestId
);
return
(
new
Respuestas
{
addCustomerBirthdate
});
}
public
IComando
CreaCopia
()
{
return
(
AddCustomerBirthdateCmd
)
this
.
MemberwiseClone
();
}
public
void
CargaDTO
(
DTOBase
addCustomerBirthdateRequest
)
{
Request
=
(
AddCustomerBirthdateRequest
)
addCustomerBirthdateRequest
;
}
}
}
Prev
1
2
3
4
5
6
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment