a
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
// SPCETdRecord.cpp: implementation of the CSPCETdRecord class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "geomative.h"
|
||||
#include "SPCETdRecord.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CSPCETdRecord::CSPCETdRecord(DWORD dwChID, _ConnectionPtr& pConnection):CTdRecord(pConnection)
|
||||
{
|
||||
m_dwChID = dwChID;
|
||||
m_iTsn = (int)VAL_ZERO;
|
||||
m_fA = (float)VAL_ZERO;
|
||||
m_fB = (float)VAL_ZERO;
|
||||
m_fX = (float)VAL_ZERO;
|
||||
m_fY = (float)VAL_ZERO;
|
||||
m_iN = (int)VAL_ZERO;
|
||||
m_fK = (float)VAL_ZERO;
|
||||
m_fI = (float)VAL_ZERO;
|
||||
m_fV = (float)VAL_ZERO;
|
||||
m_fR0 = (float)VAL_ZERO;
|
||||
m_fSP = (float)VAL_ZERO;
|
||||
|
||||
m_fDepth = (float)VAL_ZERO;
|
||||
m_iPosInLevel = (int)VAL_ZERO;
|
||||
|
||||
m_colorREF = RGB(0xFF,0xFF,0xFF);
|
||||
m_recPtArea.SetRectEmpty();
|
||||
}
|
||||
|
||||
CSPCETdRecord::~CSPCETdRecord()
|
||||
{
|
||||
|
||||
}
|
||||
BOOL CSPCETdRecord::SaveData(DWORD dwChID)
|
||||
{
|
||||
_RecordsetPtr pRecTdCha;
|
||||
_CommandPtr pCmdIns;
|
||||
CString szSql = _T("");
|
||||
int iTdRecIndex = (int)VAL_ZERO;
|
||||
|
||||
pRecTdCha.CreateInstance(_uuidof(Recordset));
|
||||
pCmdIns.CreateInstance(_uuidof(Command));
|
||||
pCmdIns->ActiveConnection = m_pConnection;
|
||||
|
||||
try
|
||||
{
|
||||
if (((float)VAL_ZERO != this->m_fI) || ((float)VAL_ZERO != this->m_fV) && ((float)VAL_ZERO != this->m_fR0) && ((float)VAL_ZERO != this->m_fSP))
|
||||
{
|
||||
m_dwChID = dwChID;
|
||||
szSql.Empty();
|
||||
szSql.Format(_T("insert into td1dcon(TCHID,TSN,a,b,x,y,N,K,I,V,R0,SP) values(%u,%d,%.1f,%.1f,%.1f,%.1f,%d,%f,%f,%f,%f,%f)"),
|
||||
m_dwChID,
|
||||
this->m_iTsn,
|
||||
this->m_fA,
|
||||
this->m_fB,
|
||||
this->m_fX,
|
||||
this->m_fY,
|
||||
this->m_iN,
|
||||
this->m_fK,
|
||||
this->m_fI,
|
||||
this->m_fV,
|
||||
this->m_fR0,
|
||||
this->m_fSP);
|
||||
|
||||
pCmdIns->CommandText = szSql.AllocSysString();
|
||||
pCmdIns->Execute(NULL, NULL, adCmdText);
|
||||
}
|
||||
|
||||
}
|
||||
catch(_com_error e)
|
||||
{
|
||||
throw e;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CSPCETdRecord::ClearAll()
|
||||
{
|
||||
m_fI = (float)VAL_ZERO;
|
||||
m_fV = (float)VAL_ZERO;
|
||||
m_fR0 = (float)VAL_ZERO;
|
||||
m_fSP = (float)VAL_ZERO;
|
||||
|
||||
m_colorREF = RGB(0xFF,0xFF,0xFF);
|
||||
}
|
||||
|
||||
BOOL CSPCETdRecord::LoadOrgData()
|
||||
{
|
||||
// AfxMessageBox(_T("CRspCETdRecord::LoadOrgData"));
|
||||
this->LoadCEOrgData();
|
||||
return TRUE;
|
||||
}
|
||||
Reference in New Issue
Block a user