📄 ygjbgzdlg.cpp
字号:
// Ygjbgzdlg.cpp : implementation file
//
#include "stdafx.h"
#include "GZGLXT.h"
#include "Ygjbgzdlg.h"
#include "Columns.h"
#include "Column.h"
#include "COMDEF.H"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CYgjbgzdlg dialog
CYgjbgzdlg::CYgjbgzdlg(CWnd* pParent /*=NULL*/)
: CDialog(CYgjbgzdlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CYgjbgzdlg)
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDI_JBGZICON);
}
void CYgjbgzdlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CYgjbgzdlg)
DDX_Control(pDX, IDC_ADODC1, m_ad);
DDX_Control(pDX, IDC_DATACOMBO1, m_dc);
DDX_Control(pDX, IDC_DATAGRID1, m_da);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CYgjbgzdlg, CDialog)
//{{AFX_MSG_MAP(CYgjbgzdlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CYgjbgzdlg message handlers
BOOL CYgjbgzdlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetIcon(m_hIcon, TRUE);
_variant_t vIndex;
vIndex=long(0);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(1);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(2);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(3);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(4);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(5);
m_da.GetColumns().GetItem(vIndex).SetWidth(75);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CYgjbgzdlg::OnOK()
{
// TODO: Add extra validation here
CString str;
str = m_dc.GetText();
m_ad.SetRecordSource("SELECT YGid AS 员工编号,YGxm AS 员工姓名,JBgz AS 基本工资,GLgz AS 工龄工资,ZWgz AS 职务工资,YLbxj AS 养老保险金 FROM Ygjbgzb WHERE YGid='"+str+"' ");
m_ad.Refresh();
_variant_t vIndex;
vIndex=long(0);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(1);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(2);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(3);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(4);
m_da.GetColumns().GetItem(vIndex).SetWidth(60);
vIndex=long(5);
m_da.GetColumns().GetItem(vIndex).SetWidth(75);
//CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -