|  | @@ -4,6 +4,7 @@ using OTSModelSharp.DTLBase;
 | 
	
		
			
				|  |  |  using System;
 | 
	
		
			
				|  |  |  using System.Collections.Generic;
 | 
	
		
			
				|  |  |  using System.Data;
 | 
	
		
			
				|  |  | +using System.Data.SQLite;
 | 
	
		
			
				|  |  |  using System.Drawing;
 | 
	
		
			
				|  |  |  using System.Linq;
 | 
	
		
			
				|  |  |  using System.Text;
 | 
	
	
		
			
				|  | @@ -25,44 +26,78 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |              Rectangle prec = (Rectangle)a_pParticle.GetParticleRect();
 | 
	
		
			
				|  |  |              System.Drawing.Point pos = (System.Drawing.Point)a_pParticle.GetAbsolutPos();
 | 
	
		
			
				|  |  |              String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString(true);
 | 
	
		
			
				|  |  | -        String sSQLCommand = String.Format(sInsertFormat,
 | 
	
		
			
				|  |  | -            a_pParticle.GetFieldId(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetAnalysisId(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetAveGray(),
 | 
	
		
			
				|  |  | -             prec.Left,
 | 
	
		
			
				|  |  | -             prec.Top,
 | 
	
		
			
				|  |  | -             prec.Width,
 | 
	
		
			
				|  |  | -             prec.Height,
 | 
	
		
			
				|  |  | -			a_pParticle.GetActualArea(),
 | 
	
		
			
				|  |  | -            pos.X,
 | 
	
		
			
				|  |  | -            pos.Y,
 | 
	
		
			
				|  |  | -			a_pParticle.GetType(),
 | 
	
		
			
				|  |  | -			(int) a_pXray.GetElementQuantifyData().Count,
 | 
	
		
			
				|  |  | -			(int) (a_pParticle.GetFeature().GetSegmentsList().Count),
 | 
	
		
			
				|  |  | -			fldPos.X,
 | 
	
		
			
				|  |  | -			fldPos.Y,
 | 
	
		
			
				|  |  | -			a_pParticle.GetTagId(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDMAX(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDMIN(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDMPERP(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDPRIMETER(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetORIENTATION(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDINSCR(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDMEAN(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetDELONG(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetFeretDiameter(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetTypeName(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetTypeColor(),
 | 
	
		
			
				|  |  | -			a_pParticle.GetSubParticles()
 | 
	
		
			
				|  |  | -			);
 | 
	
		
			
				|  |  | +            var cmd = tableInfoPtr.GetInsertCommand(true);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            var paras = cmd.Value;
 | 
	
		
			
				|  |  | +            paras[0].Value = a_pParticle.GetFieldId();
 | 
	
		
			
				|  |  | +            paras[1].Value = a_pParticle.GetAnalysisId();
 | 
	
		
			
				|  |  | +            paras[2].Value = a_pParticle.GetAveGray();
 | 
	
		
			
				|  |  | +            paras[3].Value = prec.Left;
 | 
	
		
			
				|  |  | +            paras[4].Value = prec.Top;
 | 
	
		
			
				|  |  | +            paras[5].Value = prec.Width;
 | 
	
		
			
				|  |  | +            paras[6].Value = prec.Height;
 | 
	
		
			
				|  |  | +            paras[7].Value = a_pParticle.GetActualArea();
 | 
	
		
			
				|  |  | +            paras[8].Value = pos.X;
 | 
	
		
			
				|  |  | +            paras[9].Value = pos.Y;
 | 
	
		
			
				|  |  | +            paras[10].Value = a_pParticle.GetType();
 | 
	
		
			
				|  |  | +            paras[11].Value = a_pXray.GetElementQuantifyData().Count;
 | 
	
		
			
				|  |  | +            paras[12].Value = a_pParticle.GetFeature().GetSegmentsList().Count;
 | 
	
		
			
				|  |  | +            paras[13].Value = fldPos.X;
 | 
	
		
			
				|  |  | +            paras[14].Value = fldPos.Y;
 | 
	
		
			
				|  |  | +            paras[15].Value = a_pParticle.GetTagId();
 | 
	
		
			
				|  |  | +            paras[16].Value = a_pParticle.GetDMAX();
 | 
	
		
			
				|  |  | +            paras[17].Value = a_pParticle.GetDMIN();
 | 
	
		
			
				|  |  | +            paras[18].Value = a_pParticle.GetDMPERP();
 | 
	
		
			
				|  |  | +            paras[19].Value = a_pParticle.GetDPRIMETER();
 | 
	
		
			
				|  |  | +            paras[20].Value = a_pParticle.GetORIENTATION();
 | 
	
		
			
				|  |  | +            paras[21].Value = a_pParticle.GetDINSCR();
 | 
	
		
			
				|  |  | +            paras[22].Value = a_pParticle.GetDMEAN();
 | 
	
		
			
				|  |  | +            paras[23].Value = a_pParticle.GetDELONG();
 | 
	
		
			
				|  |  | +            paras[24].Value = a_pParticle.GetFeretDiameter();
 | 
	
		
			
				|  |  | +            paras[25].Value = a_pParticle.GetTypeName();
 | 
	
		
			
				|  |  | +            paras[26].Value = a_pParticle.GetTypeColor();
 | 
	
		
			
				|  |  | +            paras[27].Value = a_pParticle.GetSubParticles();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //     String sSQLCommand = String.Format(sInsertFormat,
 | 
	
		
			
				|  |  | +            //         a_pParticle.GetFieldId(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetAnalysisId(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetAveGray(),
 | 
	
		
			
				|  |  | +            //          prec.Left,
 | 
	
		
			
				|  |  | +            //          prec.Top,
 | 
	
		
			
				|  |  | +            //          prec.Width,
 | 
	
		
			
				|  |  | +            //          prec.Height,
 | 
	
		
			
				|  |  | +            //a_pParticle.GetActualArea(),
 | 
	
		
			
				|  |  | +            //         pos.X,
 | 
	
		
			
				|  |  | +            //         pos.Y,
 | 
	
		
			
				|  |  | +            //a_pParticle.GetType(),
 | 
	
		
			
				|  |  | +            //(int) a_pXray.GetElementQuantifyData().Count,
 | 
	
		
			
				|  |  | +            //(int) (a_pParticle.GetFeature().GetSegmentsList().Count),
 | 
	
		
			
				|  |  | +            //fldPos.X,
 | 
	
		
			
				|  |  | +            //fldPos.Y,
 | 
	
		
			
				|  |  | +            //a_pParticle.GetTagId(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDMAX(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDMIN(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDMPERP(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDPRIMETER(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetORIENTATION(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDINSCR(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDMEAN(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetDELONG(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetFeretDiameter(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetTypeName(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetTypeColor(),
 | 
	
		
			
				|  |  | +            //a_pParticle.GetSubParticles()
 | 
	
		
			
				|  |  | +            //);
 | 
	
		
			
				|  |  |              //var helper = new SQLiteHelper(datastorePtr);
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | -            if (datastorePtr.RunCommand(sSQLCommand)!=true)
 | 
	
		
			
				|  |  | -			{
 | 
	
		
			
				|  |  | +            List<KeyValuePair<string, SQLiteParameter[]>> cmds = new List<KeyValuePair<string, SQLiteParameter[]>>();
 | 
	
		
			
				|  |  | +            cmds.Add(cmd);
 | 
	
		
			
				|  |  | +           
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                datastorePtr.ExecuteNonQueryBatch(ref cmds);
 | 
	
		
			
				|  |  | +               
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                return false;
 | 
	
		
			
				|  |  | -			}
 | 
	
		
			
				|  |  | +           
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |  	}
 |