コード例 #1
0
        private void Updateanager()
        {
            string name = this.textEdit1.Text;

            if (!name.Equals("") && !name.Equals(this.manager.Name))
            {
                ManagerNetOperation.UpdateManagerName(UpdateManagerNameResult, int.Parse(this.manager.Roleid), name);
            }

            List <int> rights = new List <int>();

            foreach (TreeNode node in this.treeView1.Nodes)
            {
                //System.Console.WriteLine("node:" + node.Checked);
                if (node.Checked)
                {
                    int nodeId = (int)node.Tag;
                    rights.Add(nodeId);
                }
                foreach (TreeNode child in node.Nodes)
                {
                    if (child.Checked)
                    {
                        int nodeId = (int)child.Tag;
                        rights.Add(nodeId);
                    }
                }
            }

            BigInteger.BigIntegerTools big = new BigInteger.BigIntegerTools(rights);
            ManagerNetOperation.UpdateManagerRights(UpdateManagerRightsResult, int.Parse(this.manager.Roleid), 1, big.ToString());
        }
コード例 #2
0
        private void AddManager()
        {
            string name = this.textEdit1.Text;

            if (name.Equals(""))
            {
                return;
            }
            ManagerNetOperation.AddManager(AddManagerResult, name);
        }
コード例 #3
0
        //删除
        private void deleteManagerButton_Click(object sender, EventArgs e)
        {
            List <int> ids = new List <int>();

            for (int i = 0; i < this.mainDataTable.Rows.Count; i++)
            {
                DataRow row = this.mainDataTable.Rows[i];
                if (row[TitleList.Check.ToString()].ToString().Equals("True"))
                {
                    ids.Add(i);
                }
            }
            this.delNum = ids.Count;
            foreach (int row in ids)
            {
                StructRole manager = this.managers[row];
                ManagerNetOperation.DeleteManager(DeleteManagerResult, int.Parse(manager.Roleid));
            }
        }
コード例 #4
0
        //进行登录
        private void LoginButtonClick(object sender, EventArgs e)
        {
            //TODO:测试打开
            //LoginMainView();
            //return;

            string userName = this.comboBoxEdit1.Text;
            string ps       = this.textEdit2.Text;

            if (userName.Equals("") || ps.Equals(""))
            {
                MessageBox.Show("请输入用户名或密码");
                return;
            }

            if (this.comboBoxEdit1.SelectedIndex >= 0)
            {
                ManagerManage.Manage().AccountId = this.staffs[this.comboBoxEdit1.SelectedIndex].Guid;
            }
            ManagerNetOperation.ManagerLogin(ManagerLoginBlock, userName, ps);
        }
コード例 #5
0
 //获取管理员列表
 private void GetManagerList()
 {
     ManagerNetOperation.GetManagerList(GetManagerListResult);
 }
コード例 #6
0
 // 连接服务器的回调
 public void ConnectServerResult()
 {
     NetMessageManage.RemoveConnetServer(ConnectServerResult);
     //进行客户端认证
     ManagerNetOperation.ClientAuthen(ClientAuthenBlock);
 }
コード例 #7
0
 /// <summary>
 /// 获取账户信息
 /// </summary>
 public void GetAccountInfo(DataResultBlock result)
 {
     this.DataResultEvent += result;
     //获取账户信息
     ManagerNetOperation.AccountInfo(AccountInfoBlock, this.aid);
 }