Ejemplo n.º 1
0
        public static void SaveDirectInsertDataIntoTable(
            DataSourceInfor dataSourceInfor,
            string cnnString)
        {
            string sql = UpgradeSqlProducer.GetSqlDirectSaveDataSourceIntoTable(dataSourceInfor);

            SqlHelper.ExecuteNonQuery(cnnString, sql);
            Trace.WriteLine("直接写入表BD_BusinessObjects,成功保存数据源! ID:" + dataSourceInfor.MetaID);
        }
Ejemplo n.º 2
0
        private DataTable GetLevelExpandInfor()
        {
            string  sql = UpgradeSqlProducer.GetSqlLevelExpandInforUpgrade(_ReportId);
            DataSet ds  = SqlHelper.ExecuteDataSet(_UfDataCnnString, sql);
            DataRow dr  = SqlHelper.GetDataRowFrom(0, ds);

            if (dr != null)
            {
                return(ds.Tables[0]);
            }
            return(null);
        }
Ejemplo n.º 3
0
        // 计算列时cell的Name取的中文下的Name字段
        // 而非简体下的可能不一样会导致计算列在非简体
        // 下没有该计算列
        public string GetCaculateColumnName(
            string id,
            string orderEx,
            string topEx)
        {
            string  sql = UpgradeSqlProducer.GetSqlCaculateColumnName(id, orderEx, topEx);
            DataSet ds  = SqlHelper.ExecuteDataSet(_UfDataConnString, sql);
            DataRow dr  = SqlHelper.GetDataRowFrom(0, ds);

            if (dr != null)
            {
                return(SqlHelper.GetStringFrom(dr[0]));
            }

            return(string.Empty);
        }
Ejemplo n.º 4
0
        public static string GetFieldNote(
            string ufDataCnnString,
            string reportId)
        {
            string  note = string.Empty;
            string  sql  = UpgradeSqlProducer.GetSqlOldReportInfor(reportId, "zh-CN");
            DataSet ds   = SqlHelper.ExecuteDataSet(ufDataCnnString, sql);
            DataRow dr   = SqlHelper.GetDataRowFrom(0, ds);

            if (dr != null)
            {
                return(SqlHelper.GetStringFrom(dr["Note"]));
            }

            return(string.Empty);
        }
Ejemplo n.º 5
0
        private void PrepareDataColumnInfor()
        {
            string  sql = UpgradeSqlProducer.GetSqlFldDefInfors(_ReportID, _LocaleID, "0");
            DataSet ds  = SqlHelper.ExecuteDataSet(_UfDataConnString, sql);

            if (ds != null)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataColumnInfor col = new DataColumnInfor();
                    DataRow         dr  = ds.Tables[0].Rows[i];
                    col.Name        = SqlHelper.GetStringFrom(dr["Expression"]);
                    col.Description = SqlHelper.GetStringFrom(dr["Name"]);
                    col.FormatEx    = SqlHelper.GetStringFrom(dr["FormatEx"]);

                    if (col.Name == string.Empty)
                    {
                        col.Name = col.Description;
                    }

                    _DataColumnInfors.Add(col);
                }

                _DataColumnInfors.Sort();
            }

            sql = UpgradeSqlProducer.GetSqlSummaryColInfor(_ReportID);
            ds  = SqlHelper.ExecuteDataSet(_UfDataConnString, sql);
            if (ds != null)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataColumnInfor col = new DataColumnInfor();
                    DataRow         dr  = ds.Tables[0].Rows[i];
                    col.Name         = SqlHelper.GetStringFrom(dr["Name"]);
                    col.OperatorType = SqlHelper.GetStringFrom(dr["OperatorTypeType"]);

                    // 这步处理与GetSqlSummaryColInfor中ORDER BY OperatorTypeType呼应
                    if (_SummaryTypeInfors[col.Name] == null)
                    {
                        _SummaryTypeInfors.Add(col);
                    }
                }
            }

            _IsFilledData = true;
        }
Ejemplo n.º 6
0
        public static string GetSqlBaseTableOldId(
            string ufDataCnnString,
            string reportId,
            string subId)
        {
            string note = GetFieldNote(ufDataCnnString, reportId);

            if (note != string.Empty)
            {
                string  sql = UpgradeSqlProducer.GetSqlOldReportInfor(note, subId, "zh-CN");
                DataSet ds  = SqlHelper.ExecuteDataSet(ufDataCnnString, sql);
                DataRow dr  = SqlHelper.GetDataRowFrom(0, ds);
                if (dr != null)
                {
                    return(SqlHelper.GetStringFrom(dr["ID"]));
                }
            }

            return(string.Empty);
        }