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

📄 cxwdiaoru.cpp

📁 用数据库ACCESS和VISUAL C++编程
💻 CPP
字号:
// Cxwdiaoru.cpp : implementation file
//

#include "stdafx.h"
#include "new3.h"
#include "Cxwdiaoru.h"
#include "Czgtable.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCxwdiaoru dialog


CCxwdiaoru::CCxwdiaoru(CWnd* pParent /*=NULL*/)
	: CDialog(CCxwdiaoru::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCxwdiaoru)
	m_xwtimey = 0;
	m_xwdrid = _T("");
	m_xwname = _T("");
	m_xwgongling = 0.0f;
	m_xwbumen = _T("");
	m_xwjiben = 0.0f;
	m_xwtimem = 0;
	m_xwbumenname = _T("");
	//}}AFX_DATA_INIT
}


void CCxwdiaoru::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCxwdiaoru)
	DDX_Control(pDX, IDCANCEL, m_cancel3);
	DDX_Control(pDX, IDC_QUEDING3, m_queding3);
	DDX_Text(pDX, IDC_WXKFTIMEY, m_xwtimey);
	DDX_Text(pDX, IDC_XWDRID, m_xwdrid);
	DDX_Text(pDX, IDC_XWDRNAME, m_xwname);
	DDX_Text(pDX, IDC_XWGONGLING, m_xwgongling);
	DDX_Text(pDX, IDC_XWHEBUMEN, m_xwbumen);
	DDX_Text(pDX, IDC_XWJIBEN, m_xwjiben);
	DDX_Text(pDX, IDC_XWKTIMEM, m_xwtimem);
	DDX_Text(pDX, IDC_XWBUMENNAME, m_xwbumenname);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCxwdiaoru, CDialog)
	//{{AFX_MSG_MAP(CCxwdiaoru)
	ON_BN_CLICKED(IDC_QUEDING3, OnQueding3)
	ON_EN_CHANGE(IDC_XWDRID, OnChangeXwdrid)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCxwdiaoru message handlers

void CCxwdiaoru::OnQueding3() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	if(m_xwbumen.IsEmpty())
	{
		MessageBox("请正确填写!");
		return;
	}
	if(m_xwbumenname.IsEmpty())
	{
		MessageBox("请正确填写!");
		return;
	}
	if(m_xwdrid.IsEmpty())
	{
		MessageBox("请正确填写!");
		return;
	}
	if(m_xwname.IsEmpty())
	{
		MessageBox("请正确填写!");
		return;
	}
    if((m_xwjiben<0)||(m_xwgongling<0))
	{ 
		MessageBox("不能为负数!");
		return;
	}
	CCzgtable ble;
	CTime tt;
	ble.Open();
	ble.MoveLast();
	ble.CanAppend();
	ble.AddNew();
	ble.m_bumenID=m_xwbumen; 
	ble.m_bumenname=m_xwbumenname;
	ble.m_jibengongzi=m_xwjiben;
	ble.m_zhigongID=m_xwdrid; 
	ble.m_gonglinggongzi=m_xwgongling;
	ble.m_zhigongname=m_xwname; 
	ble.m_kashitimey=m_xwtimey;
	ble.m_kashitimem=m_xwtimem;
	ble.m_diaochutimey=tt.GetCurrentTime().GetYear();
	ble.m_diaorutimem=tt.GetCurrentTime().GetMonth();
	ble.Update(); 
	MessageBox("已经成功调入数据库!!!");
	return;
}

BOOL CCxwdiaoru::OnInitDialog() 
{
	CDialog::OnInitDialog();
	xwdr_bitmap1.LoadBitmap(IDB_BITMAP1);
	m_queding3.SetBitmap((HBITMAP)xwdr_bitmap1.m_hObject);

	xwdr_bitmap2.LoadBitmap(IDB_BITMAP10); 
	m_cancel3.SetBitmap((HBITMAP)xwdr_bitmap2.m_hObject); 
	//(HBITMAP)xndd_bitmap1.m_hObject
	// TODO: Add extra initialization here
	//GetDlgItem(IDC_QUEDING3)->EnableWindow(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCxwdiaoru::OnChangeXwdrid() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	GetDlgItem(IDC_QUEDING3)->EnableWindow(true);
	// TODO: Add your control notification handler code here
	
}

BOOL CCxwdiaoru::DestroyWindow() 
{
	// TODO: Add your specialized code here and/or call the base class
	xwdr_bitmap1.DeleteObject();
	xwdr_bitmap2.DeleteObject(); 
	return CDialog::DestroyWindow();
}

⌨️ 快捷键说明

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