Browse Source

历史记录功能

张泳健 7 years ago
parent
commit
1491517bc3

+ 11 - 1
DotNettyFrom/DotNettyFrom.csproj View File

@@ -138,6 +138,12 @@
138 138
     <Compile Include="dialog\HeartBeatTime.Designer.cs">
139 139
       <DependentUpon>HeartBeatTime.cs</DependentUpon>
140 140
     </Compile>
141
+    <Compile Include="dialog\HistoryDialog.cs">
142
+      <SubType>Form</SubType>
143
+    </Compile>
144
+    <Compile Include="dialog\HistoryDialog.Designer.cs">
145
+      <DependentUpon>HistoryDialog.cs</DependentUpon>
146
+    </Compile>
141 147
     <Compile Include="excel\ExcelHelper.cs" />
142 148
     <Compile Include="form\ItemEditorForm.cs">
143 149
       <SubType>Form</SubType>
@@ -157,16 +163,20 @@
157 163
     <Compile Include="MainForm.Designer.cs">
158 164
       <DependentUpon>MainForm.cs</DependentUpon>
159 165
     </Compile>
166
+    <Compile Include="model\HisBean.cs" />
160 167
     <Compile Include="netty\NettyClient.cs" />
161 168
     <Compile Include="Program.cs" />
162 169
     <Compile Include="Properties\AssemblyInfo.cs" />
163 170
     <Compile Include="util\AryUtil.cs" />
164 171
     <Compile Include="util\CheckUtil.cs" />
165 172
     <Compile Include="util\CmdUtil.cs" />
166
-    <Compile Include="WvBean.cs" />
173
+    <Compile Include="model\WvBean.cs" />
167 174
     <EmbeddedResource Include="dialog\HeartBeatTime.resx">
168 175
       <DependentUpon>HeartBeatTime.cs</DependentUpon>
169 176
     </EmbeddedResource>
177
+    <EmbeddedResource Include="dialog\HistoryDialog.resx">
178
+      <DependentUpon>HistoryDialog.cs</DependentUpon>
179
+    </EmbeddedResource>
170 180
     <EmbeddedResource Include="form\ItemEditorForm.resx">
171 181
       <DependentUpon>ItemEditorForm.cs</DependentUpon>
172 182
     </EmbeddedResource>

+ 112 - 108
DotNettyFrom/MainForm.Designer.cs View File

@@ -30,6 +30,14 @@
30 30
         {
31 31
             this.components = new System.ComponentModel.Container();
32 32
             this.LBLogShow = new System.Windows.Forms.ListBox();
33
+            this.ListBoxLogContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
34
+            this.LB_Context_CpCmd = new System.Windows.Forms.ToolStripMenuItem();
35
+            this.LB_Context_CpLine = new System.Windows.Forms.ToolStripMenuItem();
36
+            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
37
+            this.LB_Context_GJson = new System.Windows.Forms.ToolStripMenuItem();
38
+            this.LB_Context_AnaCmd = new System.Windows.Forms.ToolStripMenuItem();
39
+            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
40
+            this.LB_Context_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
33 41
             this.TbHost = new System.Windows.Forms.TextBox();
34 42
             this.TbPort = new System.Windows.Forms.TextBox();
35 43
             this.BtnConnection = new System.Windows.Forms.Button();
@@ -51,6 +59,9 @@
51 59
             this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
52 60
             this.StatusItemHbTime = new System.Windows.Forms.ToolStripStatusLabel();
53 61
             this.groupBox1 = new System.Windows.Forms.GroupBox();
62
+            this.BtnClearAll = new System.Windows.Forms.Button();
63
+            this.TbSendData = new System.Windows.Forms.TextBox();
64
+            this.label5 = new System.Windows.Forms.Label();
54 65
             this.BtnTest = new System.Windows.Forms.Button();
55 66
             this.BtnCmdManager = new System.Windows.Forms.Button();
56 67
             this.label4 = new System.Windows.Forms.Label();
@@ -59,21 +70,10 @@
59 70
             this.TbDeviceId = new System.Windows.Forms.TextBox();
60 71
             this.label2 = new System.Windows.Forms.Label();
61 72
             this.label1 = new System.Windows.Forms.Label();
62
-            this.label5 = new System.Windows.Forms.Label();
63
-            this.TbSendData = new System.Windows.Forms.TextBox();
64
-            this.ListBoxLogContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
65
-            this.LB_Context_CpCmd = new System.Windows.Forms.ToolStripMenuItem();
66
-            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
67
-            this.LB_Context_GJson = new System.Windows.Forms.ToolStripMenuItem();
68
-            this.LB_Context_AnaCmd = new System.Windows.Forms.ToolStripMenuItem();
69
-            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
70
-            this.LB_Context_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
71
-            this.LB_Context_CpLine = new System.Windows.Forms.ToolStripMenuItem();
72
-            this.BtnClearAll = new System.Windows.Forms.Button();
73
+            this.ListBoxLogContextMenu.SuspendLayout();
73 74
             this.menuStrip1.SuspendLayout();
74 75
             this.statusStrip1.SuspendLayout();
75 76
             this.groupBox1.SuspendLayout();
76
-            this.ListBoxLogContextMenu.SuspendLayout();
77 77
             this.SuspendLayout();
78 78
             // 
79 79
             // LBLogShow
@@ -94,6 +94,64 @@
94 94
             this.LBLogShow.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.LBLogShow_DrawItem);
95 95
             this.LBLogShow.DoubleClick += new System.EventHandler(this.LBLogShow_DoubleClick);
96 96
             // 
97
+            // ListBoxLogContextMenu
98
+            // 
99
+            this.ListBoxLogContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
100
+            this.LB_Context_CpCmd,
101
+            this.LB_Context_CpLine,
102
+            this.toolStripSeparator3,
103
+            this.LB_Context_GJson,
104
+            this.LB_Context_AnaCmd,
105
+            this.toolStripSeparator4,
106
+            this.LB_Context_ClearAll});
107
+            this.ListBoxLogContextMenu.Name = "ListBoxLogContextMenu";
108
+            this.ListBoxLogContextMenu.Size = new System.Drawing.Size(170, 126);
109
+            // 
110
+            // LB_Context_CpCmd
111
+            // 
112
+            this.LB_Context_CpCmd.Name = "LB_Context_CpCmd";
113
+            this.LB_Context_CpCmd.Size = new System.Drawing.Size(169, 22);
114
+            this.LB_Context_CpCmd.Text = "复制指令(&C)";
115
+            this.LB_Context_CpCmd.Click += new System.EventHandler(this.LB_Context_CpCmd_Click);
116
+            // 
117
+            // LB_Context_CpLine
118
+            // 
119
+            this.LB_Context_CpLine.Name = "LB_Context_CpLine";
120
+            this.LB_Context_CpLine.Size = new System.Drawing.Size(169, 22);
121
+            this.LB_Context_CpLine.Text = "复制整行(&R)";
122
+            this.LB_Context_CpLine.Click += new System.EventHandler(this.LB_Context_CpLine_Click);
123
+            // 
124
+            // toolStripSeparator3
125
+            // 
126
+            this.toolStripSeparator3.Name = "toolStripSeparator3";
127
+            this.toolStripSeparator3.Size = new System.Drawing.Size(166, 6);
128
+            // 
129
+            // LB_Context_GJson
130
+            // 
131
+            this.LB_Context_GJson.Name = "LB_Context_GJson";
132
+            this.LB_Context_GJson.Size = new System.Drawing.Size(169, 22);
133
+            this.LB_Context_GJson.Text = "指令生成JSON(&J)";
134
+            this.LB_Context_GJson.Click += new System.EventHandler(this.LB_Context_GJson_Click);
135
+            // 
136
+            // LB_Context_AnaCmd
137
+            // 
138
+            this.LB_Context_AnaCmd.Name = "LB_Context_AnaCmd";
139
+            this.LB_Context_AnaCmd.Size = new System.Drawing.Size(169, 22);
140
+            this.LB_Context_AnaCmd.Text = "分析指令(&A)";
141
+            this.LB_Context_AnaCmd.Click += new System.EventHandler(this.LB_Context_AnaCmd_Click);
142
+            // 
143
+            // toolStripSeparator4
144
+            // 
145
+            this.toolStripSeparator4.Name = "toolStripSeparator4";
146
+            this.toolStripSeparator4.Size = new System.Drawing.Size(166, 6);
147
+            // 
148
+            // LB_Context_ClearAll
149
+            // 
150
+            this.LB_Context_ClearAll.Name = "LB_Context_ClearAll";
151
+            this.LB_Context_ClearAll.Size = new System.Drawing.Size(169, 22);
152
+            this.LB_Context_ClearAll.Text = "清空信息(&L)";
153
+            this.LB_Context_ClearAll.Click += new System.EventHandler(this.LB_Context_ClearAll_Click);
154
+            // 
97 155
             // TbHost
98 156
             // 
99 157
             this.TbHost.Location = new System.Drawing.Point(47, 15);
@@ -214,31 +272,35 @@
214 272
             // RT_HI_Host
215 273
             // 
216 274
             this.RT_HI_Host.Name = "RT_HI_Host";
217
-            this.RT_HI_Host.Size = new System.Drawing.Size(124, 22);
275
+            this.RT_HI_Host.Size = new System.Drawing.Size(152, 22);
218 276
             this.RT_HI_Host.Text = "Host";
277
+            this.RT_HI_Host.Click += new System.EventHandler(this.RT_HI_Host_Click);
219 278
             // 
220 279
             // RT_HI_DeviceId
221 280
             // 
222 281
             this.RT_HI_DeviceId.Name = "RT_HI_DeviceId";
223
-            this.RT_HI_DeviceId.Size = new System.Drawing.Size(124, 22);
282
+            this.RT_HI_DeviceId.Size = new System.Drawing.Size(152, 22);
224 283
             this.RT_HI_DeviceId.Text = "地址";
284
+            this.RT_HI_DeviceId.Click += new System.EventHandler(this.RT_HI_DeviceId_Click);
225 285
             // 
226 286
             // RT_HI_CCID
227 287
             // 
228 288
             this.RT_HI_CCID.Name = "RT_HI_CCID";
229
-            this.RT_HI_CCID.Size = new System.Drawing.Size(124, 22);
289
+            this.RT_HI_CCID.Size = new System.Drawing.Size(152, 22);
230 290
             this.RT_HI_CCID.Text = "CCID";
291
+            this.RT_HI_CCID.Click += new System.EventHandler(this.RT_HI_CCID_Click);
231 292
             // 
232 293
             // toolStripSeparator2
233 294
             // 
234 295
             this.toolStripSeparator2.Name = "toolStripSeparator2";
235
-            this.toolStripSeparator2.Size = new System.Drawing.Size(121, 6);
296
+            this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
236 297
             // 
237 298
             // RT_HI_SendData
238 299
             // 
239 300
             this.RT_HI_SendData.Name = "RT_HI_SendData";
240
-            this.RT_HI_SendData.Size = new System.Drawing.Size(124, 22);
301
+            this.RT_HI_SendData.Size = new System.Drawing.Size(152, 22);
241 302
             this.RT_HI_SendData.Text = "发送数据";
303
+            this.RT_HI_SendData.Click += new System.EventHandler(this.RT_HI_SendData_Click);
242 304
             // 
243 305
             // statusStrip1
244 306
             // 
@@ -291,6 +353,38 @@
291 353
             this.groupBox1.TabStop = false;
292 354
             this.groupBox1.Text = " ";
293 355
             // 
356
+            // BtnClearAll
357
+            // 
358
+            this.BtnClearAll.Location = new System.Drawing.Point(564, 45);
359
+            this.BtnClearAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
360
+            this.BtnClearAll.Name = "BtnClearAll";
361
+            this.BtnClearAll.Size = new System.Drawing.Size(87, 31);
362
+            this.BtnClearAll.TabIndex = 11;
363
+            this.BtnClearAll.Text = "清空信息";
364
+            this.BtnClearAll.UseVisualStyleBackColor = true;
365
+            this.BtnClearAll.Click += new System.EventHandler(this.BtnClearAll_Click);
366
+            // 
367
+            // TbSendData
368
+            // 
369
+            this.TbSendData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
370
+            | System.Windows.Forms.AnchorStyles.Right)));
371
+            this.TbSendData.Location = new System.Drawing.Point(381, 83);
372
+            this.TbSendData.Name = "TbSendData";
373
+            this.TbSendData.Size = new System.Drawing.Size(574, 22);
374
+            this.TbSendData.TabIndex = 10;
375
+            this.TbSendData.Text = "7e7e7e000000000001b00056020004071008011709221059290200000217092210592900000003170" +
376
+    "92210592902000004170922105929020000051709221059290001160617092210592900012f07170" +
377
+    "92210592902000008170922105929020000cd";
378
+            // 
379
+            // label5
380
+            // 
381
+            this.label5.AutoSize = true;
382
+            this.label5.Location = new System.Drawing.Point(319, 86);
383
+            this.label5.Name = "label5";
384
+            this.label5.Size = new System.Drawing.Size(56, 17);
385
+            this.label5.TabIndex = 9;
386
+            this.label5.Text = "发送数据";
387
+            // 
294 388
             // BtnTest
295 389
             // 
296 390
             this.BtnTest.Location = new System.Drawing.Point(471, 45);
@@ -368,96 +462,6 @@
368 462
             this.label1.TabIndex = 2;
369 463
             this.label1.Text = "Host";
370 464
             // 
371
-            // label5
372
-            // 
373
-            this.label5.AutoSize = true;
374
-            this.label5.Location = new System.Drawing.Point(319, 86);
375
-            this.label5.Name = "label5";
376
-            this.label5.Size = new System.Drawing.Size(56, 17);
377
-            this.label5.TabIndex = 9;
378
-            this.label5.Text = "发送数据";
379
-            // 
380
-            // TbSendData
381
-            // 
382
-            this.TbSendData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
383
-            | System.Windows.Forms.AnchorStyles.Right)));
384
-            this.TbSendData.Location = new System.Drawing.Point(381, 83);
385
-            this.TbSendData.Name = "TbSendData";
386
-            this.TbSendData.Size = new System.Drawing.Size(574, 22);
387
-            this.TbSendData.TabIndex = 10;
388
-            this.TbSendData.Text = "7e7e7e000000000001b00056020004071008011709221059290200000217092210592900000003170" +
389
-    "92210592902000004170922105929020000051709221059290001160617092210592900012f07170" +
390
-    "92210592902000008170922105929020000cd";
391
-            // 
392
-            // ListBoxLogContextMenu
393
-            // 
394
-            this.ListBoxLogContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
395
-            this.LB_Context_CpCmd,
396
-            this.LB_Context_CpLine,
397
-            this.toolStripSeparator3,
398
-            this.LB_Context_GJson,
399
-            this.LB_Context_AnaCmd,
400
-            this.toolStripSeparator4,
401
-            this.LB_Context_ClearAll});
402
-            this.ListBoxLogContextMenu.Name = "ListBoxLogContextMenu";
403
-            this.ListBoxLogContextMenu.Size = new System.Drawing.Size(170, 126);
404
-            // 
405
-            // LB_Context_CpCmd
406
-            // 
407
-            this.LB_Context_CpCmd.Name = "LB_Context_CpCmd";
408
-            this.LB_Context_CpCmd.Size = new System.Drawing.Size(169, 22);
409
-            this.LB_Context_CpCmd.Text = "复制指令(&C)";
410
-            this.LB_Context_CpCmd.Click += new System.EventHandler(this.LB_Context_CpCmd_Click);
411
-            // 
412
-            // toolStripSeparator3
413
-            // 
414
-            this.toolStripSeparator3.Name = "toolStripSeparator3";
415
-            this.toolStripSeparator3.Size = new System.Drawing.Size(166, 6);
416
-            // 
417
-            // LB_Context_GJson
418
-            // 
419
-            this.LB_Context_GJson.Name = "LB_Context_GJson";
420
-            this.LB_Context_GJson.Size = new System.Drawing.Size(169, 22);
421
-            this.LB_Context_GJson.Text = "指令生成JSON(&J)";
422
-            this.LB_Context_GJson.Click += new System.EventHandler(this.LB_Context_GJson_Click);
423
-            // 
424
-            // LB_Context_AnaCmd
425
-            // 
426
-            this.LB_Context_AnaCmd.Name = "LB_Context_AnaCmd";
427
-            this.LB_Context_AnaCmd.Size = new System.Drawing.Size(169, 22);
428
-            this.LB_Context_AnaCmd.Text = "分析指令(&A)";
429
-            this.LB_Context_AnaCmd.Click += new System.EventHandler(this.LB_Context_AnaCmd_Click);
430
-            // 
431
-            // toolStripSeparator4
432
-            // 
433
-            this.toolStripSeparator4.Name = "toolStripSeparator4";
434
-            this.toolStripSeparator4.Size = new System.Drawing.Size(166, 6);
435
-            // 
436
-            // LB_Context_ClearAll
437
-            // 
438
-            this.LB_Context_ClearAll.Name = "LB_Context_ClearAll";
439
-            this.LB_Context_ClearAll.Size = new System.Drawing.Size(169, 22);
440
-            this.LB_Context_ClearAll.Text = "清空信息(&L)";
441
-            this.LB_Context_ClearAll.Click += new System.EventHandler(this.LB_Context_ClearAll_Click);
442
-            // 
443
-            // LB_Context_CpLine
444
-            // 
445
-            this.LB_Context_CpLine.Name = "LB_Context_CpLine";
446
-            this.LB_Context_CpLine.Size = new System.Drawing.Size(169, 22);
447
-            this.LB_Context_CpLine.Text = "复制整行(&R)";
448
-            this.LB_Context_CpLine.Click += new System.EventHandler(this.LB_Context_CpLine_Click);
449
-            // 
450
-            // BtnClearAll
451
-            // 
452
-            this.BtnClearAll.Location = new System.Drawing.Point(564, 45);
453
-            this.BtnClearAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
454
-            this.BtnClearAll.Name = "BtnClearAll";
455
-            this.BtnClearAll.Size = new System.Drawing.Size(87, 31);
456
-            this.BtnClearAll.TabIndex = 11;
457
-            this.BtnClearAll.Text = "清空信息";
458
-            this.BtnClearAll.UseVisualStyleBackColor = true;
459
-            this.BtnClearAll.Click += new System.EventHandler(this.BtnClearAll_Click);
460
-            // 
461 465
             // MainForm
462 466
             // 
463 467
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
@@ -475,13 +479,13 @@
475 479
             this.Text = "模拟器";
476 480
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
477 481
             this.Load += new System.EventHandler(this.MainForm_Load);
482
+            this.ListBoxLogContextMenu.ResumeLayout(false);
478 483
             this.menuStrip1.ResumeLayout(false);
479 484
             this.menuStrip1.PerformLayout();
480 485
             this.statusStrip1.ResumeLayout(false);
481 486
             this.statusStrip1.PerformLayout();
482 487
             this.groupBox1.ResumeLayout(false);
483 488
             this.groupBox1.PerformLayout();
484
-            this.ListBoxLogContextMenu.ResumeLayout(false);
485 489
             this.ResumeLayout(false);
486 490
             this.PerformLayout();
487 491
 

+ 34 - 3
DotNettyFrom/MainForm.cs View File

@@ -43,7 +43,7 @@ namespace DotNettyFrom
43 43
             }
44 44
 
45 45
             DbHelper.Init();
46
-            
46
+
47 47
 
48 48
 //            DBHelper.ConnectionAccessDb();
49 49
 
@@ -203,6 +203,39 @@ namespace DotNettyFrom
203 203
             imf.ShowDialog();
204 204
         }
205 205
 
206
+
207
+        private void RT_HI_Host_Click(object sender, EventArgs e)
208
+        {
209
+            HistoryDialog hd = new HistoryDialog(SystemConfig.IpHisType);
210
+            hd.HistoryHandler += Hd_HistoryHandler;
211
+            hd.ShowDialog();
212
+        }
213
+
214
+        private void RT_HI_DeviceId_Click(object sender, EventArgs e)
215
+        {
216
+            HistoryDialog hd = new HistoryDialog(SystemConfig.AddrHisType);
217
+            hd.HistoryHandler += Hd_HistoryHandler;
218
+            hd.ShowDialog();
219
+        }
220
+
221
+        private void RT_HI_CCID_Click(object sender, EventArgs e)
222
+        {
223
+            HistoryDialog hd = new HistoryDialog(SystemConfig.CcidHisType);
224
+            hd.HistoryHandler += Hd_HistoryHandler;
225
+            hd.ShowDialog();
226
+        }
227
+
228
+        private void RT_HI_SendData_Click(object sender, EventArgs e)
229
+        {
230
+            HistoryDialog hd = new HistoryDialog(SystemConfig.SendHisType);
231
+            hd.HistoryHandler += Hd_HistoryHandler;
232
+            hd.ShowDialog();
233
+        }
234
+
235
+        private void Hd_HistoryHandler(string type, string result)
236
+        {
237
+        }
238
+
206 239
         #endregion
207 240
 
208 241
         #region ListBox
@@ -301,7 +334,5 @@ namespace DotNettyFrom
301 334
         private void LB_Context_ClearAll_Click(object sender, EventArgs e) => LBLogShow.Items.Clear();
302 335
 
303 336
         #endregion
304
-
305
-       
306 337
     }
307 338
 }

+ 0 - 3
DotNettyFrom/config/DBConfig.cs View File

@@ -14,11 +14,8 @@ namespace DotNettyFrom.config
14 14
         public const string ConnStr = "Provider = Microsoft.ACE.OLEDB.12.0;Data Source = ";
15 15
 
16 16
 
17
-        public const string CmdFw = "fw";
18
-
19 17
         //历史表
20 18
         public const string IpHis = "ip_his";
21
-
22 19
         public const string SendHis = "send_his";
23 20
         public const string CcidHis = "ccid_his";
24 21
         public const string AddrHis = "addr_his";

+ 7 - 0
DotNettyFrom/config/SystemConfig.cs View File

@@ -29,5 +29,12 @@ namespace DotNettyFrom.config
29 29
         public static int RecType = 0;
30 30
         public static int DebugType = -1;
31 31
         public static int ReplyType = 2;
32
+
33
+
34
+        public const int IpHisType = 1;
35
+        public const int AddrHisType = 2;
36
+        public const int SendHisType = 3;
37
+        public const int CcidHisType = 4;
38
+
32 39
     }
33 40
 }

+ 102 - 3
DotNettyFrom/db/DBHelper.cs View File

@@ -8,6 +8,7 @@ using System.Text;
8 8
 using System.Threading.Tasks;
9 9
 using System.Windows.Forms;
10 10
 using DotNettyFrom.config;
11
+using DotNettyFrom.model;
11 12
 using DotNettyFrom.util;
12 13
 
13 14
 namespace DotNettyFrom.db
@@ -88,6 +89,35 @@ namespace DotNettyFrom.db
88 89
             }
89 90
         }
90 91
 
92
+        public int InsertHistory(int _type, string his_data)
93
+        {
94
+            string tableName = "";
95
+            switch (_type)
96
+            {
97
+                case SystemConfig.IpHisType:
98
+                    tableName = DBConfig.IpHis;
99
+                    break;
100
+                case SystemConfig.AddrHisType:
101
+                    tableName = DBConfig.AddrHis;
102
+                    break;
103
+                case SystemConfig.CcidHisType:
104
+                    tableName = DBConfig.CcidHis;
105
+                    break;
106
+                case SystemConfig.SendHisType:
107
+                    tableName = DBConfig.SendHis;
108
+                    break;
109
+                default:
110
+                    return -1;
111
+            }
112
+
113
+            string sql = "insert into " + tableName + "(i_date,his_data) values('" + DateTime.Now + "','" + his_data +
114
+                         "')";
115
+            using (OleDbCommand inst = new OleDbCommand(sql, _DbConn))
116
+            {
117
+                return inst.ExecuteNonQuery();
118
+            }
119
+        }
120
+
91 121
         //Delete
92 122
         public int DeleteCmdById(int id)
93 123
         {
@@ -107,6 +137,60 @@ namespace DotNettyFrom.db
107 137
             }
108 138
         }
109 139
 
140
+        public int DeleteHistoryById(int _type, int id)
141
+        {
142
+            string tableName;
143
+            switch (_type)
144
+            {
145
+                case SystemConfig.IpHisType:
146
+                    tableName = DBConfig.IpHis;
147
+                    break;
148
+                case SystemConfig.AddrHisType:
149
+                    tableName = DBConfig.AddrHis;
150
+                    break;
151
+                case SystemConfig.CcidHisType:
152
+                    tableName = DBConfig.CcidHis;
153
+                    break;
154
+                case SystemConfig.SendHisType:
155
+                    tableName = DBConfig.SendHis;
156
+                    break;
157
+                default:
158
+                    return -1;
159
+            }
160
+            string sql = @"delete from " + tableName + " where ID=" + id;
161
+            using (OleDbCommand inst = new OleDbCommand(sql, _DbConn))
162
+            {
163
+                return inst.ExecuteNonQuery();
164
+            }
165
+        }
166
+
167
+        public int DeleteAllHistory(int _type)
168
+        {
169
+            string tableName;
170
+            switch (_type)
171
+            {
172
+                case SystemConfig.IpHisType:
173
+                    tableName = DBConfig.IpHis;
174
+                    break;
175
+                case SystemConfig.AddrHisType:
176
+                    tableName = DBConfig.AddrHis;
177
+                    break;
178
+                case SystemConfig.CcidHisType:
179
+                    tableName = DBConfig.CcidHis;
180
+                    break;
181
+                case SystemConfig.SendHisType:
182
+                    tableName = DBConfig.SendHis;
183
+                    break;
184
+                default:
185
+                    return -1;
186
+            }
187
+            string sql = @"delete from " + tableName;
188
+            using (OleDbCommand inst = new OleDbCommand(sql, _DbConn))
189
+            {
190
+                return inst.ExecuteNonQuery();
191
+            }
192
+        }
193
+
110 194
         //Update
111 195
         public int UpdateCmd(WvBean wb)
112 196
         {
@@ -140,7 +224,12 @@ namespace DotNettyFrom.db
140 224
                 {
141 225
                     while (reader.Read()) //这个read调用很重要!不写的话运行时将提示找不到数据  
142 226
                     {
143
-                        WvBean wb = new WvBean();
227
+                        var myId = reader.GetString(2);
228
+                        var userValue = CheckUtil.StringIsEmpty(reader.GetString(8));
229
+                        if (!_idInfo.ContainsKey(myId))
230
+                            _idInfo.Add(myId, userValue);
231
+
232
+                        /*WvBean wb = new WvBean();
144 233
                         int id = 0;
145 234
                         int index = 0;
146 235
                         var myId = "";
@@ -175,7 +264,7 @@ namespace DotNettyFrom.db
175 264
                         wb.remark = remark;
176 265
 
177 266
                         if (!_idInfo.ContainsKey(myId))
178
-                            _idInfo.Add(myId, userValue);
267
+                            _idInfo.Add(myId, userValue);*/
179 268
                     }
180 269
                 }
181 270
             }
@@ -234,6 +323,16 @@ namespace DotNettyFrom.db
234 323
             return wb;
235 324
         }
236 325
 
237
-       
326
+        public DataTable SelectHistory(string sql)
327
+        {
328
+            DataTable dataTable = new DataTable();
329
+            using (OleDbCommand sqlcmd = new OleDbCommand(sql, _DbConn))
330
+            {
331
+                OleDbDataAdapter adapter = new OleDbDataAdapter(sqlcmd);
332
+                dataTable.Clear();
333
+                adapter.Fill(dataTable);
334
+            }
335
+            return dataTable;
336
+        }
238 337
     }
239 338
 }

+ 204 - 0
DotNettyFrom/dialog/HistoryDialog.Designer.cs View File

@@ -0,0 +1,204 @@
1
+namespace DotNettyFrom.dialog
2
+{
3
+    partial class HistoryDialog
4
+    {
5
+        /// <summary>
6
+        /// Required designer variable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Clean up any resources being used.
12
+        /// </summary>
13
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Windows Form Designer generated code
24
+
25
+        /// <summary>
26
+        /// Required method for Designer support - do not modify
27
+        /// the contents of this method with the code editor.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.components = new System.ComponentModel.Container();
32
+            this.DataGridViewHis = new System.Windows.Forms.DataGridView();
33
+            this.LbCCIDTran = new System.Windows.Forms.Label();
34
+            this.TbCCid = new System.Windows.Forms.TextBox();
35
+            this.BtnTran = new System.Windows.Forms.Button();
36
+            this.BtnCancle = new System.Windows.Forms.Button();
37
+            this.BtnRandom = new System.Windows.Forms.Button();
38
+            this.LbTagName = new System.Windows.Forms.Label();
39
+            this.NumCount = new System.Windows.Forms.NumericUpDown();
40
+            this.button1 = new System.Windows.Forms.Button();
41
+            this.ContextMenuStripHis = new System.Windows.Forms.ContextMenuStrip(this.components);
42
+            this.MenuItem_delete_line = new System.Windows.Forms.ToolStripMenuItem();
43
+            ((System.ComponentModel.ISupportInitialize)(this.DataGridViewHis)).BeginInit();
44
+            ((System.ComponentModel.ISupportInitialize)(this.NumCount)).BeginInit();
45
+            this.ContextMenuStripHis.SuspendLayout();
46
+            this.SuspendLayout();
47
+            // 
48
+            // DataGridViewHis
49
+            // 
50
+            this.DataGridViewHis.AllowUserToAddRows = false;
51
+            this.DataGridViewHis.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
52
+            this.DataGridViewHis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
53
+            this.DataGridViewHis.ContextMenuStrip = this.ContextMenuStripHis;
54
+            this.DataGridViewHis.Location = new System.Drawing.Point(12, 63);
55
+            this.DataGridViewHis.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
56
+            this.DataGridViewHis.MultiSelect = false;
57
+            this.DataGridViewHis.Name = "DataGridViewHis";
58
+            this.DataGridViewHis.ReadOnly = true;
59
+            this.DataGridViewHis.RowTemplate.Height = 23;
60
+            this.DataGridViewHis.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
61
+            this.DataGridViewHis.Size = new System.Drawing.Size(1013, 603);
62
+            this.DataGridViewHis.TabIndex = 0;
63
+            this.DataGridViewHis.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridViewHis_CellMouseClick);
64
+            this.DataGridViewHis.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridViewHis_CellMouseDoubleClick);
65
+            // 
66
+            // LbCCIDTran
67
+            // 
68
+            this.LbCCIDTran.AutoSize = true;
69
+            this.LbCCIDTran.Location = new System.Drawing.Point(12, 682);
70
+            this.LbCCIDTran.Name = "LbCCIDTran";
71
+            this.LbCCIDTran.Size = new System.Drawing.Size(61, 17);
72
+            this.LbCCIDTran.TabIndex = 1;
73
+            this.LbCCIDTran.Text = "CCID转换";
74
+            // 
75
+            // TbCCid
76
+            // 
77
+            this.TbCCid.Location = new System.Drawing.Point(79, 679);
78
+            this.TbCCid.Name = "TbCCid";
79
+            this.TbCCid.Size = new System.Drawing.Size(703, 23);
80
+            this.TbCCid.TabIndex = 2;
81
+            // 
82
+            // BtnTran
83
+            // 
84
+            this.BtnTran.Location = new System.Drawing.Point(788, 673);
85
+            this.BtnTran.Name = "BtnTran";
86
+            this.BtnTran.Size = new System.Drawing.Size(75, 34);
87
+            this.BtnTran.TabIndex = 3;
88
+            this.BtnTran.Text = "转换";
89
+            this.BtnTran.UseVisualStyleBackColor = true;
90
+            // 
91
+            // BtnCancle
92
+            // 
93
+            this.BtnCancle.DialogResult = System.Windows.Forms.DialogResult.Cancel;
94
+            this.BtnCancle.Location = new System.Drawing.Point(950, 673);
95
+            this.BtnCancle.Name = "BtnCancle";
96
+            this.BtnCancle.Size = new System.Drawing.Size(75, 34);
97
+            this.BtnCancle.TabIndex = 3;
98
+            this.BtnCancle.Text = "取消";
99
+            this.BtnCancle.UseVisualStyleBackColor = true;
100
+            // 
101
+            // BtnRandom
102
+            // 
103
+            this.BtnRandom.Location = new System.Drawing.Point(869, 673);
104
+            this.BtnRandom.Name = "BtnRandom";
105
+            this.BtnRandom.Size = new System.Drawing.Size(75, 34);
106
+            this.BtnRandom.TabIndex = 3;
107
+            this.BtnRandom.Text = "随机生成";
108
+            this.BtnRandom.UseVisualStyleBackColor = true;
109
+            // 
110
+            // LbTagName
111
+            // 
112
+            this.LbTagName.AutoSize = true;
113
+            this.LbTagName.Location = new System.Drawing.Point(12, 19);
114
+            this.LbTagName.Name = "LbTagName";
115
+            this.LbTagName.Size = new System.Drawing.Size(43, 17);
116
+            this.LbTagName.TabIndex = 4;
117
+            this.LbTagName.Text = "label1";
118
+            // 
119
+            // NumCount
120
+            // 
121
+            this.NumCount.Increment = new decimal(new int[] {
122
+            2,
123
+            0,
124
+            0,
125
+            0});
126
+            this.NumCount.Location = new System.Drawing.Point(92, 17);
127
+            this.NumCount.Name = "NumCount";
128
+            this.NumCount.Size = new System.Drawing.Size(120, 23);
129
+            this.NumCount.TabIndex = 5;
130
+            // 
131
+            // button1
132
+            // 
133
+            this.button1.Location = new System.Drawing.Point(707, 16);
134
+            this.button1.Name = "button1";
135
+            this.button1.Size = new System.Drawing.Size(75, 23);
136
+            this.button1.TabIndex = 6;
137
+            this.button1.Text = "button1";
138
+            this.button1.UseVisualStyleBackColor = true;
139
+            this.button1.Click += new System.EventHandler(this.button1_Click);
140
+            // 
141
+            // ContextMenuStripHis
142
+            // 
143
+            this.ContextMenuStripHis.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
144
+            this.MenuItem_delete_line});
145
+            this.ContextMenuStripHis.Name = "ContextMenuStripHis";
146
+            this.ContextMenuStripHis.Size = new System.Drawing.Size(153, 48);
147
+            // 
148
+            // MenuItem_delete_line
149
+            // 
150
+            this.MenuItem_delete_line.Name = "MenuItem_delete_line";
151
+            this.MenuItem_delete_line.Size = new System.Drawing.Size(152, 22);
152
+            this.MenuItem_delete_line.Text = "删除选中行(&R)";
153
+            this.MenuItem_delete_line.Click += new System.EventHandler(this.MenuItem_delete_line_Click);
154
+            // 
155
+            // HistoryDialog
156
+            // 
157
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
158
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
159
+            this.AutoSize = true;
160
+            this.CancelButton = this.BtnCancle;
161
+            this.ClientSize = new System.Drawing.Size(1037, 719);
162
+            this.Controls.Add(this.button1);
163
+            this.Controls.Add(this.NumCount);
164
+            this.Controls.Add(this.LbTagName);
165
+            this.Controls.Add(this.BtnRandom);
166
+            this.Controls.Add(this.BtnCancle);
167
+            this.Controls.Add(this.BtnTran);
168
+            this.Controls.Add(this.TbCCid);
169
+            this.Controls.Add(this.LbCCIDTran);
170
+            this.Controls.Add(this.DataGridViewHis);
171
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
172
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
173
+            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
174
+            this.MaximizeBox = false;
175
+            this.MinimizeBox = false;
176
+            this.Name = "HistoryDialog";
177
+            this.ShowIcon = false;
178
+            this.ShowInTaskbar = false;
179
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
180
+            this.Text = "历史记录";
181
+            this.Load += new System.EventHandler(this.HistoryDialog_Load);
182
+            ((System.ComponentModel.ISupportInitialize)(this.DataGridViewHis)).EndInit();
183
+            ((System.ComponentModel.ISupportInitialize)(this.NumCount)).EndInit();
184
+            this.ContextMenuStripHis.ResumeLayout(false);
185
+            this.ResumeLayout(false);
186
+            this.PerformLayout();
187
+
188
+        }
189
+
190
+        #endregion
191
+
192
+        private System.Windows.Forms.DataGridView DataGridViewHis;
193
+        private System.Windows.Forms.Label LbCCIDTran;
194
+        private System.Windows.Forms.TextBox TbCCid;
195
+        private System.Windows.Forms.Button BtnTran;
196
+        private System.Windows.Forms.Button BtnCancle;
197
+        private System.Windows.Forms.Button BtnRandom;
198
+        private System.Windows.Forms.Label LbTagName;
199
+        private System.Windows.Forms.NumericUpDown NumCount;
200
+        private System.Windows.Forms.Button button1;
201
+        private System.Windows.Forms.ContextMenuStrip ContextMenuStripHis;
202
+        private System.Windows.Forms.ToolStripMenuItem MenuItem_delete_line;
203
+    }
204
+}

+ 133 - 0
DotNettyFrom/dialog/HistoryDialog.cs View File

@@ -0,0 +1,133 @@
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.Net.Sockets;
8
+using System.Text;
9
+using System.Threading.Tasks;
10
+using System.Windows.Forms;
11
+using DotNettyFrom.config;
12
+using DotNettyFrom.db;
13
+
14
+namespace DotNettyFrom.dialog
15
+{
16
+    public delegate void OnHistoryResult(string type, string result);
17
+
18
+    public partial class HistoryDialog : Form
19
+    {
20
+        private int _type;
21
+        private string _tableName;
22
+        public event OnHistoryResult HistoryHandler;
23
+
24
+        private int _SelectIndex = -1;
25
+
26
+        public HistoryDialog(int type)
27
+        {
28
+            InitializeComponent();
29
+            this._type = type;
30
+        }
31
+
32
+        private void HistoryDialog_Load(object sender, EventArgs e)
33
+        {
34
+            switch (_type)
35
+            {
36
+                case SystemConfig.IpHisType:
37
+                    IpType();
38
+                    break;
39
+                case SystemConfig.AddrHisType:
40
+                    AddrType();
41
+                    break;
42
+                case SystemConfig.CcidHisType:
43
+                    CcidType();
44
+                    break;
45
+                case SystemConfig.SendHisType:
46
+                    SendType();
47
+                    break;
48
+                default:
49
+                    this.Close();
50
+                    break;
51
+            }
52
+
53
+            DataTable dt = DbHelper.GetInstance().SelectHistory(@"select * from " + _tableName + " order by ID desc");
54
+            DataGridViewHis.DataSource = dt;
55
+        }
56
+
57
+        private void SendType()
58
+        {
59
+            _tableName = DBConfig.SendHis;
60
+            Text = "发送数据 - 历史记录";
61
+            LbCCIDTran.Visible = false;
62
+            TbCCid.Visible = false;
63
+            BtnTran.Visible = false;
64
+            BtnRandom.Visible = false;
65
+            LbTagName.Visible = false;
66
+            NumCount.Visible = false;
67
+        }
68
+
69
+        private void CcidType()
70
+        {
71
+            _tableName = DBConfig.CcidHis;
72
+            Text = "CCID - 历史记录";
73
+            LbTagName.Text = "CCID长度:";
74
+            NumCount.Value = 40;
75
+        }
76
+
77
+        private void AddrType()
78
+        {
79
+            _tableName = DBConfig.AddrHis;
80
+            Text = "设备地址 - 历史记录";
81
+            LbTagName.Text = "设备地址长度:";
82
+            NumCount.Value = 12;
83
+
84
+            LbCCIDTran.Visible = false;
85
+            TbCCid.Visible = false;
86
+            BtnTran.Visible = false;
87
+        }
88
+
89
+        private void IpType()
90
+        {
91
+            _tableName = DBConfig.IpHis;
92
+            Text = "IP - 历史记录";
93
+
94
+            LbCCIDTran.Visible = false;
95
+            TbCCid.Visible = false;
96
+            BtnTran.Visible = false;
97
+            BtnRandom.Visible = false;
98
+            LbTagName.Visible = false;
99
+            NumCount.Visible = false;
100
+        }
101
+
102
+        private void button1_Click(object sender, EventArgs e)
103
+        {
104
+//            DbHelper.GetInstance().InsertHistory(_type, "aaaaaaaaaaaaaaa");
105
+//            DbHelper.GetInstance().DeleteHistoryById(_type, 26);
106
+//            DbHelper.GetInstance().DeleteAllHistory(_type);
107
+        }
108
+
109
+        private void DataGridViewHis_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
110
+        {
111
+        }
112
+
113
+        private void DataGridViewHis_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
114
+        {
115
+            if (e.Button == MouseButtons.Left)
116
+            {
117
+                _SelectIndex = e.RowIndex;
118
+            }
119
+        }
120
+
121
+        private void MenuItem_delete_line_Click(object sender, EventArgs e)
122
+        {
123
+            int row = DataGridViewHis.RowCount;
124
+            if (_SelectIndex >= 0 && _SelectIndex < row)
125
+            {
126
+                object value = DataGridViewHis[0, _SelectIndex].Value;
127
+                DbHelper.GetInstance().DeleteHistoryById(_type, int.Parse(value.ToString()));
128
+                DataTable dt = DbHelper.GetInstance().SelectHistory(@"select * from " + _tableName + " order by ID desc");
129
+                DataGridViewHis.DataSource = dt;
130
+            }
131
+        }
132
+    }
133
+}

+ 123 - 0
DotNettyFrom/dialog/HistoryDialog.resx View File

@@ -0,0 +1,123 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="ContextMenuStripHis.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
123
+</root>

+ 1 - 0
DotNettyFrom/excel/ExcelHelper.cs View File

@@ -6,6 +6,7 @@ using System.Linq;
6 6
 using System.Text;
7 7
 using System.Threading.Tasks;
8 8
 using System.Windows.Forms;
9
+using DotNettyFrom.model;
9 10
 using DotNettyFrom.util;
10 11
 
11 12
 namespace DotNettyFrom.excel

+ 1 - 0
DotNettyFrom/form/ItemEditorForm.cs View File

@@ -8,6 +8,7 @@ using System.Text;
8 8
 using System.Threading.Tasks;
9 9
 using System.Windows.Forms;
10 10
 using DotNettyFrom.db;
11
+using DotNettyFrom.model;
11 12
 using DotNettyFrom.util;
12 13
 
13 14
 namespace DotNettyFrom.form

+ 1 - 0
DotNettyFrom/form/ItemManagerForm.cs View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
9 9
 using System.Windows.Forms;
10 10
 using DotNettyFrom.db;
11 11
 using DotNettyFrom.excel;
12
+using DotNettyFrom.model;
12 13
 
13 14
 namespace DotNettyFrom.form
14 15
 {

+ 15 - 0
DotNettyFrom/model/HisBean.cs View File

@@ -0,0 +1,15 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace DotNettyFrom.model
8
+{
9
+    public class HisBean
10
+    {
11
+        public int ID;
12
+        public string data;
13
+        public DateTime IDate;
14
+    }
15
+}

DotNettyFrom/WvBean.cs → DotNettyFrom/model/WvBean.cs View File

@@ -4,7 +4,7 @@ using System.Linq;
4 4
 using System.Text;
5 5
 using System.Threading.Tasks;
6 6
 
7
-namespace DotNettyFrom
7
+namespace DotNettyFrom.model
8 8
 {
9 9
     public class WvBean
10 10
     {