Beispiel #1
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     soso.syntoolSoapClient bll = new soso.syntoolSoapClient();
     if (string.IsNullOrEmpty(textBoxX1.Text))
     {
         MessageBox.Show("请输入用户名!", "验证失败", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (string.IsNullOrEmpty(textBoxX2.Text))
     {
         MessageBox.Show("请输入登陆密码!", "验证失败", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     authKey = bll.Login(textBoxX1.Text, textBoxX2.Text);
     if (!string.IsNullOrEmpty(authKey))
     {
         userName = textBoxX1.Text;
         this.Hide();
         Main main = new Main();
         main.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("用户名或密码输入有误!", "验证失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
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;
            }
        }