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

📄 dlge.cpp

📁 生生世世 生生世世 生生世世 生生世世 搜索
💻 CPP
字号:
// DlgE.cpp : implementation file
//

#include "stdafx.h"
#include "finalhomework.h"
#include "DlgE.h"
//#include "forlogin.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgE dialog


/*CDlgE::CDlgE()
	: CDialog(CDlgE::IDD)
{
	//{{AFX_DATA_INIT(CDlgE)
	m_password=_T("");
	m_user=_T("");
	m_bday = _T("");
	m_bmonth = _T("");
	m_byear = _T("");
	m_score = _T("");
	m_finsh = _T("");
	m_address = _T("");
	m_name = _T("");
	m_report = _T("");
	m_man = 0;
	m_itemdistributed = _T("");
	flag=0;
	m_valuation = _T("");
	//}}AFX_DATA_INIT
}*/
CDlgE::CDlgE(CString a): CDialog(CDlgE::IDD)
{
	m_bday = _T("");
	m_bmonth = _T("");
	m_byear = _T("");
	m_score = _T("");
	m_finsh = _T("");
	m_address = _T("");
	m_name = _T("");
	m_report = _T("");
	m_user=_T("");
	m_password=_T("");
	m_man = 0;
	wenjian=a;

//	m_password=b;
//	m_user=a;
	flag=0;;
	FILE *fp;
	char *t;
	char temp[200];
	if(a!=_T("")){
	t=(char *)(LPCSTR)(a+"5"+".dat");
	strcpy(temp,t);
	strcpy(temp,(LPCSTR)(a+"5"+".dat"));
	}
	fp=fopen(temp,"r");
	fscanf(fp,"%s",temp);
	m_user=temp;
	fscanf(fp,"%s",temp);
	m_password=temp;
	fscanf(fp,"%s",temp);
	m_name=temp;
	fscanf(fp,"%d",&m_man);
	fscanf(fp,"%s",temp);
	m_address=temp;
	fscanf(fp,"%s",temp);
	m_byear=temp;
	fscanf(fp,"%s",temp);
	m_bmonth=temp;
	fscanf(fp,"%s",temp);
	m_bday=temp;
	fscanf(fp,"%s",temp);
	m_itemdistributed=temp;
	fscanf(fp,"%s",temp);
	m_valuation=temp;
	fscanf(fp,"%s",temp);
	m_finsh=temp;
	fscanf(fp,"%s",temp);
	m_score=temp;
	fscanf(fp,"%s",temp);
	m_report=temp;
	fclose(fp);
}
void CDlgE::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);

	//{{AFX_DATA_MAP(CDlgE)
	DDX_CBString(pDX, IDC_BDAY, m_bday);
	DDX_CBString(pDX, IDC_BMONTH, m_bmonth);
	DDX_CBString(pDX, IDC_BYEAR, m_byear);
	DDX_CBString(pDX, IDC_ESCORE, m_score);
	DDX_CBString(pDX, IDC_EFINSH, m_finsh);
	DDX_Text(pDX, IDC_EADDRESS, m_address);
//	DDX_Text(pDX, IDC_EUSER, m_User);
//	DDX_Text(pDX, IDC_EPASSWORD, m_Password);
	DDX_Text(pDX, IDC_ENAME, m_name);
	DDX_Text(pDX, IDC_EREPORT, m_report);
	DDX_Radio(pDX, IDC_RADIO1, m_man);
	DDX_Text(pDX, IDC_EITEMDISTRIBUTED, m_itemdistributed);
	DDX_Text(pDX, IDC_EMEVALUTION, m_valuation);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgE, CDialog)
	//{{AFX_MSG_MAP(CDlgE)
	ON_CBN_EDITCHANGE(IDC_BYEAR, OnChangeYear)
	ON_CBN_EDITCHANGE(IDC_BMONTH, OnChangemonth)
	ON_CBN_EDITCHANGE(IDC_BDAY, OnChangeday)
	ON_EN_CHANGE(IDC_EITEMDISTRIBUTED, OnChangeEitemdistributed)
	ON_CBN_EDITCHANGE(IDC_EFINSH, OnChangefinsh)
	ON_CBN_EDITCHANGE(IDC_ESCORE, OnChangescore)
	ON_BN_CLICKED(IDC_SAVECHANGE, OnSavechange)
//	ON_BN_CLICKED(IDC_TMSAVE, OnTmsave)
	ON_EN_CHANGE(IDC_EMEVALUTION, OnChangeEmevalution)
	ON_EN_CHANGE(IDC_EADDRESS, OnChangeEaddress)
	ON_EN_CHANGE(IDC_ENAME, OnChangeEname)
	ON_EN_CHANGE(IDC_EREPORT, OnChangeEreport)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgE message handlers




void CDlgE::OnChangeYear() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
}

void CDlgE::OnChangemonth() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
}

void CDlgE::OnChangeday() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
}

void CDlgE::OnChangeEitemdistributed() 
{
	// 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(FALSE);
	
}
void CDlgE::OnChangeEmevalution() 
{
	// 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(FALSE);
	
}



void CDlgE::OnChangefinsh() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
}

void CDlgE::OnChangescore() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
}


void CDlgE::OnChangeEaddress() 
{
	// 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);
	
}

void CDlgE::OnChangeEname() 
{
	// 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);
	
}

void CDlgE::OnChangeEreport() 
{
	// 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);
	
}
void CDlgE::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
}
void CDlgE::OnSavechange() 
{
	// TODO: Add your control notification handler code here
	FILE *fp;
	char *t;
	char temp[200];
	if(wenjian!=_T("")){
	t=(char *)(LPCSTR)(wenjian+"5"+".dat");
	strcpy(temp,t);
	strcpy(temp,(LPCSTR)(wenjian+"5"+".dat"));
	}

	fp=fopen(temp,"w+");
	fprintf(fp,"%s\n",m_user);
	fprintf(fp,"%s\n",m_password);
	fprintf(fp,"%s\n",m_name);
	fprintf(fp,"%d\n",m_man);
	fprintf(fp,"%s\n",m_address);

	fprintf(fp,"%s\n",m_byear);
	fprintf(fp,"%s\n",m_bmonth);
	fprintf(fp,"%s\n",m_bday);
	fprintf(fp,"%s\n",m_itemdistributed);
	fprintf(fp,"%s\n",m_valuation);
	fprintf(fp,"%s\n",m_finsh);
	fprintf(fp,"%s\n",m_score);
	fprintf(fp,"%s\n",m_report);
	fclose(fp);
}

void CDlgE::OnTmsave() 
{
	// TODO: Add your control notification handler code here
	
}

⌨️ 快捷键说明

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