public static void GuardaAccount(VO_Account csAccount) { string idSession = new clsCacheControl().RecuperarSesionId(); string FileCache = "vo_Account_" + idSession; string strPathXML = clsValidaciones.CacheTempCrea(); XmlSerializer SerializerRQ = new XmlSerializer(typeof(VO_Account)); StreamWriter WriterRQ = new StreamWriter(strPathXML + FileCache + ".xml"); try { SerializerRQ.Serialize(WriterRQ, csAccount); WriterRQ.Flush(); WriterRQ.Close(); } catch { WriterRQ.Flush(); WriterRQ.Close(); } }
public VO_Account RecuperarAccount() { VO_Account vo_Account = new VO_Account(); try { string idSession = new clsCacheControl().RecuperarSesionId(); string FileCache = "vo_Account_" + idSession; string strPathXML = clsValidaciones.CacheTempCrea(); TextReader txtReader = new StreamReader(strPathXML + FileCache + ".xml"); XmlSerializer SerializerRS = new XmlSerializer(typeof(VO_Account)); vo_Account = (VO_Account)SerializerRS.Deserialize(txtReader); txtReader.Close(); txtReader.Dispose(); } catch { vo_Account = null; } return(vo_Account); }