📄 newbookedit.cpp
字号:
// newbookedit.cpp : implementation file
//
#include "stdafx.h"
#include "图书管理.h"
#include "newbookedit.h"
#include"newbook.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// newbookedit dialog
newbookedit::newbookedit(CWnd* pParent /*=NULL*/)
: CDialog(newbookedit::IDD, pParent)
{
//{{AFX_DATA_INIT(newbookedit)
m_bookname = _T("");
m_bussname = _T("");
m_shumu = _T("");
m_time = _T("");
//}}AFX_DATA_INIT
}
void newbookedit::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(newbookedit)
DDX_Control(pDX, IDC_COMBO1, m_leixing);
DDX_Text(pDX, IDC_EDIT1, m_bookname);
DDX_Text(pDX, IDC_EDIT2, m_bussname);
DDX_Text(pDX, IDC_EDIT3, m_shumu);
DDX_Text(pDX, IDC_EDIT4, m_time);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(newbookedit, CDialog)
//{{AFX_MSG_MAP(newbookedit)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// newbookedit message handlers
void newbookedit::OnOK()
{
// TODO: Add extra validation here
UpdateData(true);
Cnewbook b;
b.leixing=m_leixing.GetCurSel()+1;
b.bussname=m_bussname;
b.bookname=m_bookname;
b.shumu=m_shumu;
b.time=m_time;
if(b.HaveName(m_bookname)==1&&b.Havebuss(m_bussname)==1)
{
MessageBox("此信息已经存在");
return;
}
b.sql_insert();
CDialog::OnOK();
}
void newbookedit::OnButton3()
{
// TODO: Add your control notification handler code here
UpdateData(true);
Cnewbook b;
if(b.HaveName(m_bookname)==1&&b.Havebuss(m_bussname)==1)
b.sql_delete(m_bookname,m_bussname);
else
{
MessageBox("此信息不存在");
return;
}
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -