YGJCSCDLG.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:3k
源码类别:
数据库编程
开发平台:
Visual C++
- // Ygjcscdlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "Ygjcscdlg.h"
- #include "Ygfdgzxmb.h"
- #include "Ygjbgzb.h"
- #include "Ygjcxxb.h"
- #include "Gzffmxb.h"
- #include "Ygjbsjb.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CYgjcscdlg dialog
- CYgjcscdlg::CYgjcscdlg(CWnd* pParent /*=NULL*/)
- : CDialog(CYgjcscdlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CYgjcscdlg)
- //}}AFX_DATA_INIT
- m_hIcon = AfxGetApp()->LoadIcon(IDI_YGSCICON);
- }
- void CYgjcscdlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CYgjcscdlg)
- DDX_Control(pDX, IDC_LIST1, m_list);
- DDX_Control(pDX, IDC_COMBO1, m_combo);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CYgjcscdlg, CDialog)
- //{{AFX_MSG_MAP(CYgjcscdlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CYgjcscdlg message handlers
- void CYgjcscdlg::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData(true);
- CString str;
- m_combo.GetWindowText(str);
- if(MessageBox("是否删除当前记录?","请确认!",MB_YESNO)==IDYES)
- {
- CYgjcxxb xxb;
- xxb.sql_delete(str);
- CYgfdgzxmb xmb;
- xmb.sql_delete(str);
- CYgjbgzb gzb;
- gzb.sql_delete(str);
- CGzffmxb mxb;
- mxb.sql_delete(str);
- CYgjbsjb sjb;
- sjb.sql_delete(str);
- }
- CDialog::OnOK();
- }
- BOOL CYgjcscdlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- SetIcon(m_hIcon, TRUE);
- UpdateData(true);
- CYgjcxxb xxb;
- xxb.Load_dep();
- for(int i=0;i<xxb.a_ygid.GetSize();i++)
- {
- m_combo.AddString(xxb.a_ygid.GetAt(i));
- }
- m_list.SetExtendedStyle(LVS_EX_FLATSB
- |LVS_EX_FULLROWSELECT
- |LVS_EX_GRIDLINES);
- m_list.InsertColumn(0,"员工编号",LVCFMT_LEFT,100,0);
- m_list.InsertColumn(1,"员工姓名",LVCFMT_LEFT,100,1);
- m_list.InsertColumn(2,"员工性别",LVCFMT_LEFT,100,2);
- m_list.InsertColumn(3,"文化程度",LVCFMT_LEFT,100,3);
- for(i=0;i<xxb.a_ygid.GetSize();i++)
- {
- m_list.InsertItem(0,"");
- m_list.SetItemText(0,0,xxb.a_ygid.GetAt(i));
- m_list.SetItemText(0,1,xxb.a_name.GetAt(i));
- m_list.SetItemText(0,2,xxb.a_sex.GetAt(i));
- m_list.SetItemText(0,3,xxb.a_whcd.GetAt(i));
- }
- UpdateData(false);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }