示例#1
0
        /// <summary>
        /// Creates the insert statements
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateInsertStatementClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (_dbType == null)
                {
                    throw new ArgumentNullException("Please select a database type.");
                }

                if (SourceFile.Text.Equals(""))
                {
                    throw new ArgumentNullException("Please select a source file.");
                }

                string filetype = Path.GetExtension(SourceFile.Text);

                String result = "";

                if (filetype.Equals(".mxml"))
                {
                    DbCreationHelper = new DatabaseCreationHelperFromMXML(_dbType, SourceFile.Text);
                    result           = DbCreationHelper.CreateInsertSqlStatement();
                }

                Clipboard.SetText(result);
                ModernDialog.ShowMessage("The SQL-Statement was copied to the clipboard.", "Info", MessageBoxButton.OK);
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "Error: ", MessageBoxButton.OK);
            }
        }
示例#2
0
        public static IApplicationBuilder UseDatabaseCreation(
            this IApplicationBuilder app,
            IConfiguration configuration,
            IHostApplicationLifetime appLifetime,
            IDataProtector dataProtector,
            ILogger <Startup> logger)
        {
            DatabaseCreationHelper.Run(configuration, appLifetime, dataProtector, logger);

            return(app);
        }
示例#3
0
        /// <summary>
        /// Creates an empty database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreateEmptyDBClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (DBTypeComboBox.SelectedIndex < 0)
                {
                    throw new ArgumentNullException("Please select a database type.");
                }

                DbCreationHelper = new DatabaseCreationHelperFromMXML(_dbType, null);

                String result = DbCreationHelper.CreateEmptyDwh();

                Clipboard.SetText(result);
                ModernDialog.ShowMessage("The SQL-Statement was copied to the clipboard.", "Info", MessageBoxButton.OK);
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "Error: ", MessageBoxButton.OK);
            }
        }