Esempio n. 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.cmbLayoutType.SelectedItem == null)
            {
                MessageBox.Show("設計書の種別を選択してください。");
                return;
            }
            if (this.chkOptions.CheckedItems.Count == 0)
            {
                MessageBox.Show("SQLスクリプト作成オプションをチェックしてください。");
                return;
            }
            if (string.IsNullOrEmpty(this.txtFileName.Text) || !System.IO.File.Exists(this.txtFileName.Text))
            {
                MessageBox.Show("データベース設計書を選択してください。");
                return;
            }

            this._settingInfo = new TableCreateInfo();
            this._settingInfo.LayoutFileName = this.txtFileName.Text;
            TemplateInfo.DocumentTemplateRow tempInfo =
                (TemplateInfo.DocumentTemplateRow)((DataRowView)this.cmbLayoutType.SelectedItem).Row;
            this._settingInfo.TemplateInfo = tempInfo;
            foreach (BindListItem optItem in this.chkOptions.CheckedItems)
            {
                this._settingInfo.Options |= (ScriptOptions)optItem.Value;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Esempio n. 2
0
        /// <summary>
        /// データベースCreate用SQLスクリプトを作成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DatabaseCreateButton_Click(object sender, EventArgs e)
        {
            try
            {
                TableCreateInfo info = null;
                using (SelectDbLayoutForm selectForm = new SelectDbLayoutForm())
                {
                    if (selectForm.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }
                    info = selectForm.SettingInfo;
                }

                if (info != null)
                {
                    Run(new CommandArg(CommandKind.TableScriptCreate, info));
                }
            }
            catch (Exception ex)
            {
                Logging.Exception("", ex);
                MessageBox.Show(this, ex.Message, "例外", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.cmbTableSheets.SelectedIndex == -1)
            {
                MessageBox.Show(this, "テーブル一覧を選択してください。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (this.cmbLayoutType.SelectedItem == null)
            {
                MessageBox.Show("設計書の種別を選択してください。");
                return;
            }
            if (this.chkOptions.CheckedItems.Count == 0)
            {
                MessageBox.Show("SQLスクリプト作成オプションをチェックしてください。");
                return;
            }
            if (string.IsNullOrEmpty(this.txtFileName.Text) || !System.IO.File.Exists(this.txtFileName.Text))
            {
                MessageBox.Show("データベース設計書を選択してください。");
                return;
            }

            this._settingInfo = new TableCreateInfo();
            this._settingInfo.TableListSheetName = (string)this.cmbTableSheets.SelectedItem;
            this._settingInfo.LayoutFileName     = this.txtFileName.Text;
            BindListItem item = (BindListItem)this.cmbLayoutType.SelectedItem;

            this._settingInfo.LayoutKind = (LayoutType)item.Value;
            foreach (BindListItem optItem in this.chkOptions.CheckedItems)
            {
                this._settingInfo.Options |= (ScriptOptions)optItem.Value;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Esempio n. 4
0
        /// <summary>
        /// データベース作成用SQL文を生成する
        /// </summary>
        /// <param name="designFileName"></param>
        /// <param name="layoutType"></param>
        private void DoCreateSqlScript(TableCreateInfo createInfo)
        {
            TableCreator creator = new TableCreator(reportHandler);

            creator.CreateDBScript(createInfo);
        }