-
Notifications
You must be signed in to change notification settings - Fork 0
/
PIPELine.cs
594 lines (512 loc) · 24.8 KB
/
PIPELine.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Geometry;
using HR.Data;
using System.Data;
using Autodesk.AutoCAD.Interop.Common;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Data.SQLite;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
namespace CHXQ.XMManager
{
/// <summary>
/// 圆管
/// </summary>
public interface IPIPELine : IPipeData
{
/// <summary>
/// 上游点编码
/// </summary>
string US_OBJECT_ID { get; set; }
/// <summary>
/// 下游点编码
/// </summary>
string DS_OBJECT_ID { get; set; }
/// <summary>
/// 管径
/// </summary>
string Width { get; set; }
/// <summary>
/// 管长
/// </summary>
string Pipe_Length { get; set; }
/// <summary>
/// 上游井底高程(m)
/// </summary>
string US_POINT_INVERT_LEVEL { get; set; }
/// <summary>
/// 下游井底高程(m)
/// </summary>
string DS_POINT_INVERT_LEVEL { get; set; }
/// <summary>
/// 上游管底高程(m)
/// </summary>
string US_INVERT_LEVEL { get; set; }
/// <summary>
/// 下游管底高程(m)
/// </summary>
string DS_INVERT_LEVEL { get; set; }
/// <summary>
/// 淤积深度
/// </summary>
string SEDIMENT_DEPTH { get; set; }
/// <summary>
/// 材质
/// </summary>
string MATERIAL { get; set; }
/// <summary>
/// 上游点号
/// </summary>
string US_SURVEY_ID { get; set; }
/// <summary>
/// 下游点号
/// </summary>
string DS_SURVEY_ID { get; set; }
/// <summary>
/// 管道形式
/// </summary>
string PRESSURE { get; set; }
/// <summary>
/// 水质状况
/// </summary>
string WATER_QUALITY
{
get;
set;
}
/// <summary>
/// 水体状态
/// </summary>
string WATER_State
{
get;
set;
}
string Lenght { get; set; }
/// <summary>
/// 水位
/// </summary>
string WATER_LEVEL
{
get;
set;
}
string Dirtcion { get; set; }
bool isExistSURVEY_ID(string SPointID, string EPointID);
}
public class PIPELineClass : PipeData, IPIPELine
{
public override IPipeData GetDataByID(string ID)
{
string sql = string.Format("select * from PS_PIPE where ID='{0}'", ID);
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
System.Data.DataTable pTable = pDataBase.ExecuteQuery(sql).Tables[0];
if (pTable.Rows.Count == 0) return null;
IPIPELine pPCPoint = new PIPELineClass();
pPCPoint.FillValueByRow(pTable.Rows[0]);
return pPCPoint;
}
/// <summary>
/// 水质状况
/// </summary>
public string WATER_QUALITY
{
get;
set;
}
public override void DeleteCADObject(Autodesk.AutoCAD.ApplicationServices.Document doc)
{
string[] Layers = null;
if (this.US_SURVEY_ID.StartsWith("WS"))
Layers = new string[] { "WSLine", "WSZJ" };
else
Layers = new string[] { "YSLine", "YSZJ" };
Autodesk.AutoCAD.Interop.AcadDocument AcadDoc = doc.AcadDocument as Autodesk.AutoCAD.Interop.AcadDocument;
Editor ed = doc.Editor;
int count = 0;
foreach (string Layer in Layers)
{
TypedValue[] tvs = new TypedValue[]
{
new TypedValue((int)DxfCode.LayerName,Layer)
};
SelectionFilter sf = new SelectionFilter(tvs);
PromptSelectionResult psr = ed.SelectAll(sf);
if (psr.Status == PromptStatus.OK)
{
SelectionSet SS = psr.Value;
ObjectId[] idArray = SS.GetObjectIds();
for (int i = 0; i < idArray.Length; i++)
{
if (this is IPipePoint && count == 2)
{
break;
}
else if (this is IPIPELine && count == 3)
break;
//Entity ent = (Entity)Tools.GetDBObject(idArray[i]);
AcadEntity pAcadEntity = AcadDoc.ObjectIdToObject(idArray[i].OldIdPtr.ToInt64()) as AcadEntity;
string ObjectID = GetPointObjectID(pAcadEntity);
if (ObjectID.Equals(this.ID))
{
pAcadEntity.Delete();
count++;
}
}
}
}
AcadDoc.Save();
}
/// <summary>
/// 水体状态
/// </summary>
public string WATER_State
{
get;
set;
}
public bool isExistSURVEY_ID(string SPointID, string EPointID)
{
string sql = string.Format("select 1 from {0} where US_SURVEY_ID='{1}' and DS_SURVEY_ID='{2}'",ClassName, SPointID, EPointID);
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
System.Data.DataTable pTable = pDataBase.ExecuteQuery(sql).Tables[0];
return pTable.Rows.Count != 0;
}
public string Dirtcion { get; set; }
public override string[] Verification()
{
List<string> ErrorItems = new List<string>();
string USPointID = this.US_SURVEY_ID;
string DsPintID = this.DS_SURVEY_ID;
if (IsExistID(this.US_SURVEY_ID,this.DS_SURVEY_ID))
{
ErrorItems.Add("库中已存在相同起止点编号的数据");
}
return ErrorItems.ToArray();
}
protected IPCPoint GetPointByID(string ObjectID)
{
string sql = string.Format("select * from Points where SURVEY_ID='{0}'", ObjectID);
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
System.Data.DataTable pTable = pDataBase.ExecuteQuery(sql).Tables[0];
if (pTable.Rows.Count > 0)
{
//double X = double.Parse(pTable.Rows[0]["CO_X"].ToString());
//double Y = double.Parse(pTable.Rows[0]["CO_Y"].ToString());
IPCPoint pPCPoint = new PCPoint();
pPCPoint.FillValueByRow(pTable.Rows[0]);
return pPCPoint;
}
else
return null;
}
public override void DrawCADObject(Autodesk.AutoCAD.Interop.AcadDocument AcadDoc)
{
string Linetype = "合流";
int LayerID = GetLayerIndex("YSLine", AcadDoc);
if (this.US_SURVEY_ID.StartsWith("WS"))
{
LayerID = GetLayerIndex("WSLine", AcadDoc);
Linetype = "污水";
}
else if (this.US_SURVEY_ID.StartsWith("YS"))
{
Linetype = "雨水";
}
AcadDoc.ActiveLayer = AcadDoc.Layers.Item(LayerID);
IPCPoint SPoint = GetPointByID(this.US_SURVEY_ID);
IPCPoint EPoint = GetPointByID(this.DS_SURVEY_ID);
double[] StartPoint = new double[3] {double.Parse( SPoint.X), double.Parse( SPoint.Y), 0 };
double[] EndPoint = new double[3] { double.Parse( EPoint.X), double.Parse( EPoint.Y), 0 };
AcadLine pAcadLine = AcadDoc.ModelSpace.AddLine(StartPoint, EndPoint);
AcadDictionary pAcadDictionary = pAcadLine.GetExtensionDictionary();
//pAcadDictionary.AddXRecord(ClassName);
pAcadDictionary.AddXRecord(ID);
string MinArrowVal = CIni.ReadINI("DrawCAD", "ArrowMin");
bool IsDrawArrow = false;
if (string.IsNullOrEmpty(MinArrowVal))
IsDrawArrow = true;
else
{
double MinArrow = double.Parse(MinArrowVal);
if (pAcadLine.Length < MinArrow)
{
IsDrawArrow = false;
}
else
IsDrawArrow = true;
}
double[] MidPoint = new double[3] { (double.Parse(SPoint.X) + double.Parse(EPoint.X)) / 2, (double.Parse(SPoint.Y) + double.Parse(EPoint.Y)) / 2, 0 };
if (IsDrawArrow)
{
string WidthValue = this.Width;
AcadMInsertBlock pBlock = AcadDoc.ModelSpace.AddMInsertBlock(MidPoint, "GP4", 1, 1, 1, 0, 1, 1, 1, 1);
pBlock.Rotate(MidPoint, pAcadLine.Angle);
pAcadDictionary = pBlock.GetExtensionDictionary();
pAcadDictionary.AddXRecord(ID);
}
string MinLableVal = CIni.ReadINI("DrawCAD", "LableMin");
if (!string.IsNullOrEmpty(MinLableVal))
{
double MinLable = double.Parse(MinLableVal);
if (pAcadLine.Length < MinLable)
{
return;
}
}
string pUS_INVERT_LEVEL = double.Parse(SPoint.INVERT_LEVEL).ToString("0.000");
string pDS_INVERT_LEVEL = double.Parse(EPoint.INVERT_LEVEL).ToString("0.000");
string LineLable = string.Format("{0} {1}m {2}Φ{3} {4}m", Linetype, pUS_INVERT_LEVEL, this.MATERIAL, this.Width, pDS_INVERT_LEVEL);
LayerID = GetLayerIndex("YSZJ", AcadDoc);
if (this.US_SURVEY_ID.StartsWith("WS"))
LayerID = GetLayerIndex("WSZJ", AcadDoc);
else
LayerID = GetLayerIndex("YSZJ", AcadDoc);
AcadDoc.ActiveLayer = AcadDoc.Layers.Item(LayerID);
AcadText pAcadText = AcadDoc.ModelSpace.AddText(LineLable, MidPoint, 2.0);
double LineAngle = pAcadLine.Angle;
if (LineAngle > Math.PI / 2 && LineAngle < 3 * Math.PI / 2)
LineAngle = LineAngle - Math.PI;
pAcadText.Rotate(MidPoint, LineAngle);
pAcadDictionary = pAcadText.GetExtensionDictionary();
//pAcadDictionary.AddXRecord(ClassName);
pAcadDictionary.AddXRecord(ID);
//}
AcadDoc.Save();
}
public PIPELineClass()
{
ClassName = "PS_PIPE";
}
/// <summary>
/// 上游点编码
/// </summary>
public string US_OBJECT_ID { get; set; }
/// <summary>
/// 下游点编码
/// </summary>
public string DS_OBJECT_ID { get; set; }
/// <summary>
/// 管径
/// </summary>
public string Width { get; set; }
/// <summary>
/// 管长
/// </summary>
public string Pipe_Length { get; set; }
/// <summary>
/// 上游井底高程(m)
/// </summary>
public string US_POINT_INVERT_LEVEL { get; set; }
/// <summary>
/// 下游井底高程(m)
/// </summary>
public string DS_POINT_INVERT_LEVEL { get; set; }
/// <summary>
/// 上游管底高程(m)
/// </summary>
public string US_INVERT_LEVEL { get; set; }
/// <summary>
/// 下游管底高程(m)
/// </summary>
public string DS_INVERT_LEVEL { get; set; }
/// <summary>
/// 淤积深度
/// </summary>
public string SEDIMENT_DEPTH { get; set; }
/// <summary>
/// 材质
/// </summary>
public string MATERIAL { get; set; }
/// <summary>
/// 上游点号
/// </summary>
public string US_SURVEY_ID { get; set; }
/// <summary>
/// 下游点号
/// </summary>
public string DS_SURVEY_ID { get; set; }
/// <summary>
/// 水位高程
/// </summary>
public string WATER_LEVEL
{
get;
set;
}
/// <summary>
/// 管道形式
/// </summary>
public string PRESSURE { get; set; }
public string Lenght { get; set; }
public override void Update()
{
string sql = "update PS_PIPE set US_OBJECT_ID=@US_OBJECT_ID,DS_OBJECT_ID=@DS_OBJECT_ID,SYSTEM_TYPE=@SYSTEM_TYPE,Width=@Width,PIPE_LENGTH=@PIPE_LENGTH,"
+ "US_POINT_INVERT_LEVEL=@US_POINT_INVERT_LEVEL,US_INVERT_LEVEL=@US_INVERT_LEVEL,DS_POINT_INVERT_LEVEL=@DS_POINT_INVERT_LEVEL,DS_INVERT_LEVEL=@DS_INVERT_LEVEL,SEDIMENT_DEPTH=@SEDIMENT_DEPTH,"
+ "MATERIAL=@MATERIAL,STATE=@STATE,PRESSURE=@PRESSURE,ROAD_NAME=@ROAD_NAME,ACQUISITION_DATE=@ACQUISITION_DATE,Remark=@Remark,US_SURVEY_ID=@US_SURVEY_ID,DS_SURVEY_ID=@DS_SURVEY_ID,"
+ "ACQUISITION_UNIT=@ACQUISITION_UNIT,PROCESS_DATE=@PROCESS_DATE,PROCESS_UNIT=@PROCESS_UNIT,SHAPE_Length=@SHAPE_Length,Water_State=@Water_State,WATER_QUALITY=@WATER_QUALITY,WATER_LEVEL=@WATER_LEVEL,Dirtcion=@Dirtcion where ID=@ID ";
SQLiteParameter[] Parameters = new SQLiteParameter[]
{
new SQLiteParameter(){ ParameterName="@US_OBJECT_ID" ,Value=this.US_OBJECT_ID},
new SQLiteParameter(){ ParameterName="@DS_OBJECT_ID" ,Value=this.DS_OBJECT_ID},
new SQLiteParameter(){ ParameterName="@SYSTEM_TYPE" ,Value=this.SYSTEM_TYPE},
new SQLiteParameter(){ ParameterName="@Width" ,Value=string.IsNullOrEmpty( this.Width)?DBNull.Value:(object)int.Parse(this.Width) },
new SQLiteParameter(){ ParameterName="@PIPE_LENGTH" ,Value=string.IsNullOrEmpty(this.Pipe_Length)?DBNull.Value:(object)double.Parse( this.Pipe_Length)},
new SQLiteParameter(){ ParameterName="@US_POINT_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.US_POINT_INVERT_LEVEL)?DBNull.Value:(object)double.Parse( this.US_POINT_INVERT_LEVEL)},
new SQLiteParameter(){ ParameterName="@US_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.US_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.US_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@DS_POINT_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.DS_POINT_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.DS_POINT_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@DS_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.DS_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.DS_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@SEDIMENT_DEPTH" ,Value=string.IsNullOrEmpty(this.SEDIMENT_DEPTH)?DBNull.Value:(object)double.Parse(this.SEDIMENT_DEPTH) },
new SQLiteParameter(){ ParameterName="@MATERIAL" ,Value=this.MATERIAL},
new SQLiteParameter(){ ParameterName="@STATE" ,Value=this.STATE},
new SQLiteParameter(){ ParameterName="@PRESSURE" ,Value=this.PRESSURE},
new SQLiteParameter(){ ParameterName="@ROAD_NAME" ,Value=this.ROAD_NAME },
new SQLiteParameter(){ ParameterName="@ACQUISITION_DATE" ,Value=this.ACQUISITION_DATE },
new SQLiteParameter(){ ParameterName="@Remark" ,Value=this.Remark },
new SQLiteParameter(){ ParameterName="@US_SURVEY_ID" ,Value=this.US_SURVEY_ID },
new SQLiteParameter(){ ParameterName="@DS_SURVEY_ID" ,Value=this.DS_SURVEY_ID },
new SQLiteParameter(){ ParameterName="@ACQUISITION_UNIT" ,Value=this.ACQUISITION_UNIT },
new SQLiteParameter(){ ParameterName="@PROCESS_DATE" ,Value=this.PROCESS_Date },
new SQLiteParameter(){ ParameterName="@PROCESS_UNIT" ,Value=this.PROCESS_Unit },
new SQLiteParameter(){ ParameterName="@SHAPE_Length" ,Value=string.IsNullOrEmpty(this.Lenght)?DBNull.Value:(object)double.Parse(this.Lenght) },
new SQLiteParameter(){ ParameterName="@Water_State" ,Value=this.WATER_State },
new SQLiteParameter(){ ParameterName="@WATER_QUALITY" ,Value=this.WATER_QUALITY },
new SQLiteParameter(){ ParameterName="@WATER_LEVEL" ,Value=string.IsNullOrEmpty(this.WATER_LEVEL)?DBNull.Value:(object)double.Parse(this.WATER_LEVEL) },
new SQLiteParameter(){ ParameterName="@Dirtcion" ,Value=this.Dirtcion },
//new SQLiteParameter(){ ParameterName="@OBJECTID" ,Value=this.ObjectID,OleDbType= OleDbType.Integer }
new SQLiteParameter(){ ParameterName="@ID" ,Value=this.ID}
};
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
pDataBase.OpenConnection();
try
{
pDataBase.ExecuteNonQuery(sql, Parameters);
}
catch (Exception ex)
{
throw ex;
}
finally
{
pDataBase.CloseConnection();
}
}
/* public override void Delete()
{
string sql = string.Format("update {0} set IsDelete=0 where ID='{1}'", this.ClassName, this.ID);
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
pDataBase.OpenConnection();
try
{
pDataBase.ExecuteNonQuery(sql);
}
finally
{
pDataBase.CloseConnection();
}
}*/
public override void AddNew()
{
string sql = "insert into PS_PIPE(ID,US_OBJECT_ID,DS_OBJECT_ID,SYSTEM_TYPE,Width,PIPE_LENGTH,"
+ "US_POINT_INVERT_LEVEL,US_INVERT_LEVEL,DS_POINT_INVERT_LEVEL,DS_INVERT_LEVEL,SEDIMENT_DEPTH,"
+ "MATERIAL,STATE,PRESSURE,ROAD_NAME,ACQUISITION_DATE,Remark,US_SURVEY_ID,DS_SURVEY_ID,"
+ "ACQUISITION_UNIT,PROCESS_DATE,PROCESS_UNIT,SHAPE_Length,Water_State,WATER_QUALITY,WATER_LEVEL,Dirtcion) "
+" values(@ID,@US_OBJECT_ID,@DS_OBJECT_ID,@SYSTEM_TYPE,@Width,@PIPE_LENGTH,"
+ "@US_POINT_INVERT_LEVEL,@US_INVERT_LEVEL,@DS_POINT_INVERT_LEVEL,@DS_INVERT_LEVEL,@SEDIMENT_DEPTH,"
+ "@MATERIAL,@STATE,@PRESSURE,@ROAD_NAME,@ACQUISITION_DATE,@Remark,@US_SURVEY_ID,@DS_SURVEY_ID,"
+ "@ACQUISITION_UNIT,@PROCESS_DATE,@PROCESS_UNIT,@SHAPE_Length,@Water_State,@WATER_QUALITY,@WATER_LEVEL,@Dirtcion)";
SQLiteParameter[] Parameters = new SQLiteParameter[]
{
new SQLiteParameter(){ ParameterName="@ID" ,Value=this.ID},
new SQLiteParameter(){ ParameterName="@US_OBJECT_ID" ,Value=this.US_OBJECT_ID},
new SQLiteParameter(){ ParameterName="@DS_OBJECT_ID" ,Value=this.DS_OBJECT_ID},
new SQLiteParameter(){ ParameterName="@SYSTEM_TYPE" ,Value=this.SYSTEM_TYPE},
new SQLiteParameter(){ ParameterName="@Width" ,Value=this.Width },
new SQLiteParameter(){ ParameterName="@PIPE_LENGTH" ,Value=string.IsNullOrEmpty(this.Pipe_Length)?DBNull.Value:(object)double.Parse( this.Pipe_Length)},
new SQLiteParameter(){ ParameterName="@US_POINT_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.US_POINT_INVERT_LEVEL)?DBNull.Value:(object)double.Parse( this.US_POINT_INVERT_LEVEL)},
new SQLiteParameter(){ ParameterName="@US_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.US_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.US_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@DS_POINT_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.DS_POINT_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.DS_POINT_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@DS_INVERT_LEVEL" ,Value=string.IsNullOrEmpty(this.DS_INVERT_LEVEL)?DBNull.Value:(object)double.Parse(this.DS_INVERT_LEVEL) },
new SQLiteParameter(){ ParameterName="@SEDIMENT_DEPTH" ,Value=string.IsNullOrEmpty(this.SEDIMENT_DEPTH)?DBNull.Value:(object)double.Parse(this.SEDIMENT_DEPTH) },
new SQLiteParameter(){ ParameterName="@MATERIAL" ,Value=this.MATERIAL},
new SQLiteParameter(){ ParameterName="@STATE" ,Value=this.STATE},
new SQLiteParameter(){ ParameterName="@PRESSURE" ,Value=this.PRESSURE},
new SQLiteParameter(){ ParameterName="@ROAD_NAME" ,Value=this.ROAD_NAME },
new SQLiteParameter(){ ParameterName="@ACQUISITION_DATE" ,Value=this.ACQUISITION_DATE },
new SQLiteParameter(){ ParameterName="@Remark" ,Value=this.Remark },
new SQLiteParameter(){ ParameterName="@US_SURVEY_ID" ,Value=this.US_SURVEY_ID },
new SQLiteParameter(){ ParameterName="@DS_SURVEY_ID" ,Value=this.DS_SURVEY_ID },
new SQLiteParameter(){ ParameterName="@ACQUISITION_UNIT" ,Value=this.ACQUISITION_UNIT },
new SQLiteParameter(){ ParameterName="@PROCESS_DATE" ,Value=this.PROCESS_Date },
new SQLiteParameter(){ ParameterName="@PROCESS_UNIT" ,Value=this.PROCESS_Unit },
new SQLiteParameter(){ ParameterName="@SHAPE_Length" ,Value=string.IsNullOrEmpty(this.Lenght)?DBNull.Value:(object)double.Parse(this.Lenght) },
new SQLiteParameter(){ ParameterName="@Water_State" ,Value=this.WATER_State },
new SQLiteParameter(){ ParameterName="@WATER_QUALITY" ,Value=this.WATER_QUALITY },
new SQLiteParameter(){ ParameterName="@WATER_LEVEL" ,Value=string.IsNullOrEmpty(this.WATER_LEVEL)?DBNull.Value:(object)double.Parse(this.WATER_LEVEL) },
new SQLiteParameter(){ ParameterName="@Dirtcion" ,Value=this.Dirtcion }
};
IDataBase pDataBase = SysDBUnitiy.OleDataBase;
pDataBase.OpenConnection();
try
{
pDataBase.ExecuteNonQuery(sql, Parameters);
//this.CurClassName = "PS_PIPE";
//sql = "select max(objectid) from PS_PIPE";
//this.ObjectID = int.Parse(pDataBase.ExecuteScalar(sql).ToString());
}
catch (Exception ex)
{
throw ex;
}
finally
{
pDataBase.CloseConnection();
}
}
public override void FillValueByRow(System.Data.DataRow pDataRow )
{
base.FillValueByRow(pDataRow);
if (pDataRow.Table.Columns.Contains("US_OBJECT_ID"))
this.US_OBJECT_ID = pDataRow["US_OBJECT_ID"].ToString();
if (pDataRow.Table.Columns.Contains("DS_OBJECT_ID"))
this.DS_OBJECT_ID = pDataRow["DS_OBJECT_ID"].ToString();
if (pDataRow.Table.Columns.Contains("Width"))
this.Width = pDataRow["Width"].ToString();
if (pDataRow.Table.Columns.Contains("Pipe_Length"))
this.Pipe_Length = pDataRow["Pipe_Length"].ToString();
if (pDataRow.Table.Columns.Contains("US_POINT_INVERT_LEVEL"))
this.US_POINT_INVERT_LEVEL = pDataRow["US_POINT_INVERT_LEVEL"].ToString();
if (pDataRow.Table.Columns.Contains("DS_POINT_INVERT_LEVEL"))
this.DS_POINT_INVERT_LEVEL = pDataRow["DS_POINT_INVERT_LEVEL"].ToString();
if (pDataRow.Table.Columns.Contains("US_INVERT_LEVEL"))
this.US_INVERT_LEVEL = pDataRow["US_INVERT_LEVEL"].ToString();
if (pDataRow.Table.Columns.Contains("DS_INVERT_LEVEL"))
this.DS_INVERT_LEVEL = pDataRow["DS_INVERT_LEVEL"].ToString();
if (pDataRow.Table.Columns.Contains("SEDIMENT_DEPTH"))
this.SEDIMENT_DEPTH = pDataRow["SEDIMENT_DEPTH"].ToString();
if (pDataRow.Table.Columns.Contains("MATERIAL"))
this.MATERIAL = pDataRow["MATERIAL"].ToString();
if (pDataRow.Table.Columns.Contains("US_SURVEY_ID"))
this.US_SURVEY_ID = pDataRow["US_SURVEY_ID"].ToString();
if (pDataRow.Table.Columns.Contains("DS_SURVEY_ID"))
this.DS_SURVEY_ID = pDataRow["DS_SURVEY_ID"].ToString();
if (pDataRow.Table.Columns.Contains("PRESSURE"))
this.PRESSURE = pDataRow["PRESSURE"].ToString();
if(pDataRow.Table.Columns.Contains("SHAPE_Length") )
this.Lenght = pDataRow["SHAPE_Length"].ToString();
if (pDataRow.Table.Columns.Contains("WATER_LEVEL"))
this.WATER_LEVEL = pDataRow["WATER_LEVEL"].ToString();
if (pDataRow.Table.Columns.Contains("Dirtcion"))
this.Dirtcion = pDataRow["Dirtcion"].ToString();
if (pDataRow.Table.Columns.Contains("Water_State"))
this.WATER_State = pDataRow["Water_State"].ToString();
if (pDataRow.Table.Columns.Contains("WATER_QUALITY"))
this.WATER_QUALITY = pDataRow["WATER_QUALITY"].ToString();
}
}
}