YGJBXJDLG.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:3k
源码类别:
数据库编程
开发平台:
Visual C++
- // Ygjbxjdlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "Ygjbxjdlg.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
- /////////////////////////////////////////////////////////////////////////////
- // CYgjbxjdlg dialog
- CYgjbxjdlg::CYgjbxjdlg(CWnd* pParent /*=NULL*/)
- : CDialog(CYgjbxjdlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CYgjbxjdlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- m_hIcon = AfxGetApp()->LoadIcon(IDI_JBSJICON);
- }
- void CYgjbxjdlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CYgjbxjdlg)
- 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(CYgjbxjdlg, CDialog)
- //{{AFX_MSG_MAP(CYgjbxjdlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CYgjbxjdlg message handlers
- BOOL CYgjbxjdlg::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(60);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CYgjbxjdlg::OnOK()
- {
- // TODO: Add extra validation here
- CString str;
- str = m_dc.GetText();
- m_ad.SetRecordSource("SELECT YGid AS 员工编号,YGxm AS 员工姓名,JiaBts AS 加班天数,JiaBgz AS 加班工资,SJts AS 事假天数,SJkk AS 事假扣款 FROM Ygjbsjb 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(60);
- //CDialog::OnOK();
- }