4.4 工单结算模块的实现
新建立一个类CJobSettle继承于CDialog,设计窗体如下,两个Edit控件,分别与类的变量m_username, m_password相关联。
(1).预先选择派遣工单
CString str_id;
CADORecordset* pRs = new CADORecordset(((CRepairServiceApp*)AfxGetApp())->g_pDb);
CString sqlcommand="select repair_id from repair_relation where status = 0";
if(pRs->Open((LPCTSTR)sqlcommand))
{
while(!pRs->IsEof())
{
pRs->GetFieldValue("repair_id",str_id);
((CComboBox*)GetDlgItem(IDC_COMBO1))->AddString(str_id);
pRs->MoveNext();
}
pRs->Close();
}
(2) 工单结算
UpdateData();
if(m_id == "")
{
AfxMessageBox("工单号不允许为空");
return;
}
CString sqlcommand;
CString str_finish_time;
str_finish_time=m_finish_time.Format("%Y-%m-%d");
CString str_fac_settle_time; str_fac_settle_time=m_fac_settle_time.Format("%Y-%m-%d");
|