insertstaff.cpp
上传用户:xz12345
上传日期:2007-09-12
资源大小:7437k
文件大小:3k
- // insertstaff.cpp : implementation file
- //
- #include "stdafx.h"
- #include "yuangong.h"
- #include "工资.h"
- #include "insertstaff.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // insertstaff dialog
- insertstaff::insertstaff(CWnd* pParent /*=NULL*/)
- : CDialog(insertstaff::IDD, pParent)
- {
- //{{AFX_DATA_INIT(insertstaff)
- m_name = _T("");
- m_yuangongID = _T("");
- //}}AFX_DATA_INIT
- }
- void insertstaff::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(insertstaff)
- DDX_Control(pDX, IDC_COMBO_xingbie, m_xingbie);
- DDX_Text(pDX, IDC_EDIT_name, m_name);
- DDX_Text(pDX, IDC_EDIT_yuangongID, m_yuangongID);
- DDX_Control(pDX, IDC_DATACOMBO1_bumen, m_bumenID);
- DDX_Control(pDX, IDC_DATACOMBO3_zhiwei, m_zhiwei);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(insertstaff, CDialog)
- //{{AFX_MSG_MAP(insertstaff)
- ON_BN_CLICKED(IDC_ok, Onok)
- ON_EN_CHANGE(IDC_EDIT_yuangongID, OnChangeEDITyuangongID)
- ON_BN_CLICKED(IDC_cancel, Oncancel)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // insertstaff message handlers
- void insertstaff::Onok()
- {
- int index;
- yuangong raky;
- UpdateData(TRUE);
- raky.cempid=m_yuangongID;
- index = m_xingbie.GetCurSel();
- if (index == 0)
- raky.sex = "F";
- else
- raky.sex = "M";
- raky.depID=m_bumenID.GetBoundText();
- raky.pos=m_zhiwei.GetText();
- raky.empname=m_name;
-
-
-
-
- raky.sql_insert();
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL="INSERT INTO kaoqinxinxi(empid,empname,chidaon,zaotuin,pstime,zmtime,fdtime) VALUES('"+raky.cempid+"','"+raky.empname+"','0','0','0','0','0')";
- m_AdoConn.OnInitADOConn();
- //执行INSERT语句
- m_AdoConn.ExecuteSQL(vSQL);
- //断开与数据库的连接
- vSQL="DELETE FROM yuangonggongzi";
- m_AdoConn.ExecuteSQL(vSQL);
- vSQL="EXEC base7";
- m_AdoConn.ExecuteSQL(vSQL);
- m_AdoConn.ExitConnect();
-
- CDialog::OnOK();
- // TODO: Add your control notification handler code here
-
- }
- void insertstaff::OnChangeEDITyuangongID()
- {
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function and call CRichEditCtrl().SetEventMask()
- // with the ENM_CHANGE flag ORed into the mask.
-
- // TODO: Add your control notification handler code here
-
- }
- void insertstaff::Oncancel()
- {
- CDialog::OnCancel();
- // TODO: Add your control notification handler code here
-
- }