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

📄 dialogin.cpp

📁 用于单位文档管理系统
💻 CPP
字号:
// Dialogin.cpp : implementation file
//

#include "stdafx.h"
#include "WordGLXT.h"
#include "Dialogin.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogin dialog


CDialogin::CDialogin(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogin::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogin)
	m_name = _T("");
	m_pwd = _T("");
	//}}AFX_DATA_INIT
	m_hIcon = AfxGetApp()->LoadIcon(IDI_ICONLOGIN);
}


void CDialogin::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogin)
	DDX_Text(pDX, IDC_EDIT1, m_name);
	DDX_Text(pDX, IDC_EDIT2, m_pwd);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDialogin message handlers

BOOL CDialogin::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetIcon(m_hIcon, TRUE);	
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDialogin::OnOK() 
{
	// TODO: Add extra validation here
	//将对话框中编辑框的数据读取到成员变量中
	UpdateData(true);
	//检查数据有效性
	if(m_name=="")
	{
		MessageBox("请输入用户名","文档管理系统");
		return;
	}
	if(m_pwd=="")
	{
		MessageBox("请输入密码");
		return;
	}
	//如果读取数据和用户输入不同,则返回
	if(user.HaveCzy(m_name,m_pwd)!=1)
	{
		MessageBox("用户名或密码错误!","文档管理系统");
		return;
	}
	user.SetUsername(m_name);
	//判断用户级别
	jb="1";
	if(user.HaveCzyjb(m_name,m_pwd,jb)==1)
	{
		user.SetJB(jb);
	}
	else
	{
		user.SetJB("0");
	}
	//读取当前系统时间
	t=CTime::GetCurrentTime();
	//将登录动作记录到日志表
	zhi.SetDLsj(t.Format("%y-%m-%d"));
	zhi.SetName(user.GetUsername());
	zhi.SetDZ("登录");
	zhi.sql_insert();
	CDialog::OnOK();
}

⌨️ 快捷键说明

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