public static void SerializarLr(out string LoteXMLIF, eFact_RN.IBK.lote_response Lr) { //Deserializar ( pasar de FeaEntidades.InterFacturas.lote_comprobantes a string XML ) MemoryStream ms = new MemoryStream(); XmlTextWriter writer = new XmlTextWriter(ms, System.Text.Encoding.GetEncoding("ISO-8859-1")); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(Lr.GetType()); x.Serialize(writer, Lr); ms = (MemoryStream)writer.BaseStream; LoteXMLIF = eFact_RN.Tablero.ByteArrayToString(ms.ToArray()); ms.Close(); ms = null; }
public static void ActualizarDatosError(eFact_Entidades.Lote Lote, eFact_RN.IBK.lote_response Lr) { MemoryStream ms; System.Xml.XmlTextWriter writer; System.Xml.Serialization.XmlSerializer x; String XmlizedString; //Actualizar lote ms = new MemoryStream(); XmlizedString = null; writer = new XmlTextWriter(ms, System.Text.Encoding.GetEncoding("ISO-8859-1")); x = new System.Xml.Serialization.XmlSerializer(Lr.GetType()); x.Serialize(writer, Lr); ms = (MemoryStream)writer.BaseStream; XmlizedString = eFact_RN.Tablero.ByteArrayToString(ms.ToArray()); ms.Close(); ms = null; Lote.LoteXmlIF = XmlizedString; if (Lr.comprobante_response != null) { for (int i = 0; i < Lr.comprobante_response.Length; i++) { eFact_Entidades.Comprobante c = Lote.Comprobantes.Find((delegate(eFact_Entidades.Comprobante e1) { return e1.IdTipoComprobante == Convert.ToInt16(Lr.comprobante_response[i].tipo_de_comprobante.ToString()) && e1.NumeroComprobante == Lr.comprobante_response[i].numero_comprobante.ToString(); })); c.EstadoIFoAFIP = ""; //Actualizar comentario del comprobante ms = new MemoryStream(); XmlizedString = null; writer = new XmlTextWriter(ms, System.Text.Encoding.GetEncoding("ISO-8859-1")); x = new System.Xml.Serialization.XmlSerializer(Lr.comprobante_response[i].GetType()); x.Serialize(writer, Lr.comprobante_response[i]); ms = (MemoryStream)writer.BaseStream; XmlizedString = eFact_RN.Tablero.ByteArrayToString(ms.ToArray()); ms.Close(); ms = null; c.ComentarioIFoAFIP = XmlizedString; } } }