瀏覽代碼

update something,but not complete!

张泳健 8 年之前
父節點
當前提交
704849a6de

+ 40 - 2
GWSocketClient/InfoEditor.Designer.cs 查看文件

29
         private void InitializeComponent()
29
         private void InitializeComponent()
30
         {
30
         {
31
             this.dataGridView1 = new System.Windows.Forms.DataGridView();
31
             this.dataGridView1 = new System.Windows.Forms.DataGridView();
32
+            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
33
+            this.文件FToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34
+            this.tsmiUpdateDb = new System.Windows.Forms.ToolStripMenuItem();
32
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
35
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
36
+            this.menuStrip1.SuspendLayout();
33
             this.SuspendLayout();
37
             this.SuspendLayout();
34
             // 
38
             // 
35
             // dataGridView1
39
             // dataGridView1
42
             this.dataGridView1.Location = new System.Drawing.Point(12, 190);
46
             this.dataGridView1.Location = new System.Drawing.Point(12, 190);
43
             this.dataGridView1.Name = "dataGridView1";
47
             this.dataGridView1.Name = "dataGridView1";
44
             this.dataGridView1.RowTemplate.Height = 23;
48
             this.dataGridView1.RowTemplate.Height = 23;
45
-            this.dataGridView1.Size = new System.Drawing.Size(984, 400);
49
+            this.dataGridView1.Size = new System.Drawing.Size(1217, 400);
46
             this.dataGridView1.TabIndex = 0;
50
             this.dataGridView1.TabIndex = 0;
51
+            
52
+            // 
53
+            // menuStrip1
54
+            // 
55
+            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
56
+            this.文件FToolStripMenuItem});
57
+            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
58
+            this.menuStrip1.Name = "menuStrip1";
59
+            this.menuStrip1.Size = new System.Drawing.Size(1241, 25);
60
+            this.menuStrip1.TabIndex = 1;
61
+            this.menuStrip1.Text = "menuStrip1";
62
+            // 
63
+            // 文件FToolStripMenuItem
64
+            // 
65
+            this.文件FToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
66
+            this.tsmiUpdateDb});
67
+            this.文件FToolStripMenuItem.Name = "文件FToolStripMenuItem";
68
+            this.文件FToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
69
+            this.文件FToolStripMenuItem.Text = "文件(&F)";
70
+            // 
71
+            // tsmiUpdateDb
72
+            // 
73
+            this.tsmiUpdateDb.Name = "tsmiUpdateDb";
74
+            this.tsmiUpdateDb.Size = new System.Drawing.Size(152, 22);
75
+            this.tsmiUpdateDb.Text = "保存(&S)";
76
+            this.tsmiUpdateDb.Click += new System.EventHandler(this.tsmiUpdateDb_Click);
47
             // 
77
             // 
48
             // InfoEditor
78
             // InfoEditor
49
             // 
79
             // 
50
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
80
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
51
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
81
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
52
-            this.ClientSize = new System.Drawing.Size(1008, 602);
82
+            this.ClientSize = new System.Drawing.Size(1241, 602);
53
             this.Controls.Add(this.dataGridView1);
83
             this.Controls.Add(this.dataGridView1);
84
+            this.Controls.Add(this.menuStrip1);
85
+            this.MainMenuStrip = this.menuStrip1;
54
             this.Name = "InfoEditor";
86
             this.Name = "InfoEditor";
55
             this.Text = "InfoEditor";
87
             this.Text = "InfoEditor";
56
             this.Load += new System.EventHandler(this.InfoEditor_Load);
88
             this.Load += new System.EventHandler(this.InfoEditor_Load);
57
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
89
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
90
+            this.menuStrip1.ResumeLayout(false);
91
+            this.menuStrip1.PerformLayout();
58
             this.ResumeLayout(false);
92
             this.ResumeLayout(false);
93
+            this.PerformLayout();
59
 
94
 
60
         }
95
         }
61
 
96
 
62
         #endregion
97
         #endregion
63
 
98
 
64
         private System.Windows.Forms.DataGridView dataGridView1;
99
         private System.Windows.Forms.DataGridView dataGridView1;
100
+        private System.Windows.Forms.MenuStrip menuStrip1;
101
+        private System.Windows.Forms.ToolStripMenuItem 文件FToolStripMenuItem;
102
+        private System.Windows.Forms.ToolStripMenuItem tsmiUpdateDb;
65
     }
103
     }
66
 }
104
 }

+ 10 - 2
GWSocketClient/InfoEditor.cs 查看文件

2
 using System.Collections.Generic;
2
 using System.Collections.Generic;
3
 using System.ComponentModel;
3
 using System.ComponentModel;
4
 using System.Data;
4
 using System.Data;
5
+using System.Data.SqlClient;
5
 using System.Drawing;
6
 using System.Drawing;
6
 using System.Linq;
7
 using System.Linq;
7
 using System.Text;
8
 using System.Text;
20
 
21
 
21
         private void InfoEditor_Load(object sender, EventArgs e)
22
         private void InfoEditor_Load(object sender, EventArgs e)
22
         {
23
         {
23
-            MessageBox.Show(AccsessDbLoader.getInstance().getWebViewJson());
24
-            dataGridView1.DataSource = AccsessDbLoader.getInstance().getDt();
24
+            dataGridView1.DataSource = AccsessDbLoader.getInstance().getDataTable();
25
         }
25
         }
26
+
27
+        private void tsmiUpdateDb_Click(object sender, EventArgs e)
28
+        {
29
+            
30
+        }
31
+
32
+       
33
+        
26
     }
34
     }
27
 }
35
 }

+ 3 - 0
GWSocketClient/InfoEditor.resx 查看文件

117
   <resheader name="writer">
117
   <resheader name="writer">
118
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
   </resheader>
119
   </resheader>
120
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
120
 </root>
123
 </root>

二進制
GWSocketClient/bin/Debug/dbfile/ID_INFO.accdb 查看文件


二進制
GWSocketClient/bin/Release/dbfile/ID_INFO.accdb 查看文件


+ 12 - 5
GWSocketClient/db/AccsessDbLoader.cs 查看文件

15
     {
15
     {
16
         private static AccsessDbLoader INSTANCE = null;
16
         private static AccsessDbLoader INSTANCE = null;
17
 
17
 
18
-        private DataTable dt = new DataTable();
18
+        private DataTable dataTable = new DataTable();
19
+        private OleDbDataAdapter dataAdapter;
19
 
20
 
20
         private List<WvBean> wvBeans = new List<WvBean>();
21
         private List<WvBean> wvBeans = new List<WvBean>();
21
         public Dictionary<string, string> ID_INFO = new Dictionary<string, string>();
22
         public Dictionary<string, string> ID_INFO = new Dictionary<string, string>();
25
             return INSTANCE ?? (INSTANCE = new AccsessDbLoader(dbssPath));
26
             return INSTANCE ?? (INSTANCE = new AccsessDbLoader(dbssPath));
26
         }
27
         }
27
 
28
 
28
-        public DataTable getDt()
29
+        public DataTable getDataTable()
29
         {
30
         {
30
-            return dt;
31
+            return dataTable;
32
+        }
33
+
34
+
35
+        public OleDbDataAdapter getDataAdapter()
36
+        {
37
+            return dataAdapter;
31
         }
38
         }
32
 
39
 
33
         public Dictionary<string, string> getUserIdInfo()
40
         public Dictionary<string, string> getUserIdInfo()
67
                     sqlcmd = new OleDbCommand(@"select * from fw", objConnection); //sql语句     
74
                     sqlcmd = new OleDbCommand(@"select * from fw", objConnection); //sql语句     
68
 
75
 
69
 
76
 
70
-                    OleDbDataAdapter da = new OleDbDataAdapter(sqlcmd);
77
+                    dataAdapter = new OleDbDataAdapter(sqlcmd);
71
 
78
 
72
-                    da.Fill(dt);
79
+                    dataAdapter.Fill(dataTable);
73
 
80
 
74
                     using (OleDbDataReader reader = sqlcmd.ExecuteReader())
81
                     using (OleDbDataReader reader = sqlcmd.ExecuteReader())
75
                     {
82
                     {