本文整理汇总了C++中COleDateTimeSpan::GetDays方法的典型用法代码示例。如果您正苦于以下问题:C++ COleDateTimeSpan::GetDays方法的具体用法?C++ COleDateTimeSpan::GetDays怎么用?C++ COleDateTimeSpan::GetDays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COleDateTimeSpan
的用法示例。
在下文中一共展示了COleDateTimeSpan::GetDays方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FinishMeasurement
void VirtualMeasurement::FinishMeasurement(COleDateTime odtMTime)
{
_iMPMeasurementDateYear = odtMTime.GetYear();
_iMPMeasurementDateMonth = odtMTime.GetMonth();
_iMPMeasurementDateDay = odtMTime.GetDay();
_fMPNChanA = (float)_dAve.val[NeutA];
_fMPNChanB = (float)_dAve.val[NeutB];
_fMPNChanC = (float)_dAve.val[NeutC];
_fMPGDose1 = (float)_dAve.val[Gamma1];
_fMPGDose2 = (float)_dAve.val[Gamma2];
COleDateTimeSpan delta = odtMTime;
delta -= delta.GetDays();
_fMPNChanBThresh = (float)delta.GetTotalSeconds();
CalcCoolingTime();
ApplyAdjustments();
//SetDetectorID();
Certify();
}
示例2: XenoUserMoney
struct state* CXenoChannel::XenoUserMoney()
{
CString strQuery;
strQuery.Format( "select * from Xcostcard"
" where xcostcode = '%s' and xcostpwd = '%s'",
XenoCard, XenoWord );
TRACE( strQuery + "\n" );
xOpenRecordset(m_pRecordcar, theApp.m_pConnection, (_bstr_t)strQuery);
if ( m_pRecordcar->adoEOF )
{
XenoError = XENO_INVALID; return &ReputCard;
}
_variant_t TheValue;
TheValue = m_pRecordcar->GetCollect( "xcostuse" );
if ( VT_NULL == TheValue.vt || _tcscmp( (_bstr_t)TheValue, "0 " ) )
{
XenoError = XENO_REJECT; return &ReputCard;
}
TheValue = m_pRecordcar->GetCollect( "xcostrun" );
if ( VT_NULL == TheValue.vt || _tcscmp( (_bstr_t)TheValue, "1 " ) )
{
XenoError = XENO_REJECT; return &ReputCard;
}
TheValue = m_pRecordcar->GetCollect( "xcostdate" );
if ( VT_NULL != TheValue.vt )
{
COleDateTime tt = COleDateTime( TheValue );
COleDateTimeSpan tSpan = tt - COleDateTime::GetCurrentTime();
if ( tSpan.GetDays() < 0 )
{
XenoError = XENO_EXPIRED; return &ReputCard;
}
}
#if 1
COleDateTime tt = COleDateTime::GetCurrentTime();
m_pRecordcar->PutCollect( "xcostuse", _variant_t("1") );
m_pRecordcar->Update();
#endif
TheValue = m_pRecordcar->GetCollect( "xcostmoney" );
double xCostMoney = (double)TheValue;
double xBalance = xCostMoney;
TheValue = m_pRecordusr->GetCollect( "xBalance" );
if ( VT_NULL != TheValue.vt ) xBalance += (double)TheValue;
m_pRecordusr->PutCollect( "xBalance", _variant_t(xBalance) );
m_pRecordusr->PutCollect( "xStatus", _variant_t("1") );
m_pRecordusr->Update();
TheValue = m_pRecordusr->GetCollect( "xjsjbh" );
strQuery.Format( "insert into Xusercost(xjsjbh, xtimestart, xcostcode, Xcode, xpar_value)"
" values('%s', getdate(), '%s', 99999999, '%i')",
(LPCTSTR)(_bstr_t)TheValue, XenoCard, (INT)xCostMoney );
TRACE( strQuery + "\n" );
xExecute(theApp.m_pConnection, (_bstr_t)strQuery, adExecuteNoRecords);
return &PlayXnOk;
}
示例3: OnDrawAppointmentsDuration
void CBCGPPlannerViewMulti::OnDrawAppointmentsDuration (CDC* pDC)
{
if ((GetPlanner ()->GetDrawFlags () & BCGP_PLANNER_DRAW_VIEW_NO_DURATION) ==
BCGP_PLANNER_DRAW_VIEW_NO_DURATION)
{
return;
}
XBCGPAppointmentArray& arQueryApps = GetQueryedAppointments ();
XBCGPAppointmentArray& arDragApps = GetDragedAppointments ();
if (arQueryApps.GetSize () == 0 && arDragApps.GetSize () == 0)
{
return;
}
BOOL bDragDrop = IsDragDrop ();
DROPEFFECT dragEffect = GetDragEffect ();
BOOL bDragMatch = IsCaptureMatched ();
COleDateTime dtS = GetDateStart ();
COleDateTime dtE = GetDateEnd ();
const int nMinuts = CBCGPPlannerView::GetTimeDeltaInMinuts (GetTimeDelta ());
const int nCount = GetViewHours() * 60 / nMinuts;
const int yOffset = GetViewHourOffset () * m_nRowHeight;
for (int nApp = 0; nApp < 2; nApp++)
{
XBCGPAppointmentArray& arApps = nApp == 1 ? arDragApps : arQueryApps;
if (nApp == 1)
{
bDragDrop = bDragDrop && arDragApps.GetSize ();
}
if (arApps.GetSize () == 0)
{
continue;
}
for (int i = 0; i < arApps.GetSize (); i++)
{
CBCGPAppointment* pApp = arApps [i];
if (pApp == NULL || !(pApp->IsAllDay () || pApp->IsMultiDay ()) ||
pApp->GetDurationColor () == CLR_DEFAULT)
{
continue;
}
BOOL bDraw = FALSE;
if (bDragDrop && dragEffect != DROPEFFECT_NONE &&
pApp->IsSelected () && nApp == 0)
{
if ((dragEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY || bDragMatch)
{
bDraw = TRUE;
}
}
else
{
bDraw = TRUE;
}
if(!bDraw)
{
continue;
}
int nResourceIndex = FindResourceIndexByID (pApp->GetResourceID ());
ASSERT(nResourceIndex != -1);
XResource& resource = m_Resources[nResourceIndex];
COleDateTime dtStart = pApp->GetStart ();
COleDateTime dtFinish = pApp->GetFinish ();
dtStart.SetDate (dtStart.GetYear (), dtStart.GetMonth (), dtStart.GetDay ());
dtFinish.SetDate (dtFinish.GetYear (), dtFinish.GetMonth (), dtFinish.GetDay ());
BOOL bStart = FALSE;
BOOL bEnd = FALSE;
if (dtStart < dtS)
{
dtStart = dtS;
bStart = TRUE;
}
if (dtE < dtFinish)
{
dtFinish = dtE;
bEnd = TRUE;
}
COleDateTimeSpan span (dtFinish - dtStart);
int nStart = (dtStart - dtS).GetDays ();
int nEnd = min(nStart + span.GetDays () + 1, GetViewDuration ());
//.........这里部分代码省略.........
示例4: AdjustLayout
//.........这里部分代码省略.........
{
break;
}
if (pApp->IsAllDay () || pApp->IsMultiDay ())
{
if (nDays > 1)
{
COleDateTime dtStart = pApp->GetStart ();
COleDateTime dtFinish = pApp->GetFinish ();
dtStart = COleDateTime (dtStart.GetYear (), dtStart.GetMonth (), dtStart.GetDay (),
0, 0, 0);
if (pApp->IsAllDay ())
{
dtFinish += COleDateTimeSpan (1, 0, 0, 0);
}
else if (pApp->GetFinish ().GetHour () != 0 ||
pApp->GetFinish ().GetMinute () != 0)
{
dtFinish = COleDateTime (dtFinish.GetYear (), dtFinish.GetMonth (), dtFinish.GetDay (),
0, 0, 0);
dtFinish += COleDateTimeSpan (1, 0, 0, 0);
}
if (dtStart < dtS)
{
dtStart = dtS;
}
COleDateTimeSpan span (dtFinish - dtStart);
int nStart = (dtStart - dtS).GetDays ();
int nEnd = nStart + span.GetDays ();
if (nEnd > (int) nDays)
{
nEnd = (int) nDays;
}
for (int j = nStart; j < nEnd; j++)
{
arDays[j] = arDays[j] + 1;
}
}
else
{
arDays[0] = arDays[0] + 1;
}
}
}
}
for (int i = 0; i < nDays; i++)
{
if (maxCount < arDays[i])
{
maxCount = arDays[i];
}
arDays[i] = 0;
}
}
if (maxCount > 0)