【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了ChargeItemEditDlg.cpp相关资料,希望对各位网友有所帮助!
// ChargeItemEditDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ChargeManage.h"
#include "ChargeItemEditDlg.h"
#include "ChargeItem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChargeItemEditDlg dialog
CChargeItemEditDlg::CChargeItemEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CChargeItemEditDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CChargeItemEditDlg)
m_BookFee = 0.0;
m_DormFee = 0.0;
m_FileFee = 0.0;
m_incidental = 0.0;
m_insurance = 0.0;
m_MacTimeFee = 0.0;
m_total = 0.0;
m_tuition = 0.0;
m_BicycleFee = 0.0;
m_Year = 0;
//}}AFX_DATA_INIT
}
void CChargeItemEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChargeItemEditDlg)
DDX_Control(pDX, IDC_SPECIALITY_COMBO, m_speciality);
DDX_Text(pDX, IDC_BOOK_FEE_EDIT, m_BookFee);
DDX_Text(pDX, IDC_DORM_FEE_EDIT, m_DormFee);
DDX_Text(pDX, IDC_FILE_FEE_EDIT, m_FileFee);
DDX_Text(pDX, IDC_INCIDENTAL_EDIT, m_incidental);
DDX_Text(pDX, IDC_INSURANCE_EDIT, m_insurance);
DDX_Text(pDX, IDC_MAC_TIME_FEE_EDIT, m_MacTimeFee);
DDX_Text(pDX, IDC_TOTAL_EDIT, m_total);
DDX_Text(pDX, IDC_TUITION_EDIT, m_tuition);
DDX_Text(pDX, IDC_BICYCLE_FEE_EDIT, m_BicycleFee);
DDX_Text(pDX, IDC_YEAR_EDIT, m_Year);
DDV_MinMaxInt(pDX, m_Year, 1980, 2100);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChargeItemEditDlg, CDialog)
//{{AFX_MSG_MAP(CChargeItemEditDlg)
ON_CBN_SELCHANGE(IDC_SPECIALITY_COMBO, OnSelchangeSpecialityCombo)
ON_EN_CHANGE(IDC_TUITION_EDIT, OnChangeTuitionEdit)
ON_EN_CHANGE(IDC_INCIDENTAL_EDIT, OnChangeIncidentalEdit)
ON_EN_CHANGE(IDC_MAC_TIME_FEE_EDIT, OnChangeMacTimeFeeEdit)
ON_EN_CHANGE(IDC_INSURANCE_EDIT, OnChangeInsuranceEdit)
ON_EN_CHANGE(IDC_DORM_FEE_EDIT, OnChangeDormFeeEdit)
ON_EN_CHANGE(IDC_BICYCLE_FEE_EDIT, OnChangeBicycleFeeEdit)
ON_EN_CHANGE(IDC_BOOK_FEE_EDIT, OnChangeBookFeeEdit)
ON_EN_CHANGE(IDC_FILE_FEE_EDIT, OnChangeFileFeeEdit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChargeItemEditDlg message handlers
BOOL CChargeItemEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if(cItemId == "")
{
m_speciality.AddString("==专业信息==");
spe.LoadSpe();
for(int i=0; i<spe.a_SpeId.GetSize(); i++)
{
if (atol(spe.a_DepId.GetAt(i)) == DepId)
{
m_speciality.AddString(spe.a_Name.GetAt(i));
}
}
}
else
{
GetDlgItem(IDC_SPECIALITY_COMBO)->EnableWindow(FALSE);
m_speciality.AddString(cSpe);
}
m_speciality.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// 改变专业选择框
void CChargeItemEditDlg::OnSelchangeSpecialityCombo()
{
// TODO: Add your control notification handler code here
// 得到当前专业名称
CString strCurSpe;
m_speciality.GetLBText(m_speciality.GetCurSel(), strCurSpe);
// 得到SpeId的值
for(int i = 0 ; i < spe.a_SpeId.GetSize(); i++)
{
if(spe.a_Name.GetAt(i) == strCurSpe)
{
SpeId = atol(spe.a_SpeId.GetAt(i));
}
}
}
// 学费改变
void CChargeItemEditDlg::OnChangeTuitionEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 杂费改变
void CChargeItemEditDlg::OnChangeIncidentalEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 机时费改变
void CChargeItemEditDlg::OnChangeMacTimeFeeEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 保险费改变
void CChargeItemEditDlg::OnChangeInsuranceEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 住宿费改变
void CChargeItemEditDlg::OnChangeDormFeeEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 存车费改变
void CChargeItemEditDlg::OnChangeBicycleFeeEdit()
{
// 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.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_total = m_tuition + m_incidental + m_MacTimeFee + m_insurance + m_DormFee
+ m_BicycleFee + m_BookFee + m_FileFee;
UpdateData(FALSE);
}
// 书费改变
void CChargeItemEditDlg::OnChangeBookFeeEdit()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override
上一篇:
ChargeItem.cpp
下一篇:
哈弗F7 VS名爵HS,谁更懂得年轻人的心?