deletebumen.cpp
上传用户:xz12345
上传日期:2007-09-12
资源大小:7437k
文件大小:2k
- // deletebumen.cpp : implementation file
- //
- #include "stdafx.h"
- #include "工资.h"
- #include "deletebumen.h"
- #include "bumenxinxi.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // deletebumen dialog
- deletebumen::deletebumen(CWnd* pParent /*=NULL*/)
- : CDialog(deletebumen::IDD, pParent)
- {
- //{{AFX_DATA_INIT(deletebumen)
- m_bmid = _T("");
- //}}AFX_DATA_INIT
- }
- void deletebumen::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(deletebumen)
- DDX_Text(pDX, IDC_EDIT1, m_bmid);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(deletebumen, CDialog)
- //{{AFX_MSG_MAP(deletebumen)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // deletebumen message handlers
- void deletebumen::OnButton1()
- {
- UpdateData(TRUE);
- bumenxinxi box;
- box.bmid=m_bmid;
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL="select empid from yuangongxinxi where yuangongxinxi.depid='"+m_bmid+"'";
- m_AdoConn.OnInitADOConn();
- _RecordsetPtr m_pRecordset;
- m_pRecordset = m_AdoConn.GetRecordSet(vSQL);
- if (m_pRecordset->adoEOF)
- {box.sql_delete();
- CDialog::OnOK();}
- else
- MessageBox("sorry,you must delete the empolyee that blong to this department first!");
- //执行INSERT语句
- m_AdoConn.ExecuteSQL(vSQL);
-
- //断开与数据库的连接
- // m_AdoConn.ExitConnect();
-
-
- // TODO: Add your control notification handler code here
-
- }
- void deletebumen::OnButton2()
- {
- CDialog::OnCancel();
- // TODO: Add your control notification handler code here
-
- }