Exemple #1
0
        /// <summary>
        /// 关键要处理一些特殊字符的不同状态,如“(”,
        /// 相关报表为“货龄分析(按发票)”
        /// </summary>
        private bool ContainsKey(
            Hashtable u861FormatRelated,
            DynamicReport dr,
            ref object val)
        {
            string id          = dr.ID;
            bool   isContained = u861FormatRelated.ContainsKey(id);

            val = u861FormatRelated[id];
            if (!isContained &&
                (id.IndexOf('(') != -1 ||
                 id.IndexOf(')') != -1 ||
                 id.IndexOf('(') != -1 ||
                 id.IndexOf(')') != -1))
            {
                string tp = string.Empty;
                tp          = id.Replace('(', '(');
                tp          = tp.Replace(')', ')');
                isContained = u861FormatRelated.ContainsKey(tp);
                val         = u861FormatRelated[tp];
                if (!isContained)
                {
                    tp          = id.Replace('(', '(');
                    tp          = tp.Replace(')', ')');
                    isContained = u861FormatRelated.ContainsKey(tp);
                    val         = u861FormatRelated[tp];
                }
            }
            return(isContained);
        }
Exemple #2
0
        private bool CheckAuth4DynamicReport(DynamicReport dr)
        {
            //特殊控制以下几张报表的显示情况:
            //帐套主管不能在报表中心看到
            //AS[__]7e3531d6-cfd7-4f64-9f39-24061e80e88b		用户账号使用审计查询
            //AU[__]c08fe2c2-86c7-4d6a-9884-2e6351bb8af0		清退站点日志查询
            //AU[__]b2424754-4128-4c61-9a85-2249c8f03a8f		安全策略变更审计查询
            //if (this._login.U8LoginClass.IsAdmin)
            //{
            //    if(dr.ID.ToUpper() == "AS[__]7E3531D6-CFD7-4F64-9F39-24061E80E88B"
            //        || dr.ID.ToUpper() == "AU[__]C08FE2C2-86C7-4D6A-9884-2E6351BB8AF0"
            //        || dr.ID.ToUpper() == "AU[__]B2424754-4128-4C61-9A85-2249C8F03A8F")
            //        return false;
            //}

            Hashtable reportsWithAuth = this._hashData[ReportCenterDataService.KEY_ReportAuth];

            return(reportsWithAuth.ContainsKey(dr.ID));
        }
Exemple #3
0
        /// <summary>
        /// 报表是否可见
        /// </summary>
        private bool IsAllOk(IReportNode rn, Hashtable sysInfos)
        {
            // 系统不启用不显示报表
            if (!sysInfos.ContainsKey(rn.SubID))
            {
                return(false);
            }

            // 非静态报表
            Hashtable     reportsWithAuth = this._hashData[ReportCenterDataService.KEY_ReportAuth];
            DynamicReport dr = rn as DynamicReport;

            if (dr != null && this.CheckAuth4DynamicReport(dr))
            {
                //有些系统报表必须在相关业务规则启用时才可见
                if (dr.bSystem &&
                    !string.IsNullOrEmpty(dr.cMenuId) &&
                    !this._standardReportMenuRuleHandler.IsReportVisible(dr.cMenuId))
                {
                    return(false);
                }
                return(true);
            }

            // 静态报表,可能还不存在xml,因此字典不包含此关键字的哈希表
            if (rn is StaticReport)
            {
                if (this._hashData.ContainsKey(ReportCenterDataService.KeyDeletedStaticReports))
                {
                    Hashtable deletedStaticReports = this._hashData[ReportCenterDataService.KeyDeletedStaticReports];
                    if (deletedStaticReports.ContainsKey(rn.ID))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            return(false);
        }
Exemple #4
0
        private IReportNode GetMyReportTreeNode(
            DataRow dr,
            Hashtable u861FormatRelated,
            Hashtable isUsingU861Format,
            ref string key)
        {
            IReportNode im = null;

            if (key == ReportCenterDataService.KEY_StaticReport)
            {
                im = new StaticReport(this._iOpenReportCenterNode);
            }
            else
            {
                im = new DynamicReport(this._iOpenReportCenterNode);
            }
            (im as IFillData).FillData(dr);

            DynamicReport rep = im as DynamicReport;

            if (rep != null)
            {
                object val = null;

                //关于新老报表存在如下情形:(自定义报表都不能切换)
                //1.只存在老报表数据:
                //	-a. bNewRpt=NULL则不允许切换,不允许发布,使用老报表打开
                //	-b. bNewRpt<>NULL则允许切换
                //		-b.1 bNewRpt=1 ->不允许发布,使用新报表打开
                //		-b.2 bNewRpt=0 ->不允许发布,使用老报表打开
                //2.只存在新报表数据:不允许切换,允许发布,使用新报表打开
                //3.新老报表数据同时存在:
                //  -a. bNewRpt=NULL则按照1-a情形
                //  -b. bNewRpt<>NULL且bHadUpgradedFrom861=NULL ->不允许切换
                //		 -a.1 bNewRpt=0 ->不允许发布,使用老报表打开
                //		 -a.2 bNewRpt=1 ->允许发布,使用新报表打开
                //  -c. bNewRpt<>NULL且bHadUpgradedFrom861<>NULL
                //		 -a.1 bNewRpt=0 ->允许切换,不允许发布,使用老报表打开
                //		 -a.2 bNewRpt=1 ->允许切换,使用新报表打开
                //				-a.1 bHadUpgradedFrom861=1则允许发布
                //				-a.1 bHadUpgradedFrom861=0则不允许发布

                //CanUseAs861Report表示此报表能够进行切换
                rep.CanUseAs861Report = false;
                if (this.ContainsKey(u861FormatRelated, rep, ref val))
                {
                    rep.CanUseAs861Report = true;
                }

                //IsUsing861Report表示当前报表使用老报表方式查询
                //对应bNewRpt的值:
                //bNewRpt=0或null -> IsUsing861Report=true
                //bNewRpt=1 -> IsUsing861Report=false
                val = null;
                rep.IsUsing861Report = false;
                if (this.ContainsKey(isUsingU861Format, rep, ref val))
                {
                    rep.IsUsing861Report = !SqlHelper.GetBooleanFrom(val, false);
                }

                if (rep.bSystem)
                {
                    key = ReportCenterDataService.KeySystem;
                }
                else
                {
                    key = ReportCenterDataService.KeyCustom;
                }
            }

            return(im);
        }