15,979
社区成员
发帖
与我相关
我的任务
分享
void DetectionMgrDlg::LoadReprotListByDate() {
CString curDateTime = m_tDateTime.Format(_T("%Y/%m/%d"));
int year = m_tDateTime.GetYear();
int month = m_tDateTime.GetMonth();
int day = m_tDateTime.GetDay();
m_testReportDao.GetTestReportList(year,month,day);
int nCount = m_testReportDao.m_TestReportList.GetSize();
//允许导出报表
if(nCount>0) {
m_cExportReportBtn.EnableWindow(true);
}
m_cReportList.DeleteAllItems();
for (int i=nCount-1;i>=0;i--) {
CTestReport& testReport = m_testReportDao.m_TestReportList.GetAt(i);
int curItem = m_cReportList.InsertItem(0,"");
CString rowIndex;
CString curDateTime = testReport.GetTestTime();
CString productNo = testReport.GetProductNo();
CString testThickness;
testThickness.Format("%.3lf",testReport.GetTestThickness());
CString sBatteryThickness;
sBatteryThickness.Format("%.3lf",testReport.GetBatteryThickness());
CString sErrandUp;
sErrandUp.Format("%.3lf",testReport.GetBatteryErrandUp());
CString sErrandDown;
sErrandDown.Format("%.3lf",testReport.GetBatteryErrandDown());
CString sResult = testReport.GetTestResult();
rowIndex.Format("%d",testReport.GetId());
m_cReportList.SetItem(curItem,0,LVIF_TEXT,rowIndex,NULL,0,0,0);
m_cReportList.SetItem(curItem,1,LVIF_TEXT,curDateTime,NULL,0,0,0);
m_cReportList.SetItem(curItem,2,LVIF_TEXT,productNo,NULL,0,0,0);
//m_cReportList.SetItem(curItem,3,LVIF_TEXT,curDateTime,NULL,0,0,0);
m_cReportList.SetItem(curItem,4,LVIF_TEXT,testThickness,NULL,0,0,0);
m_cReportList.SetItem(curItem,5,LVIF_TEXT,sBatteryThickness,NULL,0,0,0);
m_cReportList.SetItem(curItem,6,LVIF_TEXT,sErrandUp,NULL,0,0,0);
m_cReportList.SetItem(curItem,7,LVIF_TEXT,sErrandDown,NULL,0,0,0);
m_cReportList.SetItem(curItem,8,LVIF_TEXT,sResult,NULL,0,0,0);
CTestReport testReport2;
testReport = testReport2;
}
}