Ejemplo n.º 1
0
        private void btnGenerateDuplicateCheck_Click(object sender, EventArgs e)
        {
            DatabaseTypes databaseType = DatabaseTypes.SqlServer;

            switch (cbDatabaseTypes.Text)
            {
            case "Oracle":
                databaseType = DatabaseTypes.Oracle;
                break;

            case "DB2":
                databaseType = DatabaseTypes.DB2iSeries;
                break;

            case "Microsoft SQL Compact Edition":
                databaseType = DatabaseTypes.SqlCe;
                break;

            case "Microsoft SQL Server":
                databaseType = DatabaseTypes.SqlServer;
                break;

            default:
                return;
            }

            //this should be data source and not system
            SystemDataSources sds = new SystemDataSources(this.Icon);

            if (sds.ShowDialog() == DialogResult.OK)
            {
                IdpeKey uniquenessKey = new Manager().GetKey(sds.SelectedSystemDataSource.Id, "UniquenessCriteria");
                if ((uniquenessKey != null) &&
                    (!string.IsNullOrEmpty(uniquenessKey.Value)))
                {
                    btnGenerateDuplicateCheck.Enabled = true;
                    toolTip1.SetToolTip(btnGenerateDuplicateCheck, "Generates store procedure code");
                    errorProvider1.SetError(btnGenerateDuplicateCheck, string.Empty);
                }
                else
                {
                    btnGenerateDuplicateCheck.Enabled = false;
                    string errorMsg = "The 'UniquenessCriteria' key is not defined";
                    toolTip1.SetToolTip(btnGenerateDuplicateCheck, errorMsg);
                    errorProvider1.SetError(btnGenerateDuplicateCheck, errorMsg);
                }

                string   strCode  = new Manager().GenerateDuplicateCheckStoreProcedureCode(sds.SelectedSystemDataSource.Id, databaseType);
                TextArea textArea = new TextArea("Duplicate Check Store Procedure Code");
                textArea.txtContent.Text = strCode;
                textArea.ShowDialog();
            }
        }
Ejemplo n.º 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)
            {
                SystemDataSources sds = new SystemDataSources(Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location), dsProperty.SystemDataSourceId);
                if (sds.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (sds.SelectedSystemDataSource != null)
                    {
                        value = sds.SelectedSystemDataSource.Name;
                        dsProperty.SystemName         = sds.SelectedSystemDataSource.Name;
                        dsProperty.SystemDataSourceId = sds.SelectedSystemDataSource.Id;
                    }
                }
            }
            return(value);
        }
Ejemplo n.º 3
0
        private void mnItmSystemDataSources_Click(object sender, EventArgs e)
        {
            SystemDataSources systemDataSources = new SystemDataSources(this.Icon);

            systemDataSources.Show();
        }