Exemplo n.º 1
0
        //添加新行
        private void AddNewRow(StructRole role)
        {
            DataRow row = this.mainDataTable.NewRow();

            this.mainDataTable.Rows.Add(row);
            row[TitleList.Number.ToString()]      = this.mainDataTable.Rows.Count;
            row[TitleList.ManagerName.ToString()] = role.Name;
        }
Exemplo n.º 2
0
 public ManagerAddView(StructRole role)
 {
     InitializeComponent();
     if (role != null)
     {
         manager = role;
     }
     InitUI();
 }
Exemplo n.º 3
0
        //按钮列功能
        private void ButtonPressedEventClick(object sender, ButtonPressedEventArgs e)
        {
            int             row   = this.gridView1.FocusedRowHandle;
            StructRole      role  = this.managers[row];
            CloseFormHandle close = new CloseFormHandle(delegate {
                GetManagerList();
            });
            ManagerAddView view = new ManagerAddView(role);

            ToolsManage.ShowForm(view, false, close);
        }
Exemplo n.º 4
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));
            }
        }
Exemplo n.º 5
0
        //初始化UI
        private void InitUI()
        {
            this.managers = SysManage.Managers;
            for (int index = 0; index < this.managers.Count; index++)
            {
                StructRole role = this.managers[index];
                this.comboBoxEdit1.Properties.Items.Add(role.Name);
                if (this.staff != null && role.Roleid.Equals(staff.Roleid))
                {
                    this.comboBoxEdit1.SelectedIndex = index;
                }
            }

            if (this.staff != null)
            {
                this.nameTextBox.Text        = staff.Nickname;
                this.phoneTextBox.Text       = staff.Phone;
                this.userNameTextBox.Text    = staff.Username;
                this.pwTextBox.Text          = staff.Password;
                this.userNameTextBox.Enabled = false;
            }
        }