protected override NosSiteMapDataSet ConstruirSiteNodes()
        {
            //byte plt_Planta = AuthenticationTicket.Atual.Plt_Planta;
            string sis_CodSis = AuthenticationTicket.Atual.CodigoSistema;
            int usu_Id = AuthenticationTicket.Atual.IDUsuario;

            NosSiteMapDataSet nosSiteMapDataSet = new NosSiteMapDataSet();

            DataTable moduloTable;
            DataTable funcaoTable;

            SiteMapAcessoDados siteMapAD = new SiteMapAcessoDados();

            moduloTable = siteMapAD.ObterRaizModuloFuncaoParaMenu(sis_CodSis, usu_Id);
            funcaoTable = siteMapAD.ObterFolhaModuloFuncaoParaMenu(sis_CodSis, usu_Id);
            nosSiteMapDataSet.Raiz.Merge(moduloTable);
            nosSiteMapDataSet.No.Merge(funcaoTable);

            return nosSiteMapDataSet;
        }
 public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     NosSiteMapDataSet ds = new NosSiteMapDataSet();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "NoDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     return type;
 }
 public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
     NosSiteMapDataSet ds = new NosSiteMapDataSet();
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     return type;
 }
        private void MapearNosSiteMapDataSetParaSiteMapNode(NosSiteMapDataSet nosSiteMapDataSet, bool acessoViaInternet)
        {
            foreach (NosSiteMapDataSet.RaizRow raizRow in nosSiteMapDataSet.Raiz)
            {
                if (acessoViaInternet && !raizRow.PermiteAcessoInternet)
                    continue;
                raizRow.Nome = raizRow.Nome.Trim();
                SiteMapNode raizMapNode = CriarRaizSiteMapNode(raizRow);
                foreach (NosSiteMapDataSet.NoRow noRow in raizRow.GetChildRows("Raiz_No"))
                {
                    if (acessoViaInternet && !noRow.PermiteAcessoInternet)
                        continue;

                    SiteMapNode noMapNode = CriarNoSiteMapNode(noRow);
                    AddNode(noMapNode, raizMapNode);
                }
                AddNode(raizMapNode, _NoRaiz);
            }
        }
 /// <summary>
 /// Cria os nós do que correspondem ao Sistema/Módulo
 /// </summary>
 /// <param name="raizRow">Raiz</param>
 /// <returns></returns>
 private SiteMapNode CriarRaizSiteMapNode(NosSiteMapDataSet.RaizRow raizRow)
 {
     SiteMapNode node = new SiteMapNode(
         this,
         raizRow.Codigo,
         raizRow.IsUrlNull() ? String.Empty : raizRow.Url,
         raizRow.Nome,
         raizRow.IsDescricaoNull() ? String.Empty : raizRow.Descricao
     );
     node.Roles = new string[] { "*" };
     return node;
 }
 /// <summary>
 /// Cria os nós que representam as Planta/Função
 /// </summary>
 /// <param name="noRow">Nó do raiz</param>
 /// <returns></returns>
 private SiteMapNode CriarNoSiteMapNode(NosSiteMapDataSet.NoRow noRow)
 {
     SiteMapNode node = new SiteMapNode(
                     this,
                     noRow.Codigo,
                     //Real
                     noRow.IsUrlNull() ? String.Empty : noRow.Url,
                     //noRow.IsUrlNull() ? String.Empty : noRow.Url + "?sis=" + noRow.CodigoRaiz.ToString() + "&plt=" + noRow.Codigo.Split('|')[1],
                     noRow.Nome,
                     noRow.IsDescricaoNull() ? String.Empty : noRow.Descricao
                     );
     node.Roles = new string[] { "*" };
     return node;
 }