?? querydlg.cpp
字號:
// QueryDlg.cpp : implementation file
//
#include "stdafx.h"
#include "teachermis.h"
#include "QueryDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQueryDlg dialog
CQueryDlg::CQueryDlg(CWnd* pParent /*=NULL*/)
: CDialog(CQueryDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CQueryDlg)
m_editID = _T("");
m_editName = _T("");
m_comboJobtitle = _T("");
m_comboeducation = _T("");
m_editAge = _T("");
//}}AFX_DATA_INIT
}
void CQueryDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQueryDlg)
DDX_Control(pDX, IDC_COMBO_SEX, m_comboSex);
DDX_Control(pDX, IDC_COMBO_EDUCATION, m_comboEducation);
DDX_Control(pDX, IDC_COMBO_JOBTITLE, m_comboJobTitle);
DDX_Control(pDX, IDC_COMBO_ORIENTATION, m_comboOrientation);
DDX_Control(pDX, IDC_COMBO_KIND, m_comboKind);
DDX_Control(pDX, IDC_COMBO_POST, m_comboPost);
DDX_Text(pDX, IDC_EDIT_ID, m_editID);
DDX_Text(pDX, IDC_EDIT_NAME, m_editName);
DDX_CBString(pDX, IDC_COMBO_JOBTITLE, m_comboJobtitle);
DDX_CBString(pDX, IDC_COMBO_EDUCATION, m_comboeducation);
DDX_Text(pDX, IDC_EDIT_AGE, m_editAge);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQueryDlg, CDialog)
//{{AFX_MSG_MAP(CQueryDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CQueryDlg message handlers
void CQueryDlg::OnOK()
{
UpdateData(true);
CString kind,sex,post,jobTitle,orientation,education;
m_comboSex.GetWindowText(sex);
m_comboKind.GetWindowText(kind);
m_comboPost.GetWindowText(post);
m_comboJobTitle.GetWindowText(jobTitle);
m_comboOrientation.GetWindowText(orientation);
m_comboEducation.GetWindowText(education);
strQuery="";
if(m_editID!="")
strQuery+=" and id="+m_editID;
if(m_editName!="")
{
strQuery+=" and name='"+m_editName;
strQuery+="'";
}
if(m_editAge!="")
strQuery+=" and age="+m_editAge;
if(sex!="")
{
strQuery+=" and sex='"+sex;
strQuery+="'";
}
if(kind!="")
{
strQuery+=" and kind='"+kind;
strQuery+="'";
}
if(post!="")
{
strQuery+=" and post='"+post;
strQuery+="'";
}
if(jobTitle!="")
{
strQuery+=" and job_title='"+jobTitle;
strQuery+="'";
}
if(orientation!="")
{
strQuery+=" and orientation='"+orientation;
strQuery+="'";
}
if(education!="")
{
strQuery+=" and education='"+education;
strQuery+="'";
}
CDialog::OnOK();
}
BOOL CQueryDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_comboSex.AddString("");
m_comboSex.AddString("男");
m_comboSex.AddString("女");
m_comboSex.SetCurSel(0);
m_comboKind.AddString("");
m_comboKind.AddString("行政人員");
m_comboKind.AddString("教師");
m_comboKind.AddString("一般員工");
m_comboKind.AddString("退休人員");
m_comboKind.AddString("返聘人員");
m_comboKind.AddString("臨時工");
m_comboKind.SetCurSel(0);
m_comboPost.AddString("");
m_comboPost.AddString("無");
m_comboPost.AddString("科級");
m_comboPost.AddString("處級");
m_comboPost.AddString("地級");
m_comboPost.SetCurSel(0);
m_comboJobTitle.AddString("");
m_comboJobTitle.AddString("無");
m_comboJobTitle.AddString("初級");
m_comboJobTitle.AddString("中級");
m_comboJobTitle.AddString("高級");
m_comboJobTitle.SetCurSel(0);
m_comboOrientation.AddString("");
m_comboOrientation.AddString("群眾");
m_comboOrientation.AddString("中共黨員");
m_comboOrientation.AddString("民主黨派");
m_comboOrientation.SetCurSel(0);
m_comboEducation.AddString("");
m_comboEducation.AddString("中專");
m_comboEducation.AddString("大專");
m_comboEducation.AddString("大學");
m_comboEducation.AddString("碩士");
m_comboEducation.AddString("博士");
m_comboEducation.SetCurSel(0);
return TRUE;
}
void CQueryDlg::setStrQuery(CString query)
{
strQuery=query;
}
CString CQueryDlg::getStrQuery()
{
return strQuery;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -