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

📄 returnbook.cpp

📁 java 大作业 《处方跟踪系统》源代码 gui界面
💻 CPP
字号:
// ReturnBook.cpp : implementation file
//

#include "stdafx.h"
#include "libraryMS.h"
#include "ReturnBook.h"
#include "Borrow.h"

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

/////////////////////////////////////////////////////////////////////////////
// CReturnBook dialog

CBorrow Borrow;
extern CReader BReader;
extern CBook BBook;
CReturnBook::CReturnBook(CWnd* pParent /*=NULL*/)
	: CDialog(CReturnBook::IDD, pParent)
{
	//{{AFX_DATA_INIT(CReturnBook)
	m_vISBN = _T("");
	//}}AFX_DATA_INIT
}


void CReturnBook::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CReturnBook)
	DDX_Control(pDX, IDC_NameReader, m_vNameReader);
	DDX_Control(pDX, IDC_IDReader, m_vIDReader);
	DDX_Control(pDX, IDC_Fine, m_vFine);
	DDX_Control(pDX, IDC_Book_Title, m_vTitle);
	DDX_Text(pDX, IDC_ISBN, m_vISBN);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CReturnBook, CDialog)
	//{{AFX_MSG_MAP(CReturnBook)
	ON_BN_CLICKED(IDC_suer, Onsuer)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CReturnBook message handlers

BOOL CReturnBook::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	GetDlgItem(IDOK)->EnableWindow(false);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CReturnBook::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

void CReturnBook::Onsuer() 
{
	// TODO: Add your control notification handler code here
		UpdateData(true);
	////////////////////////////////////////////////////////检查ISBN是否正确
	m_vISBN.TrimLeft();
	m_vISBN.TrimRight();
	if(m_vISBN.IsEmpty())
	{
		MessageBox("ISBN不能为空");
		return;
	}
    Borrow.GetData(m_vISBN);
	//CString strNM,strID,strF,strT;
	m_vNameReader.SetWindowText(Borrow.GetNameReader());
    m_vIDReader.SetWindowText(Borrow.GetIDReader());
    m_vTitle.SetWindowText(Borrow.GetTitle());
	UpdateData(false);
	if(Borrow.GetNameReader().IsEmpty())
	{
		MessageBox("没有这本书的资料");
		return;
	}
    GetDlgItem(IDOK)->EnableWindow(true);
	
}

void CReturnBook::OnOK() 
{
	// TODO: Add extra validation here
	Borrow.sql_delete(m_vISBN);
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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