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

📄 wdlbiedlg.cpp

📁 用于单位文档管理系统
💻 CPP
字号:
// Wdlbiedlg.cpp : implementation file
//

#include "stdafx.h"
#include "WordGLXT.h"
#include "Wdlbiedlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CWdlbiedlg dialog


CWdlbiedlg::CWdlbiedlg(CWnd* pParent /*=NULL*/)
	: CDialog(CWdlbiedlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWdlbiedlg)
	m_dwbh = 0;
	m_lbbh = 0;
	m_lbmc = _T("");
	//}}AFX_DATA_INIT
	m_hIcon = AfxGetApp()->LoadIcon(IDI_ICONWDLB);
}


void CWdlbiedlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWdlbiedlg)
	DDX_Text(pDX, IDC_EDIT1, m_dwbh);
	DDX_Text(pDX, IDC_EDIT2, m_lbbh);
	DDX_Text(pDX, IDC_EDIT3, m_lbmc);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CWdlbiedlg, CDialog)
	//{{AFX_MSG_MAP(CWdlbiedlg)
	ON_BN_CLICKED(IDC_MODBUTTON, OnModbutton)
	ON_BN_CLICKED(IDC_DELBUTTON, OnDelbutton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWdlbiedlg message handlers

void CWdlbiedlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(true);
	if(m_lbmc=="")
	{
		MessageBox("类别名称不能为空","文档管理系统");
		return;
	}
	CZdmlb mlb;
	CDwxxb dwb;
	mlb.Load_dep();
	dwb.Load_dep();
	int dw=0;
	for(int i=0;i<dwb.a_DWbh.GetSize();i++)
	{
		int p=atoi(dwb.a_DWbh.GetAt(i));
		if(m_dwbh==atoi(dwb.a_DWbh.GetAt(i)))
		{
			dw++;
		}
	}
	if(dw==0)
	{
		MessageBox("单位编号不存在","文档管理系统");
		return;
	}
	dw=0;
	if(mlb.HaveId(m_dwbh,m_lbbh)==1)
	{
		MessageBox("类别已存在","文档管理系统");
		return;
	}
	mlb.SetDwbh(m_dwbh);
	mlb.SetLBbh(m_lbbh);
	mlb.SetLBmc(m_lbmc);
	mlb.sql_insert();
	zhi.SetDLsj(t.Format("%y-%m-%d"));
	zhi.SetName(user.GetUsername());
	zhi.SetDZ("类别添加");
	zhi.sql_insert();
	CDialog::OnOK();
}

void CWdlbiedlg::OnModbutton() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	if(m_lbmc=="")
	{
		MessageBox("类别名称不能为空","文档管理系统");
		return;
	}
	CZdmlb mlb;
	CDwxxb dwb;
	dwb.Load_dep();
	mlb.Load_dep();
	int dw=0;
	for(int i=0;i<dwb.a_DWbh.GetSize();i++)
	{
		if(m_dwbh==atoi(dwb.a_DWbh.GetAt(i)))
		{
			dw++;
		}
	}
	if(dw==0)
	{
		MessageBox("单位编号不存在","文档管理系统");
		return;
	}
	dw=0;
	mlb.SetDwbh(m_dwbh);
	mlb.SetLBmc(m_lbmc);
	mlb.sql_update(m_dwbh,m_lbbh);
	zhi.SetDLsj(t.Format("%y-%m-%d"));
	zhi.SetName(user.GetUsername());
	zhi.SetDZ("类别修改");
	zhi.sql_insert();
	CDialog::OnOK();
}

void CWdlbiedlg::OnDelbutton() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	CZdmlb mlb;
	mlb.sql_delete(m_dwbh,m_lbbh);
	CZdxxb xxb;
	xxb.sql_deletelb(m_dwbh,m_lbbh);
	zhi.SetDLsj(t.Format("%y-%m-%d"));
	zhi.SetName(user.GetUsername());
	zhi.SetDZ("类别删除");
	zhi.sql_insert();
	CDialog::OnOK();
}

BOOL CWdlbiedlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetIcon(m_hIcon, TRUE);	
	t=CTime::GetCurrentTime();
	m_dwbh=1;
	m_lbbh=1;
	UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CWdlbiedlg::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message==WM_KEYDOWN && pMsg->wParam==13)
		pMsg->wParam=9;	
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

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