Esempio n. 1
0
        private void SaveDataDetailResponse(ISunitpService _iSunitpService, Data pinaresDetail, string Guid)
        {
            foreach (var detail in pinaresDetail.DataList)
            {
                var pws21PinCl = new PWS21PINCL();
                pws21PinCl.SetValue("Guid", Guid);

                if (detail.Field.Equals("Saldo"))
                {
                    foreach (var item in detail.DataList)
                    {
                        if (item.Field.Equals("Tipo"))
                        {
                            pws21PinCl.SetValue("Tipo", item.Value);
                        }
                        if (item.Field.Equals("Concepto"))
                        {
                            pws21PinCl.SetValue("Concepto", item.Value);
                        }
                        if (item.Field.Equals("NumFactura"))
                        {
                            pws21PinCl.SetValue("NumFactura", item.Value);
                        }
                        if (item.Field.Equals("Cuota"))
                        {
                            pws21PinCl.SetValue("Cuota", item.Value);
                        }
                        if (item.Field.Equals("Valor"))
                        {
                            pws21PinCl.SetValue("Valor", item.Value);
                        }
                        if (item.Field.Equals("Moneda"))
                        {
                            pws21PinCl.SetValue("Moneda", item.Value);
                        }
                        if (item.Field.Equals("Vence"))
                        {
                            pws21PinCl.SetValue("Vence", item.Value);
                        }
                        if (item.Field.Equals("Periodo"))
                        {
                            pws21PinCl.SetValue("Periodo", item.Value);
                        }
                    }
                }

                _iSunitpService.AddObjLog("ConsultarSaldoRepository SaveDataDetailResponse", "00000000000000000000", "OBJETO ENVIADO", pws21PinCl.GetObject());
                //CallModel
                var edm = new EasyDataModels();
                edm.EasyCallInit(_oledbConnection, pws21PinCl);
                var pws21PinClResponse = edm.CallProcedure();
                _iSunitpService.AddObjLog("ConsultarSaldoRepository SaveDataDetailResponse", "00000000000000000000", "OBJETO RECIBIDO", pws21PinClResponse.GetObject());

                //ValidateResponse
                if (!edm.IsSuccessful())
                {
                    _iSunitpService.AddSingleLog(pws21PinClResponse.GetValue("_defaultError"));
                }
            }
        }
        private void SaveDataHeaderResponse(ISunitpService _iSunitpService, Data response)
        {
            var guid          = "";
            var codigo        = "";
            var mensaje       = "";
            var nucleo        = "";
            var pinaresDetail = new Data();

            foreach (var detail in response.DataList)
            {
                if (detail.Field.Equals("Guid"))
                {
                    guid = detail.Value;
                }
                if (detail.Field.Equals("Error"))
                {
                    foreach (var item in detail.DataList)
                    {
                        if (item.Field.Equals("Codigo"))
                        {
                            codigo = item.Value;
                        }
                        if (item.Field.Equals("Mensaje"))
                        {
                            mensaje = item.Value;
                        }
                    }
                }
            }

            var pws20PinCl = new PWS20PINCL();

            pws20PinCl.SetValue("Guid", guid);
            pws20PinCl.SetValue("Nucleo", nucleo);
            pws20PinCl.SetValue("Codigo", codigo);
            pws20PinCl.SetValue("Mensaje", mensaje);

            _iSunitpService.AddObjLog("ConsultarSaldoRepository SaveDataHeaderResponse", "00000000000000000000", "OBJETO ENVIADO", pws20PinCl.GetObject());
            //CallModel
            var edm = new EasyDataModels();

            edm.EasyCallInit(_oledbConnection, pws20PinCl);
            var pws20PinClResponse = edm.CallProcedure();

            _iSunitpService.AddObjLog("ConsultarSaldoRepository SaveDataHeaderResponse", "00000000000000000000", "OBJETO RECIBIDO", pws20PinClResponse.GetObject());

            //ValidateResponse
            if (!edm.IsSuccessful())
            {
                _iSunitpService.AddSingleLog(pws20PinClResponse.GetValue("_defaultError"));
            }
        }
Esempio n. 3
0
        public DataTransferObject DoProcess(DataTransferObject dataTransferObject)
        {
            var dataTransferObjectResponse = new DataTransferObject();

            dataTransferObjectResponse.Bank          = "HN";
            dataTransferObjectResponse.ExecuteMethod = dataTransferObject.ExecuteMethod;
            dataTransferObjectResponse.Error         = "00000000000000000000";
            dataTransferObjectResponse.ExternalError = "PROCESO REALIZADO CORRECTAMENTE";

            var edpf = new EasyDataProcessFactory();

            edpf.RegisterRepository(_iSunitpService, "BAN_MS_11_M_0_TEST_CONNECTION", new TestConnectionRepository());
            edpf.RegisterRepository(_iSunitpService, "BAN_MS_11_M_1_ACADEMIA_PINARES_CONSULTAR_SALDO", new ConsultarSaldoRepository());
            edpf.RegisterRepository(_iSunitpService, "BAN_MS_11_M_2_ACADEMIA_PINARES_PAGAR_CUOTA", new PagarCuotaRepository());
            edpf.RegisterRepository(_iSunitpService, "BAN_MS_11_M_3_ACADEMIA_PINARES_REVERSAR_PAGO", new ReversarPagoRepository());

            dataTransferObjectResponse = edpf.DoProcess(_iSunitpService, dataTransferObject);

            _iSunitpService.AddObjLog("AcademiaPinaresService DoProcess", dataTransferObjectResponse.Data.Error, dataTransferObjectResponse.Data.ExternalError, dataTransferObjectResponse);
            _iSunitpService.AddSingleLog("FIN DEL PROCESAMIENTO");
            _iSunitpService.SaveLog();

            return(dataTransferObjectResponse);
        }
Esempio n. 4
0
 public AcademiaPinaresService()
 {
     _iSunitpService = new SunitpService();
     _iSunitpService.SetInt("LAYER_3", "BANCO_MS_11", "ACADEMIA PINARES", "MICROSERVICIO DE ACADEMIA PINARES");
     _iSunitpService.AddSingleLog("INICIO DEL PROCESAMIENTO");
 }