📄 qkdjoperation.cpp
字号:
// QKDJOPERATION.cpp : implementation file
//
#include "stdafx.h"
#include "QKDJ.h"
#include "QKDJOPERATION.h"
#include "ADOConn.h"
#include "qikan.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQKDJOPERATION dialog
CQKDJOPERATION::CQKDJOPERATION(CWnd* pParent /*=NULL*/)
: CDialog(CQKDJOPERATION::IDD, pParent)
{
//{{AFX_DATA_INIT(CQKDJOPERATION)
m_bookname = _T("");
m_bookshelfnum = _T("");
m_publicationnum = _T("");
m_readingroom = _T("");
m_copynum = 0;
m_issn = _T("");
//}}AFX_DATA_INIT
}
void CQKDJOPERATION::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQKDJOPERATION)
DDX_Text(pDX, IDC_BOOKNAME, m_bookname);
DDX_Text(pDX, IDC_BOOKSHELFNUM, m_bookshelfnum);
DDX_Text(pDX, IDC_PUBLICATIONNUM, m_publicationnum);
DDX_CBString(pDX, IDC_READINGROOM, m_readingroom);
DDX_Text(pDX, IDC_COPYNUM, m_copynum);
DDX_Text(pDX, IDC_ISSN, m_issn);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQKDJOPERATION, CDialog)
//{{AFX_MSG_MAP(CQKDJOPERATION)
ON_BN_CLICKED(IDC_Zhoukan, OnZhoukan)
ON_BN_CLICKED(IDC_Yuekan, OnYuekan)
ON_BN_CLICKED(IDC_Xunkan, OnXunkan)
ON_BN_CLICKED(IDC_Qita, OnQita)
ON_BN_CLICKED(IDC_Jikan, OnJikan)
ON_BN_CLICKED(IDC_Banyuekan, OnBanyuekan)
ON_BN_CLICKED(IDC_Shuangyuekan, OnShuangyuekan)
ON_BN_CLICKED(IDC_INSERT, OnInsert)
ON_BN_CLICKED(IDC_SELECT, OnSelect)
ON_BN_CLICKED(IDC_UPDATE, OnUpdate)
ON_BN_CLICKED(IDC_DELETE, OnDelete)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CQKDJOPERATION::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// 添加阅览室
((CComboBox*)GetDlgItem(IDC_READINGROOM))->ResetContent();
ADOConn m_AdoConn;
_bstr_t vSQL;
vSQL="select * from readingroom";
_RecordsetPtr m_pRecordset;
m_pRecordset=m_AdoConn.GetRecordSet(vSQL);
while(!(m_pRecordset->adoEOF))
{
((CComboBox*)GetDlgItem(IDC_READINGROOM))->AddString((LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("readingroom"));
m_pRecordset->MoveNext();
}
m_bookname="";
m_copynum=1;
m_bookshelfnum="";
m_publicationnum="";
m_issn="";
CString initcheck;
initcheck="000000000000000000000000000000000000000000000000000000000000";
SetCheck(initcheck);
UpdateData(FALSE);
// 设置初始值
int nCount;
nCount=((CComboBox*)GetDlgItem(IDC_READINGROOM))->GetCount();
if(nCount>0)
((CComboBox*)GetDlgItem(IDC_READINGROOM))->SetCurSel(nCount-1);
//GetDlgItem(IDC_READINGROOM)->ShowWindow(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CQKDJOPERATION::OnZhoukan()
{
// TODO: Add your control notification handler code here
m_select_type=1;
}
void CQKDJOPERATION::OnYuekan()
{
// TODO: Add your control notification handler code here
m_select_type=4;
}
void CQKDJOPERATION::OnXunkan()
{
// TODO: Add your control notification handler code here
m_select_type=2;
}
void CQKDJOPERATION::OnQita()
{
// TODO: Add your control notification handler code here
m_select_type=7;
}
void CQKDJOPERATION::OnJikan()
{
// TODO: Add your control notification handler code here
m_select_type=6;
}
void CQKDJOPERATION::OnBanyuekan()
{
// TODO: Add your control notification handler code here
m_select_type=3;
}
void CQKDJOPERATION::OnShuangyuekan()
{
// TODO: Add your control notification handler code here
m_select_type=5;
}
void CQKDJOPERATION::Display(int m_select_type)
{
}
void CQKDJOPERATION::OnInsert()
{
// TODO: Add your control notification handler code here
// 进行简单的判断
UpdateData(TRUE);
if(m_publicationnum=="")
{
MessageBox("请填写邮发代号","信息提示");
return;
}
if(m_bookname=="")
{
MessageBox("请填写刊名","信息提示");
return;
}
if(m_issn=="")
{
MessageBox("请填写ISSN号","信息提示");
return;
}
if(m_bookshelfnum=="")
{
MessageBox("请填写架号","信息提示");
return;
}
if(m_readingroom=="")
{
MessageBox("请选择阅览室","信息提示");
return;
}
if(m_copynum==0)
{
MessageBox("请填写副本数量","信息提示");
return;
}
Cqikan Qikan;
Qikan.m_fuben=m_copynum;
Qikan.m_jiahao=m_bookshelfnum;
Qikan.m_issn=m_issn;
Qikan.m_kanhao=m_publicationnum;
Qikan.m_name=m_bookname;
Qikan.m_qici=GetCheck();
//MessageBox(Qikan.m_qici);
Qikan.m_roomid=m_readingroom;
// 判断刊号是否重复
if(Qikan.HaveKanhao(m_publicationnum)==1)
{
MessageBox("这个邮发代号已经存在了!","信息提示");
return;
}
Qikan.sql_insert();
}
void CQKDJOPERATION::OnSelect()
{
// TODO: Add your control notification handler code here
// 从控件中取得数据
UpdateData(TRUE);
// 判断刊号是否填写
if(m_publicationnum=="")
{
MessageBox("请填写邮发代号","信息提示");
return;
}
Cqikan Qikan;
if(Qikan.HaveKanhao(m_publicationnum)==-1)
{
MessageBox("这个邮发代号不存在!","信息提示");
OnInitDialog();
return;
}
Qikan.GetInfo(m_publicationnum);
m_bookname=Qikan.m_name;
m_bookshelfnum=Qikan.m_jiahao;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -