Esempio n. 1
0
        /// <summary>
        /// 初始化功能组数据
        /// </summary>
        /// <param name="functionGroupList">所有的功能组列表,FunctionGroup数组</param>
        /// <param name="selectedList">已选择的功能组列表,RptViewReportSecurity数组</param>
        public void InitFunctionGroupData(object[] functionGroupList, object[] selectedList)
        {
            this.lstUnSelectedUserGroup.Items.Clear();
            this.lstSelectedUserGroup.Items.Clear();

            if (functionGroupList == null || functionGroupList.Length == 0)
                return;
            List<string> selectedFunctionGroup = new List<string>();
            if (selectedList != null && selectedList.Length > 0)
            {
                for (int i = 0; i < selectedList.Length; i++)
                {
                    RptViewReportSecurity rptSecurity = (RptViewReportSecurity)selectedList[i];
                    selectedFunctionGroup.Add(rptSecurity.FunctionGroupCode);
                }
            }

            for (int i = 0; i < functionGroupList.Length; i++)
            {
                FunctionGroup ugroup = (FunctionGroup)functionGroupList[i];
                if (selectedFunctionGroup.Contains(ugroup.FunctionGroupCode) == false)
                {
                    this.lstUnSelectedUserGroup.Items.Add(new ListItem(ugroup.FunctionGroupDescription, ugroup.FunctionGroupCode));
                }
                else
                {
                    this.lstSelectedUserGroup.Items.Add(new ListItem(ugroup.FunctionGroupDescription, ugroup.FunctionGroupCode));
                }
            }
            this.hidSelectedValue.Value = string.Join(";", selectedFunctionGroup.ToArray());
        }
Esempio n. 2
0
        protected override void UpdateReportDesignView()
        {
            string[] selectedUserGroup = this.rptSecuritySelect.SelectedUserGroup;
            if (selectedUserGroup.Length == 0)
            {
                ////Modified by allen on 20081104 for change security: functiongroup
                //throw new Exception("$ReportDesign_Select_UserGroup");
                throw new Exception("$ReportDesign_Select_FunctionGroup");
            }
            ////End Modified by allen on 20081104 for change security: functiongroup

            RptViewReportSecurity[] rptSecurity = new RptViewReportSecurity[selectedUserGroup.Length];
            for (int i = 0; i < selectedUserGroup.Length; i++)
            {
                RptViewReportSecurity security = new RptViewReportSecurity();
                ////Modified by allen on 20081104 for change security: functiongroup
                //security.UserGroupCode = selectedUserGroup[i];
                security.FunctionGroupCode = selectedUserGroup[i];
                ////End Modified by allen on 20081104 for change security: functiongroup
                rptSecurity[i] = security;
            }
            this.designView.ReportSecurity = rptSecurity;

            this.designView.DesignMain.ParentReportFolder = this.drpReportFolder.SelectedValue;
        }