public CardVisibilityManager(string sGuidCard, string strConnection) { Guid oCardId; if (sGuidCard.Length > 12) // set the guid of the card { oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(sGuidCard.Substring(24, 12)).ToString("000000000000")); } else { oCardId = new Guid("64556990-b196-425c-a0b9-" + int.Parse(sGuidCard).ToString("000000000000")); } SVAOLLib.Card oCard = new SVAOLLib.Card(); oCard.GUIDconnect = strConnection; oCard.GuidCard = oCardId.ToString(); oCard.LoadFromGuid(); sVisibilityXml = oCard.GetVisibilityAsXML(); sVisibilityXml = sVisibilityXml.Substring(0, sVisibilityXml.Length - 1); using (XmlReader xmlReader = XmlReader.Create(new StringReader(sVisibilityXml))) { XmlSerializer serializer = new XmlSerializer(typeof(SENDOBJECT)); SENDOBJECT deserializedVisEntity = serializer.Deserialize(xmlReader) as SENDOBJECT; oUsersInArchiveTypeDoc = (from item in deserializedVisEntity.Items where item.GetType().ToString() == "Siav.APFlibrary.Model.SENDOBJECTSENDENTITIES" let cardsdoctypes = item as SENDOBJECTSENDENTITIES from docType in cardsdoctypes.SENDENTITY select docType).ToList(); } }
public static List <SENDOBJECTSENDENTITIESSENDENTITY> getEntityVisibilityFromCard(string sVisibilityXml) { //File.WriteAllText(@"c:\tmp\pippo.xml", SendObjxml); sVisibilityXml = sVisibilityXml.Substring(0, sVisibilityXml.Length - 1); using (XmlReader xmlReader = XmlReader.Create(new StringReader(sVisibilityXml))) { XmlSerializer serializer = new XmlSerializer(typeof(SENDOBJECT)); SENDOBJECT deserializedVisEntity = serializer.Deserialize(xmlReader) as SENDOBJECT; var sData = (from item in deserializedVisEntity.Items where item.GetType().ToString() == "Siav.APFlibrary.Model.SENDOBJECTSENDENTITIES" let cardsdoctypes = item as SENDOBJECTSENDENTITIES from docType in cardsdoctypes.SENDENTITY select docType).ToList(); return(sData); } }
public static List <SENDOBJECTSENDENTITIESSENDENTITY> getUsersInArchiveTypeDoc(string visibility, string LogId) { List <SENDOBJECTSENDENTITIESSENDENTITY> oUsersInArchiveTypeDoc; List <string> oUsers = new List <string>(); visibility = visibility.Substring(0, visibility.Length - 1); //List<SENDOBJECTSENDENTITIESSENDENTITY> oUsersInArchiveTypeDoc; using (XmlReader xmlReader = XmlReader.Create(new StringReader(visibility))) { XmlSerializer serializer = new XmlSerializer(typeof(SENDOBJECT)); SENDOBJECT deserializedVisEntity = serializer.Deserialize(xmlReader) as SENDOBJECT; oUsersInArchiveTypeDoc = (from item in deserializedVisEntity.Items where item.GetType().ToString() == "OCF_Ws.Model.SENDOBJECTSENDENTITIES" let cardsdoctypes = item as SENDOBJECTSENDENTITIES from docType in cardsdoctypes.SENDENTITY select docType).ToList(); //Logger.WriteOnLog(LogId, "oUsersInArchiveTypeDoc: " + Logger.ToJson(oUsersInArchiveTypeDoc), 3); //Logger.WriteOnLog(LogId, "deserializedVisEntity: " + LOLIB.SerializeToString((Object)deserializedVisEntity), 3); } return(oUsersInArchiveTypeDoc); }