?? repairedit.cpp
字號:
// RepairEdit.cpp : implementation file
//
#include "stdafx.h"
#include "AssetsMan.h"
#include "RepairEdit.h"
#include "Repair.h"
#include "AssetsSelectDlg.h"
#include "Assets.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRepairEdit dialog
CRepairEdit::CRepairEdit(CWnd* pParent /*=NULL*/)
: CDialog(CRepairEdit::IDD, pParent)
{
//{{AFX_DATA_INIT(CRepairEdit)
m_AId = _T("");
m_AName = _T("");
m_PostDate = _T("");
m_RDate = COleDateTime::GetCurrentTime();
m_Reason = _T("");
m_Result = _T("");
m_Status = _T("");
m_Total = 0.0f;
m_Unit = _T("");
//}}AFX_DATA_INIT
}
void CRepairEdit::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRepairEdit)
DDX_Text(pDX, IDC_AId, m_AId);
DDX_Text(pDX, IDC_AName, m_AName);
DDX_Text(pDX, IDC_Pdate, m_PostDate);
DDX_DateTimeCtrl(pDX, IDC_RDate, m_RDate);
DDX_Text(pDX, IDC_Reason, m_Reason);
DDX_Text(pDX, IDC_Result, m_Result);
DDX_Text(pDX, IDC_Status, m_Status);
DDX_Text(pDX, IDC_Total, m_Total);
DDX_Text(pDX, IDC_Unit, m_Unit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRepairEdit, CDialog)
//{{AFX_MSG_MAP(CRepairEdit)
ON_BN_CLICKED(IDC_AssetsSelect, OnAssetsSelect)
ON_BN_CLICKED(IDC_Save, OnSave)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRepairEdit message handlers
void CRepairEdit::OnAssetsSelect()
{
// TODO: Add your control notification handler code here
CAssetsSelectDlg dlg;
if(dlg.DoModal()==IDOK)
{
// 取得選擇的固定資產信息
m_AId = AssetsId;
m_AName = AssetsName;
UpdateData(FALSE);
}
}
void CRepairEdit::OnSave()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
// 定義時間
CString cRDate,cPDate;
CTime t = CTime::GetCurrentTime();
cPDate.Format("%04d-%02d-%02d",t.GetYear(),t.GetMonth(),t.GetDay());
// 定義對象并給屬性賦值
CRepair cRp;
cRp.SetAid(m_AId);
cRp.SetReason(m_Reason);
cRp.SetUnit(m_Unit);
cRp.SetResult(m_Result);
cRp.SetTotal(m_Total);
cRp.SetStatus(0);
cRDate = m_RDate.Format("%Y-%m-%d");
cRp.SetRepairDate(cRDate);
cRp.SetPostDate(cPDate);
if(cRId=="")
cRp.sql_Insert();
else
cRp.sql_Update(cRId);
OnOK();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -