Пример #1
0
        private void AddOperationGroup(object sender, EventArgs e)
        {
            AddOperationGroup AddOperationGroup = new AddOperationGroup();

            if (DialogResult.OK == AddOperationGroup.ShowDialog())
            {
                _GroupEntity = AddOperationGroup.operationGroupEntity;
                this.operationTree.Nodes.Add(_GroupEntity.GroupName);
                this.operationTree.Nodes[operationTree.Nodes.Count - 1].Tag = _GroupEntity.OperationGroupKey;
            }
        }
Пример #2
0
 private void DeleteOperationGroup(object sender, EventArgs e)
 {
     if (DialogResult.Yes == MessageBox.Show(this, StringParser.Parse("${res:FanHai.Hemera.Addins.Msg.DeleteRemind}"), StringParser.Parse("${res:Global.SystemInfo}"), MessageBoxButtons.YesNo, MessageBoxIcon.Question))
     {
         _GroupEntity = new RBACOperationGroup();
         _GroupEntity.OperationGroupKey = this.operationTree.SelectedNode.Tag.ToString();
         _GroupEntity.DeleteOperationGroup();
         if (_GroupEntity.ErrorMsg == "")
         {
             this.operationTree.Nodes.Remove(operationTree.SelectedNode);
         }
         else
         {
             MessageService.ShowError("${res:FanHai.Hemera.Addins.RBAC.OperationCtrl.Msg.DeleteMenuItem}");
         }
     }
 }
Пример #3
0
        /// <summary>
        /// bind operations to lookUpEdit
        /// 下拉列表数据的绑定
        /// </summary>
        private void BindLookUpEdit()
        {
            DataSet            groupData      = new DataSet();
            RBACOperationGroup operationGroup = new RBACOperationGroup();

            groupData = operationGroup.GetOperationGroup();
            if (operationGroup.ErrorMsg == "")
            {
                if (groupData != null)
                {
                    lueOperationGroup.Properties.DataSource    = groupData.Tables[0];
                    lueOperationGroup.Properties.DisplayMember = RBAC_OPERATION_GROUP_FIELDS.FIELD_GROUP_NAME;
                    lueOperationGroup.Properties.ValueMember   = RBAC_OPERATION_GROUP_FIELDS.FIELD_OPERATION_GROUP_KEY;
                    lueOperationGroup.ItemIndex = 0;
                }
            }
            else
            {
                MessageService.ShowError("${res:FanHai.Hemera.Addins.RBAC.OperationCtrl.Msg.GetOperationError}");
            }
        }
Пример #4
0
        private void BindTreeView()
        {
            DataSet            dataSet        = new DataSet();
            RBACOperationGroup operationGroup = new RBACOperationGroup();

            dataSet = operationGroup.GetOperationGroup();
            if (operationGroup.ErrorMsg == "")
            {
                if (dataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
                    {
                        operationTree.Nodes.Add(dataSet.Tables[0].Rows[i][RBAC_OPERATION_GROUP_FIELDS.FIELD_GROUP_NAME].ToString());
                        operationTree.Nodes[i].ImageIndex         = 0;
                        operationTree.Nodes[i].SelectedImageIndex = 1;
                        operationTree.Nodes[i].Tag = dataSet.Tables[0].Rows[i][RBAC_OPERATION_GROUP_FIELDS.FIELD_OPERATION_GROUP_KEY].ToString();
                    }
                }
            }
            else
            {
                MessageService.ShowError("${res:FanHai.Hemera.Addins.RBAC.OperationCtrl.Msg.GetOperationError}");
            }
        }