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

📄 tv.cpp

📁 体育信息管理系统
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	pDC->LineTo(50+high1*i,80+high2*row);	
	}
CRect rect(50,80,50+high1,80+high2);
	pDC->DrawText("姓名",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*1,80,50+high1*2,80+high2);
	pDC->DrawText("出勤 10%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*2,80,50+high1*3,80+high2);
	pDC->DrawText("跳绳 10%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*3,80,50+high1*4,80+high2);
	pDC->DrawText("跳远 10%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*4,80,50+high1*5,80+high2);
	pDC->DrawText("30米 10%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*5,80,50+high1*6,80+high2);
	pDC->DrawText("垒球 10%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*6,80,50+high1*7,80+high2);
	pDC->DrawText("技巧一16.7%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);	
	rect.SetRect(50+high1*7,80,50+high1*8,80+high2);
	pDC->DrawText("技巧二16.7%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*8,80,50+high1*9,80+high2);
	pDC->DrawText("技巧三16.6%",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
	rect.SetRect(50+high1*9,80,50+high1*10,80+high2);
	pDC->DrawText("体育课成绩",-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);

if(pInfo->m_nCurPage==1)
{
	if(prs->GetRecordCount()){
		prs->MoveFirst(); 
for(i=0;i<row-1;i++){
rect.SetRect(50,80+high2*(i+1),50+high1,80+high2*(i+2));
pDC->DrawText(prs->m_name,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
CString str="";
str.Format("%5.2f",prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*1,80+high2*(i+1),50+high1*2,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*2,80+high2*(i+1),50+high1*3,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jump2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*3,80+high2*(i+1),50+high1*4,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_run2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*4,80+high2*(i+1),50+high1*5,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_ball2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*5,80+high2*(i+1),50+high1*6,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_gang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*6,80+high2*(i+1),50+high1*7,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_yang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*7,80+high2*(i+1),50+high1*8,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jiqiao*0.166);
if(str.GetLength()<=6){
rect.SetRect(50+high1*8,80+high2*(i+1),50+high1*9,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1+prs->m_jump2*0.1+prs->m_run2*0.1+prs->m_ball2*0.1+prs->m_jiqiao*0.166+prs->m_yang*0.167+prs->m_gang*0.167+prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*9,80+high2*(i+1),50+high1*10,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
if(prs->IsEOF()){CString jj;
jj.Format("总人数为%d人,及格人数为%d人,及格率为%5.2f。",page,jige,jige1);
pDC->TextOut(50,90+high2*row,jj);
if(prs->GetRecordCount()){prs->MoveFirst();
while(!prs->IsEOF()){	
if(prs->m_inhouse1!=10){prs->Edit();prs->m_inhouse1=10;prs->Update();}
	prs->MoveNext();}}
return;}else
{prs->MoveNext();
}
}}}
if(pInfo->m_nCurPage==2)
{
	if(prs->GetRecordCount()){
		prs->MoveFirst(); 
		prs->Move(row-1);
for(i=0;i<row-1;i++){
rect.SetRect(50,80+high2*(i+1),50+high1,80+high2*(i+2));
pDC->DrawText(prs->m_name,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
CString str="";
str.Format("%5.2f",prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*1,80+high2*(i+1),50+high1*2,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*2,80+high2*(i+1),50+high1*3,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jump2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*3,80+high2*(i+1),50+high1*4,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_run2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*4,80+high2*(i+1),50+high1*5,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_ball2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*5,80+high2*(i+1),50+high1*6,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_gang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*6,80+high2*(i+1),50+high1*7,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_yang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*7,80+high2*(i+1),50+high1*8,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jiqiao*0.166);
if(str.GetLength()<=6){
rect.SetRect(50+high1*8,80+high2*(i+1),50+high1*9,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1+prs->m_jump2*0.1+prs->m_run2*0.1+prs->m_ball2*0.1+prs->m_jiqiao*0.166+prs->m_yang*0.167+prs->m_gang*0.167+prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*9,80+high2*(i+1),50+high1*10,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
if(prs->IsEOF()){CString jj;
jj.Format("总人数为%d人,及格人数为%d人,及格率为%5.2f。",page,jige,jige1);
pDC->TextOut(50,90+high2*row,jj);
if(prs->GetRecordCount()){prs->MoveFirst();
while(!prs->IsEOF()){	
if(prs->m_inhouse1!=10){prs->Edit();prs->m_inhouse1=10;prs->Update();}
	prs->MoveNext();}}
return;}else
{prs->MoveNext();
}
}}}
if(pInfo->m_nCurPage==3)
{
	if(prs->GetRecordCount()){
		prs->MoveFirst(); 
		prs->Move(2*row-2);
for(i=0;i<row-1;i++){
rect.SetRect(50,80+high2*(i+1),50+high1,80+high2*(i+2));
pDC->DrawText(prs->m_name,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
CString str="";
str.Format("%5.2f",prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*1,80+high2*(i+1),50+high1*2,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*2,80+high2*(i+1),50+high1*3,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jump2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*3,80+high2*(i+1),50+high1*4,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_run2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*4,80+high2*(i+1),50+high1*5,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_ball2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*5,80+high2*(i+1),50+high1*6,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_gang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*6,80+high2*(i+1),50+high1*7,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_yang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*7,80+high2*(i+1),50+high1*8,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jiqiao*0.166);
if(str.GetLength()<=6){
rect.SetRect(50+high1*8,80+high2*(i+1),50+high1*9,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1+prs->m_jump2*0.1+prs->m_run2*0.1+prs->m_ball2*0.1+prs->m_jiqiao*0.166+prs->m_yang*0.167+prs->m_gang*0.167+prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*9,80+high2*(i+1),50+high1*10,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
if(prs->IsEOF()){CString jj;
jj.Format("总人数为%d人,及格人数为%d人,及格率为%5.2f。",page,jige,jige1);
pDC->TextOut(50,90+high2*row,jj);
if(prs->GetRecordCount()){prs->MoveFirst();
while(!prs->IsEOF()){	
if(prs->m_inhouse1!=10){prs->Edit();prs->m_inhouse1=10;prs->Update();}
	prs->MoveNext();}}
return;}else
{prs->MoveNext();
}
}}}
if(pInfo->m_nCurPage==4)
{
	if(prs->GetRecordCount()){
		prs->MoveFirst(); 
		prs->Move(3*row-3);
for(i=0;i<row-1;i++){
rect.SetRect(50,80+high2*(i+1),50+high1,80+high2*(i+2));
pDC->DrawText(prs->m_name,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);
CString str="";
str.Format("%5.2f",prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*1,80+high2*(i+1),50+high1*2,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*2,80+high2*(i+1),50+high1*3,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jump2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*3,80+high2*(i+1),50+high1*4,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_run2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*4,80+high2*(i+1),50+high1*5,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_ball2*0.1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*5,80+high2*(i+1),50+high1*6,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_gang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*6,80+high2*(i+1),50+high1*7,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_yang*0.167);
if(str.GetLength()<=6){
rect.SetRect(50+high1*7,80+high2*(i+1),50+high1*8,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_jiqiao*0.166);
if(str.GetLength()<=6){
rect.SetRect(50+high1*8,80+high2*(i+1),50+high1*9,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
str.Format("%5.2f",prs->m_j2*0.1+prs->m_jump2*0.1+prs->m_run2*0.1+prs->m_ball2*0.1+prs->m_jiqiao*0.166+prs->m_yang*0.167+prs->m_gang*0.167+prs->m_inhouse1);
if(str.GetLength()<=6){
rect.SetRect(50+high1*9,80+high2*(i+1),50+high1*10,80+high2*(i+2));
pDC->DrawText(str,-1,&rect,DT_VCENTER|DT_CENTER|DT_SINGLELINE);}
if(prs->IsEOF()){CString jj;
jj.Format("总人数为%d人,及格人数为%d人,及格率为%5.2f。",page,jige,jige1);
pDC->TextOut(50,90+high2*row,jj);
if(prs->GetRecordCount()){prs->MoveFirst();
while(!prs->IsEOF()){	
if(prs->m_inhouse1!=10){prs->Edit();prs->m_inhouse1=10;prs->Update();}
	prs->MoveNext();}}
return;}else
{prs->MoveNext();
}
}}}

}	

if(prs->GetRecordCount()){prs->MoveFirst();
while(!prs->IsEOF()){	
if(prs->m_inhouse1!=10){prs->Edit();prs->m_inhouse1=10;prs->Update();}
	prs->MoveNext();}}
	font100.DeleteObject();
	font180.DeleteObject();
	font240.DeleteObject();

	CListView::OnPrint(pDC, pInfo);
}

BOOL CTV::OnPreparePrinting(CPrintInfo* pInfo) 
{
	return DoPreparePrinting(pInfo);
}

void CTV::OnFILEaa() 
{
	COooApp*pp=(COooApp*)::AfxGetApp();
CH m_ch;m_ch.m_high1=80;m_ch.m_high2=30;row=30;
if(m_ch.DoModal()==IDOK){
	high1=m_ch.m_high1;
	high2=m_ch.m_high2;
	row=m_ch.m_row;
pp->class1=m_ch.m_class;
pp->date=m_ch.m_date;
pp->teacher=m_ch.m_teacher;Invalidate();}
	
}

void CTV::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo) 
{
	CListView::OnEndPrinting(pDC, pInfo);
}

void CTV::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo) 
{	
	CListView::OnBeginPrinting(pDC, pInfo);
}

⌨️ 快捷键说明

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