Esempio n. 1
0
        public string GetConfigParameterValueFromDataSourceInfo(string moduleId, string dataSourceId, string protocol, string fileFormat, string aggregationSubType = "Incremental", string aggregationType = "REALListing")
        {
            //RdcCode is data source id.

            string paramValue = "";

            using (SystemEntities se = new SystemEntities())
            {
                try
                {
                    var dataSourceResult =
                        se.spDA_TCSDatasource_sel(moduleId.ToString(CultureInfo.InvariantCulture), false).ToList();

                    if (dataSourceResult.Count == 0)
                    {
                        return(null);
                    }

                    int dsid = 0;
                    foreach (var item in dataSourceResult)
                    {
                        if (item.OriginalDataSourceID.ToLower().Trim().Equals(dataSourceId.ToLower().Trim()))
                        {
                            dsid = item.datasourceid;
                            break;
                        }
                    }


                    var dataSourceConfigResult =
                        se.spDA_GetDataSourceConfigBasic(dsid.ToString(CultureInfo.InvariantCulture), protocol.ToString(CultureInfo.InvariantCulture), fileFormat.ToString(CultureInfo.InvariantCulture)).ToList();

                    if (dataSourceConfigResult.Count == 0)
                    {
                        return(null);
                    }

                    foreach (var item in dataSourceConfigResult)
                    {
                        if (!(item.AggregationSubType.Equals(aggregationSubType) && item.AggregationType.Equals(aggregationType)))
                        {
                            continue;
                        }
                        else
                        {
                            paramValue = item.FileFormatInfo.Trim();
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(paramValue);
        }
Esempio n. 2
0
        public bool ExistAggregationTypeFromDataSourceInfo(string moduleId, string dataSourceId, string protocol, string fileFormat, string aggregationType)
        {
            //RdcCode is data source id.
            bool existAggregationType = false;

            using (SystemEntities se = new SystemEntities())
            {
                try
                {
                    var dataSourceResult =
                        se.spDA_TCSDatasource_sel(moduleId.ToString(CultureInfo.InvariantCulture), false).ToList();

                    if (dataSourceResult.Count == 0)
                    {
                        return(existAggregationType);
                    }

                    int dsid = 0;
                    foreach (var item in dataSourceResult)
                    {
                        if (item.OriginalDataSourceID.ToLower().Trim().Equals(dataSourceId.ToLower().Trim()))
                        {
                            dsid = item.datasourceid;
                            break;
                        }
                    }


                    var dataSourceConfigResult =
                        se.spDA_GetDataSourceConfigBasic(dsid.ToString(CultureInfo.InvariantCulture), protocol.ToString(CultureInfo.InvariantCulture), fileFormat.ToString(CultureInfo.InvariantCulture)).ToList();

                    if (dataSourceConfigResult.Count == 0)
                    {
                        return(existAggregationType);
                    }

                    foreach (var item in dataSourceConfigResult)
                    {
                        if ((item.AggregationType.Equals(aggregationType)))
                        {
                            existAggregationType = true;
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(existAggregationType);
        }