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

📄 selborrow9.cpp

📁 图书管理系统可进行查询,添加,修改,等操作 用树行结构为图书馆进行图书分类
💻 CPP
字号:
// selborrow9.cpp : implementation file
//

#include "stdafx.h"
#include "图书管理.h"
#include "selborrow9.h"

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

/////////////////////////////////////////////////////////////////////////////
// selborrow9 dialog


selborrow9::selborrow9(CWnd* pParent /*=NULL*/)
	: CDialog(selborrow9::IDD, pParent)
{
	//{{AFX_DATA_INIT(selborrow9)
	m_bookno = _T("");
	m_readno = _T("");
	m_time = _T("");
	m_saves = _T("");
	//}}AFX_DATA_INIT
}


void selborrow9::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(selborrow9)
	DDX_Control(pDX, IDC_COMBO1, m_leixing);
	DDX_Control(pDX, IDC_ADODC1, m_adoc);
	DDX_Control(pDX, IDC_DATAGRID1, m_grid);
	DDX_Text(pDX, IDC_EDIT1, m_bookno);
	DDX_Text(pDX, IDC_EDIT2, m_readno);
	DDX_Text(pDX, IDC_EDIT4, m_time);
	DDX_CBString(pDX, IDC_COMBO2, m_saves);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// selborrow9 message handlers

void selborrow9::OnOK() 
{
   
	UpdateData(true);
	CString vSQL,string,string2;
	int i,count=0;
	CString str[3],str2[3];
	str[0]=m_bookno;      str2[0]="bookno";
	str[1]=m_readno;    str2[1]="readno";
    str[2]=m_time;      str2[2]="btime";	
	 vSQL="select *from borrow  where ";
 for(i=0;i<3;i++)
 {
	 string=""; 
     string2="";
		 if(str[i]!="")
		 {  
			 string=str2[i]+"=";
			 switch(i)
			 {
			 case 0: string2="'"+m_bookno+"'";count++;break;
             case 1: string2="'"+m_readno+"'";count++;break;
             case 2: string2="'"+m_time+"'";count++;break;
			 }
			 if(count>1)
             vSQL+=" AND "+string+string2;
			 else
               vSQL+=string+string2;
		 } 
 }

    string=vSQL;
	m_adoc.SetRecordSource(string);
    m_adoc.Refresh();
   
}

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

⌨️ 快捷键说明

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