Example #1
0
        private string ShowSqlEditor(IWindowsFormsEditorService wfes, SreDataSourceProperty dsProperty)
        {
            frmConfigSql configSql = new frmConfigSql(dsProperty.Id, true, "Push Sql Configuration");

            if ((dsProperty.PusherTypeFullName != null) &&
                (dsProperty.PusherTypeFullName.Contains("|")))
            {
                string[] strInfo = dsProperty.PusherTypeFullName.Split("|".ToCharArray());
                configSql.pullSqlConfiguration1.ConnectionStringKeyNameDesign = strInfo[0];
                configSql.pullSqlConfiguration1.ConnectionStringKeyName       = strInfo[1];
                configSql.pullSqlConfiguration1.UpdateQuery = strInfo[2];
            }
            if (configSql.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                dsProperty.PusherTypeFullName = string.Format("{0}|{1}|{2}",
                                                              configSql.pullSqlConfiguration1.ConnectionStringKeyNameDesign,
                                                              configSql.pullSqlConfiguration1.ConnectionStringKeyName,
                                                              configSql.pullSqlConfiguration1.UpdateQuery);

                return(dsProperty.PusherTypeFullName);
            }
            return(string.Empty);
        }
Example #2
0
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService wfes = provider.GetService(typeof(IWindowsFormsEditorService)) as
                                              IWindowsFormsEditorService;

            SreDataSourceProperty dsProperty = context.Instance as SreDataSourceProperty;

            if (wfes != null)
            {
                switch (dsProperty.DataFeederType)
                {
                case DataFeederTypes.PullSql:

                    frmConfigSql configPullSql = new frmConfigSql(dsProperty.Id);
                    wfes.ShowDialog(configPullSql);
                    break;


                default:

                    DataFormatTypes selType = dsProperty.DataFormatType;
                    if ((selType == DataFormatTypes.Xml) ||
                        (selType == DataFormatTypes.Zipped))
                    {
                        selType = DataFormatTypes.Delimited;      //to prevent showing xml/zip UI when clicked from this button.
                    }
                    frmConfig configUI = new frmConfig(true, dsProperty.Id, dsProperty.DataFeederType, selType);

                    IdpeKey key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.FtpRemoteLocation.ToString());
                    configUI.FtpRemoteLocation = key != null ? key.Value : string.Empty;
                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalLocation.ToString());
                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.FtpUserName.ToString());
                    configUI.FtpUserName = key != null ? key.Value : string.Empty;
                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.FtpPassword.ToString());
                    configUI.FtpPassword = key != null ? key.Value : string.Empty;
                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.FtpWatchInterval.ToString());
                    configUI.Interval = int.Parse(key != null ? key.Value : "2");
                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.WatchFilter.ToString());
                    configUI.WatchFilter = key != null ? key.Value : "All(No Filter)";

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.FileInterfaceName.ToString());
                    if (key != null)
                    {
                        configUI.InterfaceName = key.Value;
                    }

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.IsFirstRowHeader.ToString());
                    if (key != null)
                    {
                        configUI.IsFirstRowIsHeader = key.Value.ParseBool();
                    }


                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalFileSystemFoldersOverriden.ToString());
                    configUI.LocalFileSystemFoldersOverriden = key != null?key.Value.ParseBool() : false;

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalFileSystemFolderArchiveAuto.ToString());
                    configUI.LocalFileSystemFolderArchiveAuto = key != null?key.Value.ParseBool() : false;

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalFileSystemFolderPull.ToString());
                    configUI.LocalFileSystemFolderPullFolder = key != null ? key.Value : string.Empty;

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalFileSystemFolderArchive.ToString());
                    configUI.LocalFileSystemFolderArchiveFolder = key != null ? key.Value : string.Empty;

                    key = dsProperty.DataSourceKeys.GetKey(IdpeKeyTypes.LocalFileSystemFolderOutput.ToString());
                    configUI.LocalFileSystemFolderOutputFolder = key != null ? key.Value : string.Empty;


                    wfes.ShowDialog(configUI);
                    //this.DataSourceKeys = _Manager.GetKeys(DataSource.Id);


                    break;
                }
            }
            return(value);
        }