示例#1
0
        public Main()
        {
            InitializeComponent();
            ribbonTabItem1.Visible = false;
            Maptool.soso.syntoolSoapClient bll = new Maptool.soso.syntoolSoapClient();
            Menu = bll.GetMenu(Login.authKey);
            if (Menu.Count() > 0)
            {
                iden        = Menu[Menu.Count() - 1].id;
                idenName    = Menu[Menu.Count() - 1].name.Replace("数据映射", "");
                curIdenName = idenName;
            }
            foreach (var item in Menu)
            {
                DevComponents.DotNetBar.RibbonTabItem bit = new DevComponents.DotNetBar.RibbonTabItem();
                bit.Click  += new EventHandler(bit_Click);
                bit.Text    = item.name;
                bit.Tooltip = item.id.ToString();
                ribbonControl1.Items.Add(bit, 0);
                bit.Select();
            }
            ribbonPanel1.Show();
            this.WindowState = FormWindowState.Maximized;
            this.FormClosed += new FormClosedEventHandler(Main_FormClosed);
            this.Shown      += new EventHandler(Main_AutoSizeChanged);

            string powor = new Maptool.soso.syntoolSoapClient().GetPower(Login.authKey);

            Maptool.soso.syntoolSoapClient soso = new soso.syntoolSoapClient();

            if (powor == "limit")
            {
                //ribbonBar2.Visible = false;
                //ribbonBar3.Visible = false;
                //ribbonTabItem3.Visible = false;
            }
            else if (powor != "all")
            {
                if (!soso.GetUserPower("12020006", Login.authKey))
                {
                    ribbonBar1.Visible = false;
                }
                if (!soso.GetUserPower("12020007", Login.authKey))
                {
                    ribbonBar2.Visible = false;
                }
                if (!soso.GetUserPower("12020005", Login.authKey))
                {
                    ribbonBar3.Visible = false;
                }
                if (!soso.GetUserPower("12020008", Login.authKey))
                {
                    ribbonBar5.Visible = false;
                }
                if (!soso.GetUserPower("12020009", Login.authKey))
                {
                    ribbonBar6.Visible = false;
                }
                if (!soso.GetUserPower("12020010", Login.authKey))
                {
                    ribbonBar7.Visible = false;
                }
                ribbonTabItem3.Visible = false;
                //ribbonBar4.Visible = false;
                //ribbonBar1.Visible = false;
                //ribbonBar5.Visible = false;
            }
        }