📄 researchindent.cpp
字号:
// ResearchIndent.cpp : implementation file
//
#include "stdafx.h"
#include "短信群发.h"
#include "ResearchIndent.h"
#include "into.h"
#include "IndentDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResearchIndent dialog
CResearchIndent::CResearchIndent(CWnd* pParent /*=NULL*/)
: CDialog(CResearchIndent::IDD, pParent)
{
//{{AFX_DATA_INIT(CResearchIndent)
m_startTime2 = COleDateTime::GetCurrentTime();
m_startDay2 = COleDateTime::GetCurrentTime();
m_endDay2 = COleDateTime::GetCurrentTime();
m_endTime2 = COleDateTime::GetCurrentTime();
//}}AFX_DATA_INIT
}
void CResearchIndent::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CResearchIndent)
DDX_DateTimeCtrl(pDX, IDC_STARTTIME2, m_startTime2);
DDX_DateTimeCtrl(pDX, IDC_STARTDAY2, m_startDay2);
DDX_DateTimeCtrl(pDX, IDC_ENDDAY2, m_endDay2);
DDX_DateTimeCtrl(pDX, IDC_ENDTIME2, m_endTime2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CResearchIndent, CDialog)
//{{AFX_MSG_MAP(CResearchIndent)
ON_BN_CLICKED(IDC_RESEARCH_INDENT, OnResearchIndent)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResearchIndent message handlers
void CResearchIndent::OnResearchIndent()
{
int id;
int count=0;
CADORecordset record;
CIndentDialog* theIndent;
CString strID;
CString strStartDay;
CString strStartTime;
CString strEndDay;
CString strEndTime;
CString strMessage;
COleDateTime startDay;
COleDateTime endDay;
COleDateTime startTime;
COleDateTime endTime;
COleDateTime BeginTime;
COleDateTime EndTime;
BOOL ret;
LV_ITEM lvi;
lvi.mask=LVIF_TEXT;
theIndent=(CIndentDialog*) (GetParent()->GetParent());
theIndent->m_stateList.DeleteAllItems();
UpdateData(true);
record.Open(db.m_pConnection,"ORDERS",CADORecordset::openTable);
while(!record.IsEof())
{
record.GetFieldValue("ORDERSTART",BeginTime);
record.GetFieldValue("ORDEREND",EndTime);
strStartDay=BeginTime.Format("%Y-%m-%d");
startDay.ParseDateTime(strStartDay);
strStartTime=BeginTime.Format("%H:%M");
startTime.ParseDateTime(strStartTime);
strEndDay=EndTime.Format("%Y-%m-%d");
endDay.ParseDateTime(strEndDay);
strEndTime=EndTime.Format("%H:%M");
endTime.ParseDateTime(strEndTime);
if(startDay>=m_startDay2)
{
if(startDay==m_startDay2)
{
if(startTime<m_startTime2)
{
record.MoveNext();
continue;
}
}
if(endDay<=m_endDay2)
{
if(endDay==m_endDay2)
{
if (endTime>m_endTime2)
{
record.MoveNext();
continue;
}
}
record.GetFieldValue("ID",id);
record.GetFieldValue("CONTENT",strMessage);
strID.Format("%d",id);
lvi.iSubItem=0;
lvi.iItem=count;
lvi.pszText=(LPTSTR)(LPCTSTR)strID;
theIndent->m_stateList.InsertItem(&lvi);
theIndent->m_stateList.SetItemText(count,1,strStartDay);
theIndent->m_stateList.SetItemText(count,2,strEndDay);
theIndent->m_stateList.SetItemText(count,3,strStartTime);
theIndent->m_stateList.SetItemText(count,4,strEndTime);
theIndent->m_stateList.SetItemText(count,5,strMessage);
record.MoveNext();
count++;
}
else
{
record.MoveNext();
continue;
}
}
else
{
record.MoveNext();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -