Ejemplo n.º 1
0
        private void GetMenuData()
        {
            //menuBar.Items.Clear();
            string permission = "";

            switch (UserInfo.RoleID)
            {
            case 1000: permission = "Z"; break;

            case 1001: permission = "A"; break;

            case 1002: permission = "B"; break;

            case 1003: permission = "C"; break;

            case 1004: permission = "D"; break;

            case 1005: permission = "E"; break;

            case 1006: permission = "F"; break;

            case 1007: permission = "G"; break;

            case 1008: permission = "H"; break;
            }
            DefultInfo baseClass = new DefultInfo();
            DataTable  table     = baseClass.ReturnUserMenu(permission, UserInfo.ID);

            DataView view = new DataView(table);

            view.RowFilter = "ParentID=0";
            view.Sort      = "Ordering ";
            strCreateMenu  = "";
            strCreateMenu  = string.Format(
                @"<div class=""navbar-inner-sm "">
                                <div class=""container-fluid fa"">
                                    <nav class=""collapse navbar-collapse"" role=""navigation"">
                                        <ul class=""nav navbar-nav"">");
            foreach (DataRowView row in view)
            {
                if (Convert.ToInt32(row["ChildCount"].ToString()) > 0)
                {
                    strCreateMenu += string.Format(@"
                        <li class=""dropdown"" style=""width:115px; text-align:center;"">
                            <a href=""#"" class=""dropdown-toggle"" data-toggle=""dropdown"" role=""button"" aria-haspopup=""true"" aria-expanded=""false""> {0} <b class=""caret""></b></a>
                                <ul class=""dropdown-menu"">", row["menuTitle"].ToString());
                    AddChildItems(table, row);
                }
                else
                {
                    strCreateMenu += string.Format(@"
                        <li style="" direction:rtl; text-align:center; width:110px;"">
                            <a  href=""" + AddressDefult + @"{0}"">{1}</a></li>", row["uID"].ToString(), row["menuTitle"].ToString());
                }
            }
            strCreateMenu += " </ul> </nav> </div> </div>";
            lblMenu.Text   = strCreateMenu;
        }
        private void GetMenuData()
        {
            string permission = "";

            switch (UserInfo.RoleID)
            {
            case 1000: permission = "Z"; break;

            case 1001: permission = "A"; break;

            case 1002: permission = "B"; break;

            case 1003: permission = "C"; break;

            case 1004: permission = "D"; break;

            case 1005: permission = "E"; break;

            case 1006: permission = "F"; break;

            case 1007: permission = "G"; break;

            case 1008: permission = "H"; break;
            }
            DefultInfo baseClass = new DefultInfo();
            DataTable  table     = baseClass.ReturnUserMenu(permission, UserInfo.ID);

            DataView view = new DataView(table);

            view.RowFilter = "ParentID=0";
            view.Sort      = "Ordering";
            strCreateMenu  = "";
            strCreateMenu  = string.Format(
                @"<div class=""panel-group"" id=""accordion fa"">
                        <div class=""panel panel-default "">");
            foreach (DataRowView row in view)
            {
                if (Convert.ToInt32(row["ChildCount"].ToString()) > 0)
                {
                    strCreateMenu += string.Format(@"
                        <div class=""panel-heading ""  style=""margin : 5px;"">
                            <a class=""accordion-toggle collapsed "" data-toggle=""collapse"" data-parent=""#accordion"" href=""#{0}""><h1 class=""panel-title "">{1} </h1></a>
                        </div>
                        <div id=""{0}"" class=""collapse panel-collapse fade"">
                            <div class=""panel-body"">
                                <table class=""table""> ", row["id"].ToString(), row["menuTitle"].ToString());
                    AddChildItems(table, row);
                    strCreateMenu += string.Format(@" </table> </div> </div>");
                }
                else
                {
                    strCreateMenu += string.Format(@"  
                            <div class=""panel-heading "" style=""margin : 5px;"">
                                <a href=""" + AddressDefult + @"{0}""><h1 class=""panel-title"">{1} </h1></a>
                            </div>", row["uID"].ToString(), row["menuTitle"].ToString());
                }
            }
            strCreateMenu += " </div> </div>";
            //    strCreateMenu += " </div> ";
            lblV_Menu.Text = strCreateMenu;
        }