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

📄 pswdlg.cpp

📁 一个企业订单管理流程的例子
💻 CPP
字号:
// PswDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Invoice.h"
#include "PswDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPswDlg dialog


CPswDlg::CPswDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPswDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPswDlg)
	m_pass = _T("*****");
	//}}AFX_DATA_INIT
}


void CPswDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPswDlg)
	DDX_Control(pDX, IDC_COMBO_USER, m_combo_user);
	DDX_Text(pDX, IDC_EDIT_PASS, m_pass);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CPswDlg message handlers

void CPswDlg::OnOK() 
{
	// TODO: Add extra validation here

	CString m_psw;
	CTime DToday;

	UpdateData(TRUE);
	
	m_combo_user.GetLBText(m_combo_user.GetCurSel(),m_user);

	DToday=CTime::GetCurrentTime();
	m_flag=0;	
	
	/////////////////////////////////
	if(m_user=="一诚"||m_user=="ald")
	{
		m_psw.Format("ald%02d%02d",
		DToday.GetDay(),
		DToday.GetHour());
	
		if(m_pass==m_psw)
		{
			m_flag=1;
		}
		else
		{
			m_psw.Format("口令错误!\r%02d日%02d时",
			DToday.GetDay(),
			DToday.GetHour());
			AfxMessageBox(m_psw);

			return;
		}

		CDialog::OnOK();
		
		return;
	}

	///////////////////////////////////////////
	if(m_user=="LKJ_RK0")
	{
		m_psw.Format("lkj%02d%02d",
		DToday.GetDay(),
		DToday.GetHour());
	
		if(m_pass==m_psw)
		{
			m_flag=1;
		}
		else
		{
			m_psw.Format("口令错误!\r%02d日%02d时",
			DToday.GetDay(),
			DToday.GetHour());
			AfxMessageBox(m_psw);

			return;
		}
		
		CDialog::OnOK();
		
		return;
	}

	if(m_user=="LKJ_RK1")
	{
		m_psw.Format("kjkj%02d%02d",
		DToday.GetDay(),
		DToday.GetHour());
	
		if(m_pass==m_psw)
		{
			m_flag=1;
		}
		else
		{
			m_psw.Format("口令错误!\r%02d日%02d时",
			DToday.GetDay(),
			DToday.GetHour());
			AfxMessageBox(m_psw);

			return;
		}
		
		CDialog::OnOK();
		
		return;
	}

	AfxMessageBox("用户帐号错误!");
		
 //	CDialog::OnOK();
		
	return;	
}

void CPswDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	m_flag=0;
	
	CDialog::OnCancel();
}

BOOL CPswDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	m_combo_user.AddString("一诚");
	m_combo_user.AddString("ald");
	m_combo_user.AddString("LKJ_RK0");
	m_combo_user.AddString("LKJ_RK1");
	m_combo_user.SetCurSel(1);
	
	m_flag=0;

	return TRUE;  // return TRUE  unless you set the focus to a control
}

⌨️ 快捷键说明

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