📄 noticeinfodlg.cpp
字号:
/**
* <p> Title: 对活动对象进行增加,修改功能的页面实现 </p>
* <p> Description:提供对社团,学生,活动对象进行增加,修改功能的处理 </p>
* <p> Copyright: bjut </p>
* <p> Company: bjut </p>
* @author gaok
* @version 1.0
* @Created on 2005-12-17
*/
#include "stdafx.h"
#include "STMis.h"
#include "NoticeInfoDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNoticeInfoDlg dialog
/*
* 构造函数
*/
CNoticeInfoDlg::CNoticeInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNoticeInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CNoticeInfoDlg)
// NOTE: the ClassWizard will add member initialization here
m_dtNotice = 0; // 活动日期
m_tmBegin = 0; // 活动开始时间
m_tmEnd = 0; // 活动结束时间
m_strPlace = _T(""); // 活动地点
m_strSt = _T(""); // 社团
m_strContent = _T(""); // 活动内容
m_strHdNm = _T(""); // 活动内码,主键
//}}AFX_DATA_INIT
}
void CNoticeInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNoticeInfoDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_COMBO_ST, m_ctrSt);
DDX_CBString(pDX, IDC_COMBO_ST, m_strSt);
DDX_Text(pDX, IDC_EDIT_PLACE, m_strPlace);
DDX_Text(pDX, IDC_EDIT_CONTENT, m_strContent);
DDX_DateTimeCtrl(pDX, IDC_DATE, m_dtNotice);
DDX_DateTimeCtrl(pDX, IDC_TIME_BEGIN, m_tmBegin);
DDX_DateTimeCtrl(pDX, IDC_TIME_END, m_tmEnd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNoticeInfoDlg, CDialog)
//{{AFX_MSG_MAP(CNoticeInfoDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNoticeInfoDlg message handlers
/*
* 初始化“所在社团”下拉选项和活动列表
*/
BOOL CNoticeInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CAddStMsgRSet m_recordset(&m_database); // 连接数据库
CString strSQL;
strSQL="select * from ST where ST_SCBZ=false";
if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL))
{
MessageBox("打开数据库失败!","数据库错误",MB_OK);
}
while(!m_recordset.IsEOF())
{
m_ctrSt.AddString(m_recordset.m_ST_ZZMC);
m_recordset.MoveNext();
}
m_database.Close();
if(!m_strHdNm.IsEmpty())
{ // 初始化文本框中得内容
CAddNoticeRSet m_recordset(&m_database); // 连接数据库
strSQL.Format( "select * from HD where HD_NM = '%s' and HD_SCBZ=false",m_strHdNm);
if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL))
{
AfxMessageBox("打开数据库失败!");
return FALSE;
}
m_strPlace = m_recordset.m_HD_HDDD; // 活动地点
m_dtNotice = m_recordset.m_HD_HDRQ; // 活动日期
m_tmBegin = m_recordset.m_HD_HDKSSJ; // 开始时间
m_tmEnd = m_recordset.m_HD_HDJSSJ; // 结束时间
m_strSt = m_recordset.m_HD_ZZMC; // 所属社团
m_strContent = m_recordset.m_HD_HDNR; // 活动内容
m_database.Close();
}
UpdateData(FALSE);
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 + -