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

📄 selyonghu9.cpp

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

#include "stdafx.h"
#include "图书管理.h"
#include "selyonghu9.h"
#include"book.h"


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

/////////////////////////////////////////////////////////////////////////////
// selyonghu9 dialog


selyonghu9::selyonghu9(CWnd* pParent /*=NULL*/)
	: CDialog(selyonghu9::IDD, pParent)
{
	EnableAutomation();

	//{{AFX_DATA_INIT(selyonghu9)
	m_usename = _T("");
	m_password = _T("");
	//}}AFX_DATA_INIT
}


void selyonghu9::OnFinalRelease()
{
	// When the last reference for an automation object is released
	// OnFinalRelease is called.  The base class will automatically
	// deletes the object.  Add additional cleanup required for your
	// object before calling the base class.

	CDialog::OnFinalRelease();
}

void selyonghu9::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(selyonghu9)
	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_usename);
	DDX_Text(pDX, IDC_EDIT2, m_password);
	//}}AFX_DATA_MAP
}


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

BEGIN_DISPATCH_MAP(selyonghu9, CDialog)
	//{{AFX_DISPATCH_MAP(selyonghu9)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_Iselyonghu9 to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {D8E4CD4C-D805-4B06-8F36-452F52D44D7A}
static const IID IID_Iselyonghu9 =
{ 0xd8e4cd4c, 0xd805, 0x4b06, { 0x8f, 0x36, 0x45, 0x2f, 0x52, 0xd4, 0x4d, 0x7a } };

BEGIN_INTERFACE_MAP(selyonghu9, CDialog)
	INTERFACE_PART(selyonghu9, IID_Iselyonghu9, Dispatch)
END_INTERFACE_MAP()

/////////////////////////////////////////////////////////////////////////////
// selyonghu9 message handlers

void selyonghu9::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(true);
	CString vSQL,string,string2,str3;
	int i,count=0;
    str3.Format("%d",m_leixing.GetCurSel()+1);
	CString str[3],str2[3];
	str[0]=m_usename;      str2[0]="usename";
	str[1]=m_password;    str2[1]="password";
    str[2]=str3;      str2[2]="leixing";

	 vSQL="select *from uses  where ";
 for(i=0;i<3;i++)
 {
	 string=""; 
     string2="";
		 if(str[i]!="")
		 {  
			 string=str2[i]+"=";
			 
			 switch(i)
			 {
			 case 0: string2="'"+m_usename+"'";count++;break;
             case 1: string2="'"+m_password+"'";count++;break;
             case 2: string2="'"+str3+"'";count++;break;
             
	
			 }
			 if(count>1)
             vSQL+=" AND "+string+string2;
			 else
               vSQL+=string+string2;
		 } 
 }

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

⌨️ 快捷键说明

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