⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deletename.cpp

📁 应用vc+sqlserver做的一个保卫处数据管理系统
💻 CPP
字号:
// DeleteName.cpp : implementation file
//

#include "stdafx.h"
#include "横店集团保卫人员管理系统.h"
#include "DeleteName.h"
#include "yonghu.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDeleteName dialog


CDeleteName::CDeleteName(CWnd* pParent /*=NULL*/)
	: CDialog(CDeleteName::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDeleteName)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDeleteName::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDeleteName)
	DDX_Control(pDX, IDC_COMBO1, m_name);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDeleteName, CDialog)
	//{{AFX_MSG_MAP(CDeleteName)
	ON_BN_CLICKED(IDC_BUTTON1, Ondelete)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDeleteName message handlers

void CDeleteName::Ondelete() 
{
	int i=m_name.GetCurSel();
	if(i!=-1)
	{
      CString str;
	  m_name.GetLBText(i,str);
	  CYonghu y;
	  y.m_strFilter="用户名='"+str+"'";
	  y.Open();
	  y.Delete();
	  y.MoveNext();
	  if(y.IsBOF())
		  y.MoveFirst();
	  y.Close();
	  MessageBox("删除成功");
	  this->OnOK();
	}
	
}

BOOL CDeleteName::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
    CYonghu y;
	y.Open();
	while(!y.IsEOF())
	{
		m_name.AddString(y.m_name);
		y.MoveNext();
	}
	y.Close();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -