示例#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"));
            }
        }