deletestaff.cpp
上传用户:xz12345
上传日期:2007-09-12
资源大小:7437k
文件大小:2k
- // deletestaff.cpp : implementation file
- //
- #include "stdafx.h"
- #include "工资.h"
- #include "deletestaff.h"
- #include "yuangong.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // deletestaff dialog
- deletestaff::deletestaff(CWnd* pParent /*=NULL*/)
- : CDialog(deletestaff::IDD, pParent)
- {
- //{{AFX_DATA_INIT(deletestaff)
- m_empid = _T("");
- //}}AFX_DATA_INIT
- }
- void deletestaff::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(deletestaff)
- DDX_Text(pDX, IDC_EDIT1, m_empid);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(deletestaff, CDialog)
- //{{AFX_MSG_MAP(deletestaff)
- ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
- ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // deletestaff message handlers
- void deletestaff::OnButton3()
- {
-
- yuangong raky;
- UpdateData(TRUE);
- raky.cempid=m_empid;
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL="delete from yuangonggongzi where empid='"+raky.cempid+"'";
- m_AdoConn.OnInitADOConn();
- //执行INSERT语句
- m_AdoConn.ExecuteSQL(vSQL);
- vSQL="delete from kaoqinxinxi where empid='"+raky.cempid+"'";
- m_AdoConn.ExecuteSQL(vSQL);
-
- //断开与数据库的连接
- m_AdoConn.ExitConnect();
- raky.sql_delete();
-
- CDialog::OnOK();
-
- // TODO: Add your control notification handler code here
-
- }
- void deletestaff::OnButton4()
- {
- CDialog::OnCancel();
- // TODO: Add your control notification handler code here
-
- }