📄 workdlg.cpp
字号:
// workdlg.cpp : implementation file
//
#include "stdafx.h"
#include "图书管理.h"
#include "workdlg.h"
#include"workjiadlg.h"
#include"xitongdlg.h"
#include"work.h"
#include"selwork9.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CUsers use;
/////////////////////////////////////////////////////////////////////////////
// workdlg dialog
workdlg::workdlg(CWnd* pParent /*=NULL*/)
: CDialog(workdlg::IDD, pParent)
{
//{{AFX_DATA_INIT(workdlg)
m_dep = _T("");
//}}AFX_DATA_INIT
str="-1";
}
void workdlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(workdlg)
DDX_Control(pDX, IDC_ADODC1, m_adoc);
DDX_Control(pDX, IDC_DATAGRID1, m_grid);
DDX_Text(pDX, IDC_STATIC1, m_dep);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(workdlg, CDialog)
//{{AFX_MSG_MAP(workdlg)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// workdlg message handlers
void workdlg::OnButton1()
{
// TODO: Add your control notification handler code here
workjiadlg dlg;
if(str=="-1")
{
MessageBox("请选择要修改的记录");
return ;
}
dlg.m_workno=str;
str="-1";
dlg.DoModal();
m_adoc.Refresh();
}
void workdlg::OnButton2()
{
// TODO: Add your control notification handler code here
if(str=="-1")
{
MessageBox("请选择要删除的记录");
return ;
}
if (MessageBox("是否删除当前记录","请确定", MB_YESNO) == IDYES)
{
Cwork b;
b.sql_delete(str);
}
str="-1";
m_adoc.Refresh();
}
void workdlg::OnOK()
{
// TODO: Add extra validation here
workjiadlg dlg;
dlg.DoModal();
m_adoc.Refresh();
}
void workdlg::OnCancel()
{
// TODO: Add extra cleanup here
xitongdlg dlg;
dlg.DoModal();
}
BEGIN_EVENTSINK_MAP(workdlg, CDialog)
//{{AFX_EVENTSINK_MAP(workdlg)
ON_EVENT(workdlg, IDC_DATAGRID1, -600 /* Click */, OnClickDatagrid1, VTS_NONE)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void workdlg::OnClickDatagrid1()
{
// TODO: Add your control notification handler code here
str=m_grid.GetItem(0);
}
BOOL workdlg::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 workdlg::OnButton3()
{
// TODO: Add your control notification handler code here
selwork9 dlg;
dlg.DoModal();
m_adoc.Refresh();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -