Esempio n. 1
0
        private void btnCreateDbSQL_Click(Object sender, EventArgs e)
        {
            if (cbConn.SelectedItem == null)
            {
                return;
            }

            var dal = DAL.Create("" + cbConn.SelectedItem);

            if (dal == null)
            {
                return;
            }

            try
            {
                IMetaData md = dal.Db.CreateMetaData();
                var       sb = new StringBuilder();
                foreach (var table in Tables)
                {
                    var sql = CreateTable(md, table);
                    if (!String.IsNullOrEmpty(sql))
                    {
                        sb.AppendLine(sql);
                    }
                }

                FrmText.Create("建表语句", sb.ToString()).Show();
            }
            catch (Exception ex)
            {
                FrmText.Create("建表语句", "生成建表语句错误!" + Environment.NewLine + ex.ToString()).Show();
            }
        }
Esempio n. 2
0
        private void btnCreateTableSQL_Click(Object sender, EventArgs e)
        {
            if (cbConn.SelectedItem == null)
            {
                return;
            }

            IDataTable table = GetSelectedTable();

            if (table == null)
            {
                return;
            }

            var dal = DAL.Create("" + cbConn.SelectedItem);

            if (dal == null)
            {
                return;
            }

            try
            {
                IMetaData md  = dal.Db.CreateMetaData();
                var       sql = CreateTable(md, table);

                FrmText.Create(table.TableName + "表建表语句", sql).Show();
            }
            catch (Exception ex)
            {
                FrmText.Create(table.TableName + "表建表语句", "生成建表语句错误!" + Environment.NewLine + ex.ToString()).Show();
            }
        }
Esempio n. 3
0
        private void 关于ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(this.GetType(), "UpdateInfo.txt");
            var text   = Encoding.UTF8.GetString(stream.ReadBytes());

            FrmText.Create("升级历史", text).Show();
        }
Esempio n. 4
0
        private void lbEditHeader_LinkClicked(Object sender, LinkLabelLinkClickedEventArgs e)
        {
            var frm = FrmText.Create("C#文件头模版", Config.HeadTemplate);

            frm.ShowDialog();
            Config.HeadTemplate = frm.Content.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");
            frm.Dispose();
        }
Esempio n. 5
0
        public static FrmText Create(String title, String content)
        {
            FrmText frm = new FrmText();
            if (!String.IsNullOrEmpty(title)) frm.Text = title;
            frm.richTextBox1.Text = content;

            return frm;
        }
Esempio n. 6
0
        public static FrmText Create(String title, String content)
        {
            var frm = new FrmText();

            if (!String.IsNullOrEmpty(title))
            {
                frm.Text = title;
            }
            frm.Content = content;

            return(frm);
        }
Esempio n. 7
0
 private void 关于ToolStripMenuItem1_Click(Object sender, EventArgs e)
 {
     FrmText.Create("升级历史", Source.GetText("UpdateInfo")).Show();
 }
Esempio n. 8
0
 private void 表名字段名命名规范ToolStripMenuItem_Click(Object sender, EventArgs e)
 {
     FrmText.Create("表名字段名命名规范", Source.GetText("数据库命名规范")).Show();
 }