sqlcommand += str_now_time;sqlcommand += "',";
sqlcommand += str_status;sqlcommand += ")";
if(!((CRepairServiceApp*)AfxGetApp())->g_pDb->Execute(sqlcommand))
{
AfxMessageBox("插入数据失败,请检查数据是否重复");
return;
}
AfxMessageBox("工单登记完毕");
4.3 工单派遣模块
在用户点击派遣后,触发工单派遣函数,代码如下:
int count = 0;
CADORecordset* pRs = new CADORecordset(((CRepairServiceApp*)AfxGetApp())->g_pDb);
CString sqlcommand="SELECT count(*) as countnum from repair_relation where repair_id = '";
sqlcommand+=m_id;
sqlcommand+="'";
if(pRs->Open((LPCTSTR)sqlcommand))
{
while(!pRs->IsEof())
{
pRs->GetFieldValue("countnum",count);
pRs->MoveNext();
}
pRs->Close();
}
if(count == 0)
{
AfxMessageBox("工单请先登记");
return;
}
_Application ExcelApp;
Workbooks wbsBooks;
_Workbook wbBook;
Sheets wsssheets;
_Worksheet wssheet;
|