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

📄 readdlg.cpp

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

#include "stdafx.h"
#include "图书管理.h"
#include "readdlg.h"
#include"readeditdlg.h"
#include"xitongdlg.h"
#include"read.h"
#include"selread9.h"
//#include"Users.h"
//#include"grobe.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CUsers use;
/////////////////////////////////////////////////////////////////////////////
// readdlg dialog


readdlg::readdlg(CWnd* pParent /*=NULL*/)
	: CDialog(readdlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(readdlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	str="-1";
}


void readdlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(readdlg)
	DDX_Control(pDX, IDC_ADODC1, m_adoc);
	DDX_Control(pDX, IDC_DATAGRID1, m_grid);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(readdlg, CDialog)
	//{{AFX_MSG_MAP(readdlg)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// readdlg message handlers

void readdlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	readeditdlg dlg;
	dlg.m_readno=str;
	if(str=="-1")
	{
		MessageBox("请选择要修改的记录");
		return ;
	}
	dlg.DoModal();
	m_adoc.Refresh();
	
}

void readdlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	if(str=="-1")
	{
		MessageBox("请选择要删除的记录");
		return ;
	}
  if (MessageBox("是否删除当前记录","请确定", MB_YESNO) == IDYES)
	{
		Cread b;
		b.sql_delete(str);
		
	}
    str="-1";
	m_adoc.Refresh();
}

void readdlg::OnOK() 
{
	// TODO: Add extra validation here
	
	readeditdlg dlg;
	dlg.DoModal();
	m_adoc.Refresh();
}

void readdlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	xitongdlg dlg;
	dlg.DoModal();
	
	

}

BEGIN_EVENTSINK_MAP(readdlg, CDialog)
    //{{AFX_EVENTSINK_MAP(readdlg)
	ON_EVENT(readdlg, IDC_DATAGRID1, -600 /* Click */, OnClickDatagrid1, VTS_NONE)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void readdlg::OnClickDatagrid1() 
{
	// TODO: Add your control notification handler code here
	str=m_grid.GetItem(0);
	
}

BOOL readdlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
  if(use.User_type==2)
	{
		GetDlgItem(IDOK)->EnableWindow(false);
        GetDlgItem(IDC_BUTTON1)->EnableWindow(false); 
		GetDlgItem(IDC_BUTTON2)->EnableWindow(false);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void readdlg::OnButton3() 
{
	// TODO: Add your control notification handler code here
	    selread9 dlg;
		dlg.DoModal();
	    m_adoc.Refresh();
}

⌨️ 快捷键说明

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