public static List <Df_Model> GetMFs(XmlNodeList StartNode) { List <Df_Model> superDFs = new List <Df_Model>(); foreach (XmlNode item in StartNode) { Df_Model MF = new Df_Model(); MF.EFs = GetEFs(item); MF.DFs = GetDFs(item); superDFs.Add(MF); } return(superDFs); }
public static string MontarDF(Df_Model DF) { String xml = ""; if (DF.FileID != "" && DF.FileID != "null" && DF.FileID != null) { //AID = "A0000000871002FF54F00189000001FF"; if (DF.AID != null && DF.AID != "") { xml = "\n<MF_DF FileName=\"" + DF.FileName + "\" FileID=\"" + DF.FileID + "\" FileType=\"" + DF.FileType + "\" FilePath=\"" + DF.FilePath + "\" LCSI =\"" + DF.LCSI + "\" AID=" + DF.AID + "\">"; } else { xml = "\n<MF_DF FileName=\"" + DF.FileName + "\" FileID=\"" + DF.FileID + "\" FileType=\"" + DF.FileType + "\" FilePath=\"" + DF.FilePath + "\" LCSI =\"" + DF.LCSI + "\">"; } xml += "\n\t <AccessConditions3G>"; xml += "\n\t\t <DFAccessConditions3GType>"; xml += "\n\t\t\t<DeleteSelf>" + DF.DeleteSelf + "</DeleteSelf>"; xml += "\n\t\t\t<TerminateDF>" + DF.TerminateDF + "</TerminateDF>"; xml += "\n\t\t\t<Activate>" + DF.Activate + "</Activate>"; xml += "\n\t\t\t<Deactivate>" + DF.Deactivate + "</Deactivate>"; xml += "\n\t\t\t<CreateChildDF>" + DF.CreateChildDF + "</CreateChildDF>"; xml += "\n\t\t\t<CreateChildEF>" + DF.CreateChildEF + "</CreateChildEF>"; xml += "\n\t\t\t<DeleteChild>" + DF.DeleteChild + "</DeleteChild>"; xml += "\n\t\t\t<EFArrID>" + DF.EFArrID + "</EFArrID>"; xml += "\n\t\t\t<EFArrRecordNb>" + DF.EFArrRecordNb + "</EFArrRecordNb>"; xml += "\n\t\t\t<Shareable>" + DF.Shareable + "</Shareable>"; xml += "\n\t\t</DFAccessConditions3GType>"; xml += "\n\t</AccessConditions3G>"; xml += "\n </MF_DF>"; } else { } return(xml); }
public static List <Df_Model> GetDFs(XmlNode StartNode) { var DFs = new List <Df_Model>(); foreach (XmlNode item in StartNode.ChildNodes) { XmlNodeList itens = item.ChildNodes; foreach (XmlNode item1 in itens) { if (item1.Name == "FileHeader") { Df_Model DF = new Df_Model(); DF.FileID = item1.Attributes["ID"].InnerText; DF.FileName = item1.Attributes["AliasName"].InnerText; DF.FilePath = item1.Attributes["ID"].InnerText; //DF.FilePath = DF_File_Path+DF.FileID; //DF_File_Path = DF.FilePath; DF.LCSI = "Operational"; DF.FileType = DF.FileID == "3F00" ? "MF" : "DF"; DF.Shareable = "true"; DF.TerminateDF = "NEV"; XmlNodeList itens1 = item1.ChildNodes; foreach (XmlNode item2 in itens1) { if (item2.Name == "usim:AID") { DF.AID = item2.InnerText; } if (item2.Name == "usim:HeaderExt") { if (item2.Attributes["FileType"].Value == "DF") { DF.EFs = GetEFs(item); DF.DFs = GetDFs(item); DFs.Add(DF); } } if (item2.Name == "usim:AttributeLists") { XmlNodeList atributes = item2.FirstChild.ChildNodes; foreach (XmlNode atribute in atributes) { XmlNodeList at = atribute.ChildNodes; XmlNodeList a = at[0].ChildNodes; switch (a[1].InnerText) { case "AC_Create": DF.CreateChildEF = a[0].InnerText; break; case "AC_Create_DF": DF.CreateChildDF = a[0].InnerText; break; case "AC_Delete": DF.DeleteSelf = a[0].InnerText; break; case "AC_Delete_Child": DF.DeleteChild = a[0].InnerText; break; case "AC_Activate": DF.Activate = a[0].InnerText; break; case "AC_Deactivate": DF.Deactivate = a[0].InnerText; break; } } } if (item2.Name == "AccessCondition") { XmlNodeList list = item2.ChildNodes; foreach (XmlNode item3 in list) { if (item3.Name == "usim:AccessConditionReference") { XmlNodeList list2 = item3.ChildNodes; foreach (XmlNode lastItem in list2) { if (lastItem.Name == "FileID") { DF.EFArrID = lastItem.InnerText; } if (lastItem.Name == "RecNo") { DF.EFArrRecordNb = lastItem.InnerText; } } } } } } } } } return(DFs); }