public List<UltimoNumeroComprobante> NumeracionPorComprobantes( Autorizacion autorizacion, int puntoDeVenta ) { List<UltimoNumeroComprobante> retorno = new List<UltimoNumeroComprobante>(); try { IList<IValorRespuestaWS> comprobantes = this.consultas.ObtenerTiposDeComprobante( autorizacion ); foreach ( Comprobante comprobante in comprobantes ) { int ultimoNumero = this.consultas.UltimoComprobante( autorizacion, puntoDeVenta, comprobante.Id ); retorno.Add( new UltimoNumeroComprobante() { TipoComprobante = comprobante.Id, UltimoNumero = ultimoNumero } ); } } catch ( ExcepcionFe error ) { ValidacionException ex = new ValidacionException( "NumeracionPorComprobantes", error.Message ); this.mensajeDeError = error.Message; throw ex; } return retorno; }
public List<UltimoNumeroComprobante> NumeracionPorComprobantesExportacion( Autorizacion autorizacion, int puntoDeVenta ) { List<UltimoNumeroComprobante> retorno = new List<UltimoNumeroComprobante>(); ConsultasWSFex consulta = new ConsultasWSFex( this.wsfex ); try { List<Comprobante> comprobantes = consulta.ObtenerTiposDeComprobante( autorizacion ); foreach ( Comprobante comprobante in comprobantes ) { long ultimoNumero = consulta.UltimoComprobante( autorizacion, puntoDeVenta, comprobante.Id ); retorno.Add( new UltimoNumeroComprobante() { TipoComprobante = comprobante.Id, UltimoNumero = (int) ultimoNumero } ); } } catch ( ExcepcionFe error ) { ValidacionException ex = new ValidacionException( "NumeracionPorComprobantes", error.Message ); this.MensajeDeError = error.Message; throw ex; } return retorno; }
public void ManejarError( Exception ex, string metodo, string mensajeLoco ) { if ( ex is SoapException ) { SoapException excepcionSoap = (SoapException)ex; switch ( excepcionSoap.Code.Name ) { case "xml.generationTime.invalid": mensajeLoco = "Hay diferencias entre la fecha y hora del equipo y la informada por el servicio de facturación electrónica. " + ex.Message; break; case "xml.expirationTime.invalid": mensajeLoco = "Hay diferencias entre la fecha y hora del equipo y la informada por el servicio de facturación electrónica. " + ex.Message; break; default: break; } } Exception miEx = new ValidacionException( metodo, mensajeLoco ); throw miEx; }