Exemplo n.º 1
0
 /// <summary>
 /// 数据转移到临时表的基础服务类构造函数
 /// </summary>
 /// <param name="rdf">UFIDA.U8.UAP.Services.ReportData.ReportDataFacade类型,主要是使用其提供的UFDataCnnString</param>
 /// <param name="customDataSource">通过此参数将临时表名称返回调用者</param>
 public Base2TempTable(
     ReportDataFacade rdf,
     CustomDataSource customDataSource)
 {
     this._loginInfor       = rdf._U8LoginInfor;
     this._customDataSource = customDataSource;
 }
Exemplo n.º 2
0
        public ReportCenterObjAssembler(IOpenReportCenterNode iors, U8LoginInfor login)
        {
            this._iOpenReportCenterNode = iors;
            string[] rpKeys = new string[] {
                ReportCenterDataService.KeyAll,
                ReportCenterDataService.KeySystem,
                ReportCenterDataService.KeyCustom,
                ReportCenterDataService.KEY_StaticReport,
            };
            foreach (string k in rpKeys)
            {
                this._reportInfo[k] = new Reports();
            }

            string[] htKeys = new string[] {
                ReportCenterDataService.KeySystem,
                ReportCenterDataService.KeyCustom,
                ReportCenterDataService.KEY_StaticReport,
            };
            foreach (string k in htKeys)
            {
                this._hashData[k] = new Hashtable();
            }

            this._rawMeta = new Dictionary <string, DataTable>();
            this._login   = login;
        }
Exemplo n.º 3
0
        private void GetDbSubIdWithStaticId(string staticid, U8LoginInfor login, out string subid, out string csubid)
        {
            //string strSQL = string.Format("select subId from uap_reportstaticrpt where id='{0}'", staticid);
            string     strSQL = string.Format(@"select a.ReportViewID,b.ID,c.Subid,c.CSubID 
                                            from uap_reportstaticrpt a 
                                            left join UAP_ReportView  b on a.ReportViewID=b.ID
                                            left join UAP_Report c on b.ReportID=c.ID
                                            where a.ID='{0}'", staticid);
            SqlCommand cmd    = new SqlCommand(strSQL);

            cmd.CommandType = CommandType.Text;
            subid           = ""; csubid = "";
            DataSet ds = SqlHelper.ExecuteDataSet(login.UfMetaCnnString, cmd);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["subId"] != null)
                {
                    subid = ds.Tables[0].Rows[0]["subId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["csubId"] != null)
                {
                    csubid = ds.Tables[0].Rows[0]["csubId"].ToString();
                }
            }
        }
Exemplo n.º 4
0
        public string GetRowAuthFromAllColumns(string viewid, string allcolumns, U8LoginInfor login, bool bweb)
        {
            string subId  = "";
            string csubId = "";

            GetDbSubIdwithViewId(viewid, login, out subId, out csubId);
            string columns = System.Text.RegularExpressions.Regex.Split(allcolumns, "@;@")[0].Replace("[", "").Replace("]", "");

            return(GetRowAuth(subId, csubId, columns, login, bweb));
        }
Exemplo n.º 5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="loginInfor">登录信息,主要为获取连接串</param>
 public Upgrade872ControllerOutU8(U8LoginInfor loginInfor)
 {
     if (loginInfor == null ||
         string.IsNullOrEmpty(loginInfor.UfDataCnnString) ||
         string.IsNullOrEmpty(loginInfor.UfMetaCnnString))
     {
         throw new Exception("loginInfor或其中的连接串为空,不能进行升级");
     }
     this._loginInfor = loginInfor;
 }
        public Dictionary <string, Reports> GetData4ReportDataForVB6(object vbLogin)
        {
            this._loginInfo = new U8LoginInfor(vbLogin);
            ReportCenterUiStateHandler uihandler = new ReportCenterUiStateHandler();
            ReportCenterObjAssembler   assembler = new ReportCenterObjAssembler(null, this._loginInfo);
            Hashtable meta = this.GetData(true, false);

            assembler.Assemble(meta, uihandler, true);
            return(assembler.ReportInfo);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dataSourceId">数据源id</param>
 /// <param name="functionName">数据引擎查询数据源的查询函数名称</param>
 /// <param name="filterString">过滤串</param>
 /// <param name="loginInfor">u8登录信息</param>
 public U8DataEngineHelper(
     string dataSourceId,
     string functionName,
     string filterString,
     U8LoginInfor loginInfor,
     string extendingDataSourceTempDBName)
 {
     this._dataSourceId             = dataSourceId;
     this._u8DataEnginefunctionName = functionName;
     this._filterString             = filterString;
     this._loginInfor = loginInfor;
     this._extendingDataSourceTempDBName = extendingDataSourceTempDBName;
 }
Exemplo n.º 8
0
        private void init(U8LoginInfor u8info)
        {
            if (_ufDataConnString == string.Empty)
            {
                _ufDataConnString = u8info.UfDataCnnString;
                _ufMetaConnString = u8info.UfMetaCnnString;
                _ufSystConnString = u8info.UfSystCnnString;
                datadb            = u8info.AccDbName;
                metadatadb        = "UFMeta_" + u8info.cAccId;

                _cnn = new SqlConnection(_ufMetaConnString);
                _cnn.Open();
                _tran = _cnn.BeginTransaction();
            }
        }
        /// <summary>
        /// 运行时生成的权限号要添加到登录信息的缓存中,
        /// 否则查询新另存的报表时会出现没有权限的错误
        /// </summary>
        private void AddAuth2Cache(SqlCommand cmd, U8LoginInfor login)
        {
            string authIds = cmd.Parameters["@NewAuthIds"].Value.ToString();

            if (!string.IsNullOrEmpty(authIds))
            {
                string[] ids = authIds.Split(';');
                foreach (string id in ids)
                {
                    if (!string.IsNullOrEmpty(id))
                    {
                        login.AddAuth2Cache(id);
                    }
                }
            }
        }
Exemplo n.º 10
0
        public string GetRowAuth(string subId, string csubId, string fieldString, U8LoginInfor login, bool bWeb)
        {
            if (string.IsNullOrEmpty(fieldString))
            {
                return(string.Empty);
            }
            if (login == null)
            {
                throw new Exception("登录对象U8LoginInfor为空");
            }

            this.InitContext(subId, csubId, login, bWeb);

            //管理员不控制权限
            if (this._context.U8LoginClass != null &&
                this._context.U8LoginClass.IsAdmin)
            {
                return(string.Empty);
            }

            string[] fileds    = fieldString.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string   condition = null;

            StringBuilder where = new StringBuilder();
            foreach (string field in fileds)
            {
                condition = this.GetWhere(field);
                if (!string.IsNullOrEmpty(condition))
                {
                    //只要某个条件为固定无权,则返回无权表达式
                    if (condition == RowAuthContext.NoAuthExpression)
                    {
                        return(RowAuthContext.NoAuthExpression);
                    }
                    where.Append(condition);
                    where.Append(" and ");
                }
            }

            if (where.Length > 5)
            {
                where = where.Remove(where.Length - 5, 5);
            }
            return(where.ToString());
        }
Exemplo n.º 11
0
 private void init(object u8login)
 {
     if (_ufDataConnString == string.Empty)
     {
         _u8login       = (clsLogin)u8login;
         _objectu8login = u8login;
         U8LoginInfor u8info = new U8LoginInfor(u8login);
         //Logger logger = Logger.GetLogger("zxy");
         //logger.Info("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
         //logger.Info("u8info.TaskID = " + u8info.TaskID);
         //logger.Close();
         _ufDataConnString = u8info.UfDataCnnString;
         _ufMetaConnString = u8info.UfMetaCnnString;
         _ufSystConnString = u8info.UfSystCnnString;
         _subid            = u8info.SubID;
         datadb            = u8info.AccDbName;
         metadatadb        = "UFMeta_" + this._u8login.get_cAcc_Id();
     }
 }
Exemplo n.º 12
0
        public void DeleteViewAuthFromDatabase(string viewguid, SqlTransaction tran)
        {
            try
            {
                U8LoginInfor login         = new U8LoginInfor(_u8login);
                string       procedurename = "uap_reportview_deleteviewauth";
                SqlCommand   cmd           = new SqlCommand(procedurename);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add(SqlHelper.GetParameter("@guid", SqlDbType.NVarChar, 100, viewguid));
                cmd.Parameters.Add(SqlHelper.GetParameter("@cAccId", SqlDbType.NVarChar, 10, login.cAccId));
                cmd.Parameters.Add(SqlHelper.GetParameter("@cYear", SqlDbType.NVarChar, 10, login.cYear));
                SqlHelper.ExecuteNonQuery(tran, cmd);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 13
0
        private void InitContext(string subId, string csubId, U8LoginInfor login, bool bWeb)
        {
            try
            {
                ContentAuth ca = new ContentAuth(
                    login.U8LoginClass.UfDbName,
                    login.UserID,
                    bWeb);

                this._context.ContentAuth  = ca;
                this._context.U8LoginClass = login.U8LoginClass;
                this._context.SubId        = subId;
                this._context.CSubId       = csubId;
            }
            catch (Exception e)
            {
                throw new Exception("初始化RowAuthContext出错:" + e.Message);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 另存元数据(报表或视图)
        /// </summary>
        /// <param name="login">包装的login信息</param>
        /// <param name="sourceId">另存的源Id(报表id或视图Id)</param>
        /// <param name="savaAsName">另存的新名称</param>
        /// <param name="saveAsType">另存类型</param>
        /// <returns>另存成功,返回true;已存在要另存的名称,返回false</returns>
        public bool SaveAs(
            U8LoginInfor login,
            string sourceId,
            string savaAsName,
            string reportSubId,
            SaveAsType saveAsType,
            string runtimeForamtXml,
            string colorstyleid,
            string currentViewId)
        {
            SqlCommand cmd = new SqlCommand("UAP_Report_RuntimeSaveAs");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(SqlHelper.GetParameter("@SourceId", SqlDbType.NVarChar, 100, sourceId));
            cmd.Parameters.Add(SqlHelper.GetParameter("@SaveAsName", SqlDbType.NVarChar, 256, savaAsName));
            cmd.Parameters.Add(SqlHelper.GetParameter("@SaveAsType", SqlDbType.NVarChar, 100, saveAsType.ToString()));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cAccId", SqlDbType.NVarChar, 100, login.cAccId));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cYear", SqlDbType.NVarChar, 100, login.cYear));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cUserId", SqlDbType.NVarChar, 100, login.UserID));
            cmd.Parameters.Add(SqlHelper.GetParameter("@IsExistedName", SqlDbType.Bit));
            cmd.Parameters.Add(SqlHelper.GetParameter("@ReportSubId", SqlDbType.NVarChar, 100, reportSubId));
            cmd.Parameters.Add(SqlHelper.GetParameter("@NewAuthIds", SqlDbType.NVarChar, 2000));
            cmd.Parameters.Add(SqlHelper.GetParameter("@RuntimeFormat", SqlDbType.NText, runtimeForamtXml));
            cmd.Parameters.Add(SqlHelper.GetParameter("@colorstyleid", SqlDbType.NVarChar, 100, colorstyleid));
            cmd.Parameters.Add(SqlHelper.GetParameter("@CurrentViewId", SqlDbType.NVarChar, 100, currentViewId));

            bool isNameExisted = false;

            this.ExcuteStoreProc(login.UfMetaCnnString, cmd, ref isNameExisted);
            if (isNameExisted)
            {
                return(false);
            }
            if (saveAsType == SaveAsType.SaveAsReport)
            {
                this.AddAuth2Cache(cmd, login);
            }
            return(true);
        }
Exemplo n.º 15
0
        private void GetDbSubIdwithViewId(string viewid, U8LoginInfor login, out string subid, out string csubid)
        {
            string strSQL = string.Format("select subId,csubid from uap_report where id in(select reportid from uap_reportview where id='{0}')", viewid);
            //string strSQL = string.Format("select subId from uap_report where id in(select reportid from uap_reportview where id='{0}')", viewid);
            SqlCommand cmd = new SqlCommand(strSQL);

            cmd.CommandType = CommandType.Text;

            DataSet ds = SqlHelper.ExecuteDataSet(login.UfMetaCnnString, cmd);

            subid = ""; csubid = "";
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["subId"] != null)
                {
                    subid = ds.Tables[0].Rows[0]["subId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["csubId"] != null)
                {
                    csubid = ds.Tables[0].Rows[0]["csubId"].ToString();
                }
            }
        }
        /// <summary>
        /// 发布到BS
        /// </summary>
        /// <param name="reportID"></param>
        /// <param name="cAccId"></param>
        /// <param name="cYear"></param>
        /// <param name="userId"></param>
        /// <param name="conString"></param>
        /// <returns></returns>
        public static bool PublishBS(string reportID, string cAccId, string cYear, string userId, U8LoginInfor u8LoginInfor)
        {
            CheckCnnString();

            //string menuId = reportID.GetHashCode().ToString();
            string menuId       = reportID;
            string reportName   = string.Empty;
            string twReportName = string.Empty;
            string enReportName = string.Empty;
            string filterid     = string.Empty;
            string subId        = string.Empty;
            string authId       = string.Empty;

            GetReportSimpleInfo(reportID, out reportName, out twReportName, out enReportName, out filterid, out subId);
            ReportAuth auth = new ReportAuth(u8LoginInfor);

            authId = auth.GetReportAuthId(reportID) + "_01";//01是查询权限
            //authId = GetAuthIdByReport(reportID);
            StringBuilder sb        = new StringBuilder();
            string        parameter = string.Format("<property type='Report' reportid='{0}'></property>", reportID);

            //菜单
            sb.AppendFormat("insert into ua_menu(cMenu_id,cMenu_name,cmenu_Eng,cSub_id,iGrade,cSupMenu_id,bEndGrade,cAuth_id,iOrder,iImgIndex,Paramters,  Depends,Flag,isWebFlag,cimagename,cmenutype)" +
                            "values('{0}'   ,'{1}'      ,null     ,'{2}'  ,'1'   ,'{3}'     ,1        ,'{4}'    ,1     ,1        ,@parameter    ,null   ,null,1,   'report_default.png','report');",
                            menuId, reportName, "UA", subId, authId);
            //语言
            sb.AppendFormat("INSERT INTO UFMENU_BUSINESS_LANG(MenuId,Caption,Localeid) values('{0}','{1}','zh-cn');", menuId, reportName);
            sb.AppendFormat("INSERT INTO UFMENU_BUSINESS_LANG(MenuId,Caption,Localeid) values('{0}','{1}','zh-tw');", menuId, twReportName);
            sb.AppendFormat("INSERT INTO UFMENU_BUSINESS_LANG(MenuId,Caption,Localeid) values('{0}','{1}','en-us');", menuId, enReportName);

            //把菜单置为isweb
            sb.AppendFormat(" update ufsystem..ua_Menu set iswebflag=2 where cmenu_id= '{0}';", subId);
            sb.AppendFormat("update  UFMeta_{0}..uap_report set MappingBsMenuId='{1}'where id='{2}'", cAccId, menuId, reportID);

            //菜单对应的程序集
            //sb.AppendFormat("Insert into ua_idt_ex (id,assembly,catalogtype,type,class,entrypoint,parameter,reserved)" +
            //"values('{0}','SLReport/UFIDA.U8.Report.SLReportView.dll',1,0,'UFIDA.U8.Report.SLReportView.ReportLoginable','{0}','','UFIDA.U8.Portal.Proxy.Supports.NetModule');",
            //menuId);
            SqlParameter reportParameter = new SqlParameter("parameter", parameter);
            SqlCommand   comand          = new SqlCommand(sb.ToString());

            comand.Parameters.Add(reportParameter);
            SqlHelper.ExecuteNonQuery(u8LoginInfor.UfDataCnnString, comand);

            //插入程序集
            //sb = new StringBuilder();
            //sb.AppendFormat("Insert into ua_idt (id,assembly,catalogtype,type,class,entrypoint,parameter,reserved)" +
            //"values('{0}','SLReport/UFIDA.U8.Report.SLReportView.dll',1,0,'UFIDA.U8.Report.SLReportView.ReportLoginable','{0}','','UFIDA.U8.Portal.Proxy.Supports.NetModule');",
            //menuId);
            //SqlHelper.ExecuteScalar(u8LoginInfor.UfSystCnnString, sb.ToString());

            comand.CommandType = CommandType.StoredProcedure;
            comand.CommandText = "dbo.sp_CalculateSupAuthByAuthID";
            comand.Parameters.Clear();
            comand.Parameters.Add(SqlHelper.GetParameter("@AuthID", SqlDbType.NVarChar, 100, authId));
            comand.Parameters.Add(SqlHelper.GetParameter("@isDelete", SqlDbType.Bit, "false"));
            SqlHelper.ExecuteNonQuery(u8LoginInfor.UfSystCnnString, comand);
            //更改状态 _DbCnnString是meta库
            SqlHelper.ExecuteNonQuery(_DbCnnString, GetCmdPublish(reportID, ReportPublicPosition.CSAndBS));
            return(true);
        }
Exemplo n.º 17
0
 public string GetRowAuth(string subId, string fieldString, U8LoginInfor login, bool bWeb)
 {
     return(GetRowAuth(subId, "", fieldString, login, bWeb));
 }
Exemplo n.º 18
0
 //专为字段权限使用
 public ReportAuth(U8LoginInfor login)
 {
     init(login);
 }
Exemplo n.º 19
0
 public ExpandProgram(object u8login)
 {
     _login = new U8LoginInfor(u8login);
 }
Exemplo n.º 20
0
 public ExpandProgram(U8LoginInfor u8login)
 {
     _login = u8login;
 }
Exemplo n.º 21
0
 public ReportListService(U8LoginInfor login)
 {
     this._login = login;
 }