⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dapersistmanager.cs

📁 这是一个gps的数据读写器。大家可以借鉴学习一下。
💻 CS
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Threading;
using BEC;

namespace DAT
{
	/// <summary>
	/// Summary description for DAPersistManager.
	/// </summary>
	public class DAPersistManager:DABasis
	{
		public DAPersistManager()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		
		public bool InsertRMC(string strMovObjId,BEC.RMC oRMC)
		{
			bool bDone=false;
			try
			{
				Monitor.Enter(this);
				//  initialize data access utilities for the local server
				this.Prepair_L("SPInsertLog");


				this.Open_L();
				// Add parameters to the SqlCommand
				SqlParameter pmUTCTime = pmFactory_In.GetDecimal("@UTCTime");
				pmUTCTime.Value = oRMC.UTCTime;
				this.AddParameter_L(pmUTCTime);

				SqlParameter pmMovObjId = pmFactory_In.GetPMVChar50("@MovObjId");
                pmMovObjId.Value=strMovObjId;
				this.AddParameter_L(pmMovObjId);

				SqlParameter pmStatus = pmFactory_In.GetBoolen("@Status");
				pmStatus.Value = oRMC.Status;
				this.AddParameter_L(pmStatus);

				SqlParameter pmLatitude = pmFactory_In.GetDecimal("@Latitude");
				pmLatitude.Value = oRMC.Latitude;
				this.AddParameter_L(pmLatitude);

				SqlParameter pmLatIndicator = pmFactory_In.GetPMChar5("@LatIndicator");
				pmLatIndicator.Value = oRMC.LatIndicator;
				this.AddParameter_L(pmLatIndicator);

				SqlParameter pmLongtitude = pmFactory_In.GetDecimal("@Longtitude");
				pmLongtitude.Value = oRMC.Longtitude;
				this.AddParameter_L(pmLongtitude);

				SqlParameter pmLongIndicator = pmFactory_In.GetPMChar4("@LongIndicator");
				pmLongIndicator.Value = oRMC.LongIndicator;
				this.AddParameter_L(pmLongIndicator);

				SqlParameter pmSpeed = pmFactory_In.GetDecimal("@Speed");
				pmSpeed.Value = oRMC.Speed;
				this.AddParameter_L(pmSpeed);

				SqlParameter pmCourse = pmFactory_In.GetDecimal("@Course");
				pmCourse.Value = oRMC.Course;
				this.AddParameter_L(pmCourse);

				SqlParameter pmUTCDate = pmFactory_In.GetDateTime("@UTCDate");
				pmUTCDate.Value = oRMC.UTCDate;
				this.AddParameter_L(pmUTCDate);

			
				int nDone=this.ExecuteNonQuery_L();
				if(nDone>0)
				{
					bDone=true;

				}

			}
			catch(Exception oException)
			{
				throw new Exception("InsertRMC",oException);

			}
			finally
			{
				this.Close_L();
				Monitor.Exit(this);

			}
			return bDone;

		}


	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -