Skip to content

Commit d786f6e

Browse files
committed
'支持postgresql'
1 parent 58dfe60 commit d786f6e

19 files changed

+4392
-108
lines changed

AddColPostgreSql.Designer.cs

Lines changed: 252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AddColPostgreSql.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Windows.Forms;
9+
10+
namespace CodeCreator
11+
{
12+
public partial class AddColPostgreSql : Form
13+
{
14+
public AddColPostgreSql()
15+
{
16+
InitializeComponent();
17+
}
18+
19+
private void button2_Click(object sender, EventArgs e)
20+
{
21+
this.Close();
22+
}
23+
24+
private void AddCol_Load(object sender, EventArgs e)
25+
{
26+
textBox1.Text = DataTransfer.TableName;
27+
}
28+
29+
private void button1_Click(object sender, EventArgs e)
30+
{
31+
DBUtil.TableStruct.Column col = new DBUtil.TableStruct.Column();
32+
col.Name = textBox2.Text;
33+
col.Type = textBox3.Text;
34+
col.Desc = textBox4.Text;
35+
col.IsNullable = checkBox1.Checked;
36+
col.IsUnique = checkBox2.Checked;
37+
col.Default = textBox6.Text;
38+
if (string.IsNullOrEmpty(col.Name))
39+
{
40+
MessageBox.Show("请输入列名!");
41+
return;
42+
}
43+
DBUtil.PostgreSqlIDbAccess iDb = DataTransfer.iDb as DBUtil.PostgreSqlIDbAccess;
44+
try
45+
{
46+
iDb.AddColumn(textBox1.Text, col);
47+
MessageBox.Show("添加成功!");
48+
}
49+
catch (Exception ex)
50+
{
51+
MessageBox.Show("添加失败:" + ex.ToString());
52+
}
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)