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

📄 modifyalertdlg.cpp

📁 这是一个简单的体检管理系统
💻 CPP
字号:
// ModifyAlertDlg.cpp : implementation file
//

#include "stdafx.h"
#include "HealManage.h"
#include "ModifyAlertDlg.h"
#include "TiJSet.h"
#include "StuInfoSet.h"
#include "ModDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CModifyAlertDlg dialog


CModifyAlertDlg::CModifyAlertDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CModifyAlertDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CModifyAlertDlg)
	m_ksh = _T("");
	//}}AFX_DATA_INIT
}


void CModifyAlertDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CModifyAlertDlg)
	DDX_Control(pDX, IDC_KSH, m_cksh);
	DDX_Text(pDX, IDC_KSH, m_ksh);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CModifyAlertDlg, CDialog)
	//{{AFX_MSG_MAP(CModifyAlertDlg)
	ON_BN_CLICKED(IDC_MODIFY, OnModify)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CModifyAlertDlg message handlers

void CModifyAlertDlg::OnModify() 
{
	// TODO: Add your control notification handler code here
	CString m_strSQL;
	CString m_strBirth;
	CTiJSet m_recordset;
	CStuInfoSet m_stuSet;
	UpdateData(TRUE);
	if(m_ksh.IsEmpty())
	{
		AfxMessageBox("请输入要修改的考生的考号!");
		m_cksh.SetFocus();
		return;
	}
	m_strSQL.Format("select * from tjk where ksh='%s'",m_ksh);
	if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPE,m_strSQL))
	{
		MessageBox("打开数据库失败","连接失败",MB_OK);
		return;
	}
	if(m_recordset.GetRecordCount()==0)
	{
		AfxMessageBox("该学生还没有体检信息,请重新输入!");
		return;
	}
	else
	{
		CHealManageApp*  ptheApp = (CHealManageApp *) AfxGetApp();
	    ptheApp->m_ksId=m_ksh;
		CDialog::OnOK();
        m_strSQL.Format("select * from bjk where ksh='%s'",m_ksh);
		if(!m_stuSet.Open(AFX_DB_USE_DEFAULT_TYPE,m_strSQL))
		{
		   MessageBox("打开数据库失败","连接失败",MB_OK);
		   return;
		}
		CModDlg dlg=new CModDlg();
		dlg.m_tjxh=m_recordset.m_tjxh;
		dlg.m_ksh=m_stuSet.m_ksh;
        dlg.m_xm=m_stuSet.m_xm;
		dlg.m_xb=m_stuSet.m_xbdm;
		m_strBirth.Format("%d-%d-%d",m_stuSet.m_csrq.GetYear(),m_stuSet.m_csrq.GetMonth(),m_stuSet.m_csrq.GetDay());
		dlg.m_cerq=m_strBirth;
		dlg.m_mz=m_stuSet.m_mzdm;
		dlg.m_sfzh=m_stuSet.m_sfzh;
		dlg.m_byxx=m_stuSet.m_byxxmc;
		dlg.m_jwbsT=m_recordset.m_jwbs;
		dlg.m_lyslz.Format("%.1f",m_recordset.m_yk_lyslz);
		dlg.m_lysly.Format("%.1f",m_recordset.m_yk_lysly);
		dlg.m_jzslz.Format("%.1f",m_recordset.m_yk_jzslz);
		dlg.m_jzsly.Format("%.1f",m_recordset.m_yk_jzsly);
		dlg.m_jzdsz=m_recordset.m_yk_jzdsz;
		dlg.m_jzdsy=m_recordset.m_yk_jzdsy;
		dlg.m_yb=m_recordset.m_yk_yb;
		dlg.m_sg.Format("%.1f",m_recordset.m_wk_sg);
		dlg.m_tz.Format("%.1f",m_recordset.m_wk_tz);
		dlg.m_nzssy=m_recordset.m_nk_xyssy;
		dlg.m_nzszy=m_recordset.m_nk_xyszy;
		dlg.m_gan=m_recordset.m_nk_g;
		dlg.m_pi=m_recordset.m_nk_p;
		dlg.m_nk=m_recordset.m_nk_qt;
		dlg.m_wk=m_recordset.m_wk_qt;
		dlg.m_ztl.Format("%.1f",m_recordset.m_eb_zetl);
		dlg.m_ytl.Format("%.1f",m_recordset.m_eb_yetl);
		dlg.m_eb=m_recordset.m_eb_ebyh_bz;
		dlg.m_kq=m_recordset.m_kq_qt;
		dlg.m_xt=m_recordset.m_xt_qt;
		dlg.m_gg=m_recordset.m_gg_qt;
        dlg.m_sxzy1=m_recordset.m_zysxdm1;
		dlg.m_sxzy2=m_recordset.m_zysxdm2;
		dlg.m_sxzy3=m_recordset.m_zysxdm3;
		dlg.m_sxzy4=m_recordset.m_zysxdm4;
		dlg.m_sxzy5=m_recordset.m_zysxdm5;
		dlg.m_sxzy6=m_recordset.m_zysxdm6;
		dlg.m_tjjl=m_recordset.m_bz;
		dlg.DoModal();
        m_stuSet.Close();
		m_recordset.Close();
	}
}

⌨️ 快捷键说明

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