Example #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();
            }
        }
Example #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();
            }
        }
Example #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();
        }
Example #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();
        }
Example #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;
        }
Example #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);
        }
Example #7
0
 private void 关于ToolStripMenuItem1_Click(Object sender, EventArgs e)
 {
     FrmText.Create("升级历史", Source.GetText("UpdateInfo")).Show();
 }
Example #8
0
 private void 表名字段名命名规范ToolStripMenuItem_Click(Object sender, EventArgs e)
 {
     FrmText.Create("表名字段名命名规范", Source.GetText("数据库命名规范")).Show();
 }