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

📄 readerinfo.cpp

📁 图书管理系统 带源码 文档
💻 CPP
字号:
// ReaderInfo.cpp : implementation file
//

#include "stdafx.h"
#include "Library.h"
#include "ReaderInfo.h"
#include "ReaderInfoChange.h"
#include "ChangePW.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CReader ReaderUser;
///////////////////////////////////////////////////////////////////////////
// CReaderInfo dialog


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


void CReaderInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CReaderInfo)
	DDX_Text(pDX, IDC_ADD, m_address);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CReaderInfo, CDialog)
	//{{AFX_MSG_MAP(CReaderInfo)
	ON_BN_CLICKED(IDC_BTN_MODIFY, OnBtnModify)
	ON_BN_CLICKED(IDC_BTN_CHANGE_PW, OnBtnChangePw)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CReaderInfo message handlers

BOOL CReaderInfo::OnInitDialog() 
{
	CDialog::OnInitDialog();
	//m_address = ReaderUser.GetAddress();
	//UpdateData(true);
	// TODO: Add extra initialization here
	CString strPay,strBro,strHis;
	strPay.Format("%g",ReaderUser.GetPay());
	strBro.Format("%d",ReaderUser.GetBrNum());
	strHis.Format("%d",ReaderUser.GetTotalNum());

	GetDlgItem(IDC_RNO)->SetWindowText(ReaderUser.GetNo());
	GetDlgItem(IDC_NAME)->SetWindowText(ReaderUser.GetName());
	GetDlgItem(IDC_TYPE)->SetWindowText(ReaderUser.GetType());
	GetDlgItem(IDC_SEX)->SetWindowText(ReaderUser.GetSex());
	GetDlgItem(IDC_ADD)->SetWindowText(ReaderUser.GetAddress());
	GetDlgItem(IDC_TEL)->SetWindowText(ReaderUser.GetTel());
	GetDlgItem(IDC_PAY)->SetWindowText(strPay);
	GetDlgItem(IDC_BORROW)->SetWindowText(strBro);
	GetDlgItem(IDC_HISTORY)->SetWindowText(strHis);
	CString str;
	if (ReaderUser.GetType() == "学生")
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 同学");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
	else if (ReaderUser.GetType() == "教师")
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 老师");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
	else
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 用户");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CReaderInfo::OnBtnModify() 
{
	// TODO: Add your control notification handler code here
	CReaderInfoChange dlg;
	dlg.DoModal();
	CString strPay,strBro,strHis;
	strPay.Format("%g",ReaderUser.GetPay());
	strBro.Format("%d",ReaderUser.GetBrNum());
	strHis.Format("%d",ReaderUser.GetTotalNum());

	GetDlgItem(IDC_RNO)->SetWindowText(ReaderUser.GetNo());
	GetDlgItem(IDC_NAME)->SetWindowText(ReaderUser.GetName());
	GetDlgItem(IDC_TYPE)->SetWindowText(ReaderUser.GetType());
	GetDlgItem(IDC_SEX)->SetWindowText(ReaderUser.GetSex());
	GetDlgItem(IDC_ADD)->SetWindowText(ReaderUser.GetAddress());
	GetDlgItem(IDC_TEL)->SetWindowText(ReaderUser.GetTel());
	GetDlgItem(IDC_PAY)->SetWindowText(strPay);
	GetDlgItem(IDC_BORROW)->SetWindowText(strBro);
	GetDlgItem(IDC_HISTORY)->SetWindowText(strHis);
	CString str;
	if (ReaderUser.GetType() == "学生")
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 同学");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
	else if (ReaderUser.GetType() == "教师")
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 老师");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
	else
	{
		str.Format("%s%s%s","欢迎你, ", ReaderUser.GetName(), " 用户");
		GetDlgItem(IDC_WELCOME)->SetWindowText(str);
	}
}

void CReaderInfo::OnBtnChangePw() 
{
	// TODO: Add your control notification handler code here
	CChangePW dlg;
	dlg.DoModal();
}

⌨️ 快捷键说明

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