Esempio n. 1
0
        /// <summary>
        /// 初始化功能权限控制面板
        /// </summary>
        private void InitActionPanel(string sfunid)
        {
            int ROW     = 11;
            int rowTop  = 3;
            int colLeft = 2;
            int count   = 0;


            string filter = string.Format(tb_sys_Fun_MenuBar.FFunctionID + "={0}", sfunid);

            DataRow[] rs = _BLL.AuthorityItem.Select(filter);
            foreach (DataRow actionRow in rs)
            {
                int value = ConvertEx.ToInt(actionRow[tb_sys_Fun_MenuBar.FAuthority]);
                if (value == 0)
                {
                    continue;
                }

                ucCheckEdit checkEdit = new ucCheckEdit();
                checkEdit.Name        = "ucCheckEdit_" + value.ToString();
                checkEdit.IsChecked   = false;
                checkEdit.Location    = new System.Drawing.Point(colLeft, rowTop);
                checkEdit.MaximumSize = new System.Drawing.Size(2333, 21);
                checkEdit.MinimumSize = new System.Drawing.Size(29, 21);
                checkEdit.Size        = new System.Drawing.Size(88, 21);
                checkEdit.TabIndex    = 0;
                checkEdit.CheckText   = ConvertEx.ToString(actionRow[tb_sys_Fun_MenuBar.FName]); //显示预设的名称
                checkEdit.Tag         = actionRow;                                               //标记
                pcActions.Controls.Add(checkEdit);

                rowTop += 21 + 2;
                count++;
                if (count > ROW)
                {
                    colLeft += checkEdit.Width - 8;
                    rowTop   = 3;
                    count    = 0;
                }
            }
            pcActions.EndInit();
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化功能权限控制面板
        /// </summary>
        private void InitActionPanel()
        {
            int ROW     = 11;
            int rowTop  = 3;
            int colLeft = 2;
            int count   = 0;

            pcActions.BeginInit();
            foreach (DataRow actionRow in _BLL.AuthorityItem.Rows)
            {
                int value = ConvertEx.ToInt(actionRow["AuthorityValue"]);
                if (value == 0)
                {
                    continue;
                }

                ucCheckEdit checkEdit = new ucCheckEdit();
                checkEdit.Name        = "ucCheckEdit_" + value.ToString();
                checkEdit.IsChecked   = false;
                checkEdit.Location    = new System.Drawing.Point(colLeft, rowTop);
                checkEdit.MaximumSize = new System.Drawing.Size(2333, 21);
                checkEdit.MinimumSize = new System.Drawing.Size(29, 21);
                checkEdit.Size        = new System.Drawing.Size(88, 21);
                checkEdit.TabIndex    = 0;
                checkEdit.CheckText   = ConvertEx.ToString(actionRow["AuthorityName"]); //显示预设的名称
                checkEdit.Tag         = actionRow;                                      //标记
                pcActions.Controls.Add(checkEdit);

                rowTop += 21 + 2;
                count++;
                if (count > ROW)
                {
                    colLeft += checkEdit.Width - 8;
                    rowTop   = 3;
                    count    = 0;
                }
            }
            pcActions.EndInit();
        }