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

📄 edit_pro.cpp

📁 LTMS软件说明 软件名称:LTMS(Luinse Teaching Management System)
💻 CPP
字号:
// edit_pro.cpp : implementation file
//

#include "stdafx.h"
#include "LMTS.h"
#include "edit_pro.h"
#include "user.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// edit_pro dialog


edit_pro::edit_pro(CWnd* pParent /*=NULL*/)
	: CDialog(edit_pro::IDD, pParent)
{
	//{{AFX_DATA_INIT(edit_pro)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void edit_pro::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(edit_pro)
	DDX_Text(pDX, IDC_EDIT1, user_name);
	DDX_Text(pDX, IDC_EDIT2, user_property);
	DDX_Text(pDX, IDC_EDIT3, user_regist);	// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(edit_pro, CDialog)
	//{{AFX_MSG_MAP(edit_pro)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void edit_pro::OnOK()
{
	AfxEnableControlContainer();
	// TODO: Add extra validation here
	CString user_name,user_property,user_regist,str,strSQL;
	GetDlgItem(IDC_EDIT1)->GetWindowText(user_name);
	GetDlgItem(IDC_EDIT2)->GetWindowText(user_property);
	GetDlgItem(IDC_EDIT3)->GetWindowText(user_regist);
	user update_user(&up);
//	student_db edit_mark_db(&emd);
	str.Format("select * from user where name='%s'",user_name);
	update_user.Open(AFX_DB_USE_DEFAULT_TYPE,str);

	strSQL.Format("update user set regist='%s' where id='%s'",user_regist,user_name); 
	up.ExecuteSQL(strSQL);
	strSQL.Format("update user set property='%s' where id='%s'",user_property,user_name); 
	up.ExecuteSQL(strSQL);
	AfxMessageBox("修改完毕");
	up.Close();
	CDialog::OnOK();

}
/////////////////////////////////////////////////////////////////////////////
// edit_pro message handlers

⌨️ 快捷键说明

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