📄 yuangongjinglieditdlg.cpp
字号:
// YuangongJingliEditDlg.cpp : implementation file
//
#include "stdafx.h"
#include "renshi.h"
#include "YuangongJingliEditDlg.h"
#include "class\jingli.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CYuangongJingliEditDlg dialog
CYuangongJingliEditDlg::CYuangongJingliEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CYuangongJingliEditDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CYuangongJingliEditDlg)
m_Org = _T("");
m_Title = _T("");
//}}AFX_DATA_INIT
}
void CYuangongJingliEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CYuangongJingliEditDlg)
DDX_Control(pDX, IDC_DATETIMEPICKER2, m_EDate);
DDX_Control(pDX, IDC_DATETIMEPICKER1, m_SDate);
DDX_Text(pDX, IDC_ORG_EDIT, m_Org);
DDX_Text(pDX, IDC_TITLE_EDIT, m_Title);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CYuangongJingliEditDlg, CDialog)
//{{AFX_MSG_MAP(CYuangongJingliEditDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CYuangongJingliEditDlg message handlers
void CYuangongJingliEditDlg::OnOK()
{
UpdateData(TRUE);
CTime tt1,tt2;
m_SDate.GetTime(tt1);
if (tt1.Format("%Y-%m-%d") == "")
{
MessageBox("请输入开始日期");
return;
}
m_EDate.GetTime(tt2);
if (tt2.Format("%Y-%m-%d") == "")
{
MessageBox("请输入结束日期");
return;
}
if (m_Org == "")
{
MessageBox("请输入学校/单位");
return;
}
CJingli exp;
exp.SetStartDate(tt1.Format("%Y-%m-%d"));
exp.SetEndDate(tt2.Format("%Y-%m-%d"));
exp.SetUnit(m_Org);
exp.SetTitle(m_Title);
exp.Setyg_ID(iYgID);
if (cID == "") //插入数据
exp.sql_insert();
else
exp.sql_update(cID);
CDialog::OnOK();
}
BOOL CYuangongJingliEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
if(!this->__StartTime.IsEmpty())
{
int y=atoi(strtok(__StartTime.GetBuffer(0),"-"));
int m=atoi(strtok(NULL,"-"));
int d=atoi(strtok(NULL,"-"));
CTime tt1(y,m,d,12,25,25);
m_SDate.SetTime(&tt1);
y=atoi(strtok(__EndTime.GetBuffer(0),"-"));
m=atoi(strtok(NULL,"-"));
d=atoi(strtok(NULL,"-"));
CTime tt(y,m,d,12,25,25);
m_EDate.SetTime(&tt);
}
else
{
CTime t=CTime::GetCurrentTime();
m_SDate.SetTime(&t);
m_EDate.SetTime(&t);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -