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

📄 seltypedlg.cpp

📁 VC + SQL数据库编程 人事、工资、部门管理 包含SQL备份文件及部分源码注释
💻 CPP
字号:
// SelTypeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "HrSys.h"
#include "SelTypeDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSelTypeDlg dialog


CSelTypeDlg::CSelTypeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSelTypeDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSelTypeDlg)
	//}}AFX_DATA_INIT
}


void CSelTypeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSelTypeDlg)
	DDX_Control(pDX, IDC_LIST1, m_List);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSelTypeDlg, CDialog)
	//{{AFX_MSG_MAP(CSelTypeDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelTypeDlg message handlers

void CSelTypeDlg::OnOK() 
{
	// TODO: Add extra validation herecUserType =
	UpdateData(TRUE); //将用户输入的数据读取到成员变量中

	int cnt;
	cnt = m_List.GetCount();		//读取记录个数
	CString cType;
	for(int a=0;a<cnt;a++)
	{
		if(m_List.GetSel(a))		// 如果选择了当前项,则添加到cUserType中
		{
			m_List.GetText(a,cType);  //获取选择内容
			if(cUserType == "")
				cUserType = cType;
			else
				cUserType = cUserType + "," + cType;
		}
	}
	CDialog::OnOK();
}

BOOL CSelTypeDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//装入所有的用户类型
	m_List.AddString("普通用户");
	m_List.AddString("系统管理员");
	m_List.AddString("人事专员");
	m_List.AddString("培训管理员");
	m_List.AddString("车辆管理员");
	m_List.AddString("会议室管理员");
	m_List.AddString("资料管理员");
	m_List.AddString("客户管理员");
	m_List.AddString("客户代表");
	m_List.AddString("库存管理员");

	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 + -