Inheritance: System.Windows.Forms.Form
コード例 #1
0
        /// <summary>
        ///     选择角色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPickRole_Click(object sender, EventArgs e)
        {
            var mUserRole = new FrmUserRole(_roleList, _isAdmin);

            mUserRole.ShowDialog();
            _roleList = mUserRole.PickedRoles;
            RefreshRoles();
        }
コード例 #2
0
ファイル: frmAddRole.cs プロジェクト: zhangvv/MongoCola
        /// <summary>
        ///     选择角色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPickRole_Click(object sender, EventArgs e)
        {
            var mUserRole = new FrmUserRole(_roleList, true);

            mUserRole.ShowDialog();
            _roleList = mUserRole.PickedRoles;
            lstRoles.Items.Clear();
            foreach (var role in _roleList)
            {
                var lst = new ListViewItem(role.Role);
                lst.SubItems.Add(role.Db);
                lstRoles.Items.Add(lst);
            }
        }
コード例 #3
0
 /// <summary>
 ///     修改角色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmdModifyRole_Click(object sender, EventArgs e)
 {
     if (lstOtherRoles.SelectedItems.Count == 0)
     {
         MyMessageBox.ShowMessage("Error", "Please Select A Database");
     }
     else
     {
         var dbName    = lstOtherRoles.SelectedItems[0].Text;
         var mUserRole = new FrmUserRole(_otherDbRolesDict[dbName].Value.AsBsonArray);
         mUserRole.ShowDialog();
         var otherRole = new BsonElement(cmbDB.Text, mUserRole.Result);
         _otherDbRolesDict[dbName] = otherRole;
         RefreshOtherDbRoles();
     }
 }
コード例 #4
0
        /// <summary>
        ///     增加角色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdAddRole_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cmbDB.Text))
            {
                MyMessageBox.ShowMessage("Error", "Please Select A Database");
                return;
            }
            var mUserRole = new FrmUserRole(new BsonArray());

            mUserRole.ShowDialog();
            var otherRole = new BsonElement(cmbDB.Text, mUserRole.Result);

            if (_otherDbRolesDict.ContainsKey(cmbDB.Text))
            {
                _otherDbRolesDict[cmbDB.Text] = otherRole;
            }
            else
            {
                _otherDbRolesDict.Add(cmbDB.Text, otherRole);
            }
            RefreshOtherDbRoles();
        }
コード例 #5
0
ファイル: frmAddRole.cs プロジェクト: magicdict/MongoCola
 /// <summary>
 ///     选择角色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPickRole_Click(object sender, EventArgs e)
 {
     var mUserRole = new FrmUserRole(_roleList, true);
     mUserRole.ShowDialog();
     _roleList = mUserRole.PickedRoles;
     lstRoles.Items.Clear();
     foreach (var role in _roleList)
     {
         var lst = new ListViewItem(role.Role);
         lst.SubItems.Add(role.Db);
         lstRoles.Items.Add(lst);
     }
 }
コード例 #6
0
ファイル: frmUser.cs プロジェクト: universsky/MongoCola
 /// <summary>
 ///     增加角色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmdAddRole_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(cmbDB.Text))
     {
         MyMessageBox.ShowMessage("Error", "Please Select A Database");
         return;
     }
     var mUserRole = new FrmUserRole(new BsonArray());
     mUserRole.ShowDialog();
     var otherRole = new BsonElement(cmbDB.Text, mUserRole.Result);
     if (_otherDbRolesDict.ContainsKey(cmbDB.Text))
     {
         _otherDbRolesDict[cmbDB.Text] = otherRole;
     }
     else
     {
         _otherDbRolesDict.Add(cmbDB.Text, otherRole);
     }
     RefreshOtherDbRoles();
 }
コード例 #7
0
ファイル: frmUser.cs プロジェクト: universsky/MongoCola
 /// <summary>
 ///     修改角色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmdModifyRole_Click(object sender, EventArgs e)
 {
     if (lstOtherRoles.SelectedItems.Count == 0)
     {
         MyMessageBox.ShowMessage("Error", "Please Select A Database");
     }
     else
     {
         var dbName = lstOtherRoles.SelectedItems[0].Text;
         var mUserRole = new FrmUserRole(_otherDbRolesDict[dbName].Value.AsBsonArray);
         mUserRole.ShowDialog();
         var otherRole = new BsonElement(cmbDB.Text, mUserRole.Result);
         _otherDbRolesDict[dbName] = otherRole;
         RefreshOtherDbRoles();
     }
 }
コード例 #8
0
ファイル: frmUser.cs プロジェクト: magicdict/MongoCola
 /// <summary>
 ///     选择角色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPickRole_Click(object sender, EventArgs e)
 {
     var mUserRole = new FrmUserRole(_roleList, _isAdmin);
     mUserRole.ShowDialog();
     _roleList = mUserRole.PickedRoles;
     RefreshRoles();
 }