示例#1
0
 /// <summary>
 /// Actualiza datos de poliza
 /// </summary>
 /// <param name="respuestaServicioPI"></param>
 internal void Actualizar(RespuestaServicioPI respuestaServicioPI)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters =
             AuxPolizaDAL.ObtenerParametrosActualizarPoliza(respuestaServicioPI);
         Update("Poliza_Actualizar", parameters);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
示例#2
0
 /// <summary>
 /// Actualiza datos de poliza
 /// </summary>
 /// <param name="respuestaServicioPI"></param>
 public void Actualizar(RespuestaServicioPI respuestaServicioPI)
 {
     try
     {
         Logger.Info();
         var polizaBL = new PolizaBL();
         polizaBL.Actualizar(respuestaServicioPI);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
示例#3
0
 /// <summary>
 /// Guarda el mensaje de error por el cual no
 /// se pudo ser procesada la poliza por el
 /// servicio de PI
 /// </summary>
 /// <returns></returns>
 internal void ActualizaMensajeSAP(RespuestaServicioPI respuestaServicioPI)
 {
     try
     {
         Logger.Info();
         var polizaDAL = new PolizaDAL();
         polizaDAL.ActualizaMensajeSAP(respuestaServicioPI);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
示例#4
0
        /// <summary>
        /// Obtiene los parametros necesarios para la
        /// ejecucion del procedimiento almacenado
        /// Poliza_ActualizaProcesadoSAP
        /// </summary>
        /// <param name="polizaID"></param>
        /// <param name="mensaje"></param>
        /// <returns></returns>
        internal static Dictionary <string, object> ObtenerParametrosMensajeSAP(RespuestaServicioPI respuestaServicioPI)
        {
            Dictionary <string, object> parametros;

            try
            {
                Logger.Info();
                parametros = new Dictionary <string, object>
                {
                    { "@PolizaID", respuestaServicioPI.PolizaID },
                    { "@Mensaje", respuestaServicioPI.Mensaje },
                };
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
            return(parametros);
        }
示例#5
0
        /// <summary>
        /// Genera los parametros necesarios para la ejecucion
        /// del procedimiento almacenado Poliza_Actualizar
        /// </summary>
        /// <returns></returns>
        internal static Dictionary <string, object> ObtenerParametrosActualizarPoliza(RespuestaServicioPI respuestaServicioPI)
        {
            Dictionary <string, object> parametros;

            try
            {
                Logger.Info();

                var xml =
                    new XElement("MT_POLIZA_PERIFERICO",
                                 from poliza in respuestaServicioPI.Polizas
                                 select new XElement("Datos",
                                                     new XElement("noref",
                                                                  poliza.NumeroReferencia),
                                                     new XElement("fecha_doc", poliza.FechaDocumento),
                                                     new XElement("fecha_cont", poliza.FechaContabilidad),
                                                     new XElement("clase_doc", poliza.ClaseDocumento),
                                                     new XElement("sociedad", poliza.Sociedad),
                                                     new XElement("moneda", poliza.Moneda),
                                                     new XElement("tipocambio", poliza.TipoCambio),
                                                     new XElement("texto_doc", poliza.TextoDocumento),
                                                     new XElement("mes", poliza.Mes),
                                                     new XElement("cuenta", poliza.Cuenta),
                                                     new XElement("proveedor", poliza.Proveedor),
                                                     new XElement("cliente", poliza.Cliente),
                                                     new XElement("indica_cme", poliza.IndicaCme),
                                                     new XElement("importe",
                                                                  "-0".Equals(poliza.Importe, StringComparison.
                                                                              InvariantCultureIgnoreCase) ||
                                                                  "-0.00".Equals(poliza.Importe, StringComparison.
                                                                                 InvariantCultureIgnoreCase)
                                                                      ? "0"
                                                                      : poliza.Importe),
                                                     new XElement("indica_imp", poliza.IndicaImp),
                                                     new XElement("centro_cto", poliza.CentroCosto),
                                                     new XElement("orden_int", poliza.OrdenInt),
                                                     new XElement("centro_ben", poliza.CentroBeneficio),
                                                     new XElement("texto_asig", poliza.TextoAsignado),
                                                     new XElement("concepto", poliza.Concepto),
                                                     new XElement("division", poliza.Division),
                                                     new XElement("clase_movt", poliza.ClaseMovimiento),
                                                     new XElement("bus_act", poliza.BusAct),
                                                     new XElement("periodo", poliza.Periodo),
                                                     new XElement("nolinea", poliza.NumeroLinea),
                                                     new XElement("ref1", poliza.Referencia1),
                                                     new XElement("ref2", poliza.Referencia2),
                                                     new XElement("ref3", poliza.Referencia3),
                                                     new XElement("fecha_imto", poliza.FechaImpuesto),
                                                     new XElement("cond_imto", poliza.CondicionImpuesto),
                                                     new XElement("clave_imto", poliza.ClaveImpuesto),
                                                     new XElement("tipo_ret", poliza.TipoRetencion),
                                                     new XElement("cod_ret", poliza.CodigoRetencion),
                                                     new XElement("imp_ret", poliza.ImpuestoRetencion),
                                                     new XElement("imp_iva", poliza.ImpuestoIva),
                                                     new XElement("archifolio",
                                                                  string.Concat(
                                                                      poliza.ArchivoFolio.Replace(".xml", string.Empty),
                                                                      ".xml")),
                                                     new XElement("DocumentoSAP", poliza.DocumentoSAP),
                                                     new XElement("DocumentoCancelacionSAP", poliza.DocumentoCancelacionSAP),
                                                     new XElement("Segmento", poliza.Segmento)
                                                     ));
                int organizacionID = respuestaServicioPI.Polizas[0].OrganizacionID;
                parametros = new Dictionary <string, object>
                {
                    { "@XmlPoliza", xml.ToString() },
                    { "@PolizaID", respuestaServicioPI.PolizaID },
                    { "@OrganizacionID", organizacionID },
                    { "@Estatus", EstatusEnum.Inactivo },
                };
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
            return(parametros);
        }