public SreType(string columnName, string value, AttributeTypes type, string formula, string minimum, string maximum, bool isAssociatedWithSystemRow, int recordPosition, SqlClientManager sqlClientManager, List <IdpeKey> dataSourceKeys) { _ConnectionStringKeyName = Constants.DefaultConnectionStringKeyName; SqlClientManager = sqlClientManager; _DataSourceKeys = dataSourceKeys; _ConnectionString = DataSourceKeys.GetDefaultConnectionString(); bool result = Init(columnName, value, type, formula, minimum, maximum, isAssociatedWithSystemRow, recordPosition); if (result) { _ParseResult = new IdpeMessage(IdpeMessageCodes.IDPE_SUCCESS); } else { _ParseResult = new IdpeMessage(IdpeMessageCodes.IDPE_FAILED); } }
public override void Assign() { PropertyGridProperty prop_Name = GetReadOnlyProperty("Name"); PropertyGridProperty prop_EditableName = GetReadOnlyProperty("EditableName"); if (DataSource == null) { //default values, just to show screen beautiful DataFormatType = DataFormatTypes.Delimited; OutputFileNameFormat = "Same as Input"; OutputFileExtension = ".csv"; HasHeader = true; OutputHasHeader = true; prop_Name.FieldToChange.SetValue(prop_Name.BrowsableAttribute, true); prop_EditableName.FieldToChange.SetValue(prop_EditableName.BrowsableAttribute, false); } else { if (DataSource.Id == 0) { prop_Name.FieldToChange.SetValue(prop_Name.BrowsableAttribute, false); prop_EditableName.FieldToChange.SetValue(prop_EditableName.BrowsableAttribute, true); HasHeader = true; OutputHasHeader = true; } else { DataSourceKeys = new Manager().GetKeys(this.DataSource.Id); prop_Name.FieldToChange.SetValue(prop_Name.BrowsableAttribute, true); prop_EditableName.FieldToChange.SetValue(prop_EditableName.BrowsableAttribute, false); HasHeader = DataSourceKeys.GetKeyValue(IdpeKeyTypes.IsFirstRowHeader).ParseBool(); OutputHasHeader = DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputIsFirstRowHeader).ParseBool(); } DataFeederType = (DataFeederTypes)DataSource.DataFeederType; DataFormatType = (DataFormatTypes)DataSource.DataFormatType; Description = DataSource.Description; SystemDataSourceId = (int)DataSource.SystemDataSourceId; if (DataFormatType == DataFormatTypes.Custom) { IdpeKey key = new Manager().GetKey(this.DataSource.Id, IdpeKeyTypes.FileInterfaceName.ToString()); if (key != null) { ConfigureDataFormat = key.Value; } } if (SystemDataSourceId > 0) { IdpeDataSource sysDs = new Manager().GetDataSourceDetails(SystemDataSourceId); if (sysDs != null) { SystemName = sysDs.Name; } } else { SystemName = string.Empty; } OutputDataFormatType = (OutputTypes)DataSource.OutputType; OutputCustomInterfaceName = DataSource.OutputWriterTypeFullName; IdpeKey keyTestFileName = new Manager().GetKey(this.DataSource.Id, IdpeKeyTypes.TestFileName.ToString()); if (keyTestFileName != null) { TestFileName = keyTestFileName.Value; } #region Post Events PusherTypeFullName = DataSource.PusherTypeFullName; PostEvent = (PusherTypes)DataSource.PusherType; PostEventCustomInterfaceName = DataSource.PusherTypeFullName; #endregion Post Events if (DataSource.Id == 0) { return;//as keys are not available, its a new data source } SpreadSheetNumber = (int)DataSourceKeys.GetKeyValue(IdpeKeyTypes.SpreadSheetNumber).ParseInt(); WriteStandardOutput = DataSourceKeys.GetKeyValue(IdpeKeyTypes.WcfCallsGenerateStandardOutput).ParseBool(); if (string.IsNullOrEmpty(DataSource.Delimiter)) { Delimiter = ","; } else if ((DataSource.Delimiter != null) && (DataSource.Delimiter.ToLower() == "\t")) { Delimiter = "Tab"; } else { Delimiter = DataSource.Delimiter; } RenameHeader = DataSourceKeys.GetKeyValue(IdpeKeyTypes.RenameColumnHeader).ParseBool(); #region Output AllowPartial = DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputPartialRecordsAllowed).ParseBool(); string strDelmiterOutput = DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputDelimiter); if (string.IsNullOrEmpty(strDelmiterOutput)) { OutputDelimiter = ","; } else if ((strDelmiterOutput != null) && (strDelmiterOutput.ToLower() == "\t")) { OutputDelimiter = "Tab"; } else { OutputDelimiter = strDelmiterOutput; } string outputFileName = DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputFileName); if (!string.IsNullOrEmpty(outputFileName)) { OutputFileNameFormat = outputFileName; } else { OutputFileNameFormat = "Same as Input"; } string outputFileExt = DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputFileExtension); if (!string.IsNullOrEmpty(outputFileExt)) { OutputFileExtension = outputFileExt; } else { OutputFileExtension = ".xml"; } EncloseWithDoubleQuote = !DataSourceKeys.GetKeyValue(IdpeKeyTypes.OutputDelimiterDoNotEncloseWithDoubleQuote).ParseBool(); #endregion Output } }