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

📄 zuichongjieguo.cpp

📁 由我为校教务处自主开发的竞赛计分软件。 该软件由“比赛信息管理”、“裁判信息管理”、“选手信息管理”、“比赛计分排序”等几个模块组成。基于MFC技术
💻 CPP
字号:
// zuichongjieguo.cpp : 实现文件
//

#include "stdafx.h"
#include "计分程序 by WS.h"
#include "zuichongjieguo.h"
#include ".\zuichongjieguo.h"



// zuichongjieguo 对话框

IMPLEMENT_DYNAMIC(zuichongjieguo, CDialog)
zuichongjieguo::zuichongjieguo(CWnd* pParent /*=NULL*/,CString saishi)
	: CDialog(zuichongjieguo::IDD, pParent)
	, shumu(0)
	, shumu1(1)
	, shumu2(5)
	
{
	saishixuhao=saishi;
	shumu=0;
	shumu1=1;
	shumu2=5;
}

zuichongjieguo::~zuichongjieguo()
{
}

void zuichongjieguo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_STATIC1, xiangmuming[0]);
	DDX_Control(pDX, IDC_STATIC2, xiangmuming[1]);
	DDX_Control(pDX, IDC_STATIC3, xiangmuming[2]);
	DDX_Control(pDX, IDC_STATIC4, xiangmuming[3]);
	DDX_Control(pDX, IDC_STATIC5, xiangmuming[4]);


	DDX_Control(pDX, IDC_STATIC_temp3, tou);
	
	

	DDX_Control(pDX, IDC_STATIC6, fenshuxianshic[0]);
	DDX_Control(pDX, IDC_STATIC7, fenshuxianshic[1]);
	DDX_Control(pDX, IDC_STATIC8, fenshuxianshic[2]);
	DDX_Control(pDX, IDC_STATIC9, fenshuxianshic[3]);
	DDX_Control(pDX, IDC_STATIC10, fenshuxianshic[4]);



	DDX_Control(pDX, IDC_STATIC11, mingci[0]);
	DDX_Control(pDX, IDC_STATIC12, mingci[1]);
	DDX_Control(pDX, IDC_STATIC13, mingci[2]);
	DDX_Control(pDX, IDC_STATIC14, mingci[3]);
	DDX_Control(pDX, IDC_STATIC15, mingci[4]);
}

BEGIN_MESSAGE_MAP(zuichongjieguo, CDialog)
	ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
END_MESSAGE_MAP()


// zuichongjieguo 消息处理程序

BOOL zuichongjieguo::OnInitDialog()
{
	CDialog::OnInitDialog();
	CFont *font;              //创建字体
	 font=new CFont;
	font->CreateFont(36,0,0,0,700,0,0,0,
                ANSI_CHARSET,OUT_DEFAULT_PRECIS,
                CLIP_DEFAULT_PRECIS,
                DEFAULT_QUALITY,
                DEFAULT_PITCH|FF_DONTCARE,
                "黑体");
	CFont *font1;              //创建字体
	 font1=new CFont;
	font1->CreateFont(28,0,0,0,700,0,0,0,
                ANSI_CHARSET,OUT_DEFAULT_PRECIS,
                CLIP_DEFAULT_PRECIS,
                DEFAULT_QUALITY,
                DEFAULT_PITCH|FF_DONTCARE,
                "黑体");
	
	tou.SetFont(font);
	for(int i=0;i<5;i++){
		xiangmuming[i].SetFont(font);
		fenshuxianshic[i].SetFont(font);
		mingci[i].SetFont(font);
	}
	

	// TODO:  在此添加额外的初始化
	db.databaseconn();
	CString sql="select * from chengji where suoshusaishi="+saishixuhao+" order by chengji desc";
	db.datasearcher(sql);

	for(int j= 0;j<shumu;j++){
			if(!db.getrs()->adoeof){
			db.getrs()->MoveNext();
			
		}

	}
	for(int i=0;i<5;i++){
		
	if(!db.getrs()->adoeof){
			
				CString tempname=db.getrs()->GetFields()->GetItem("suoshuxuanshou")->GetValue();
				CString tsql="select top 1 * from xuanshou where xuhao="+tempname+"";
				db1.databaseconn();
				db1.datasearcher(tsql);
				if(!db1.getrs()->adoeof){	
				CString tempname1=db1.getrs()->GetFields()->GetItem("xiangmu")->GetValue();
				CString tempname2=db1.getrs()->GetFields()->GetItem("xuanshou")->GetValue();
				float fenshu=db.getrs()->GetFields()->GetItem("chengji")->GetValue();
				fenshu=((int)(fenshu*100))/100.00;
				CString xianshifen=_variant_t(fenshu);
				if(fenshu>0&&fenshu<1) xianshifen="0"+xianshifen;
				fenshuxianshic[i].SetWindowText(xianshifen);
				if (tempname2!="") tempname2="("+tempname2+")";
				CString tempname3=tempname1+tempname2;
				xiangmuming[i].SetWindowText(tempname3);
				CString mingcixianshi = _variant_t(shumu1);
				mingci[i].SetWindowText(mingcixianshi);
				shumu++;
				shumu1++;
				shumu2++;
							}
				else{
					i--;
				}
				db.getrs()->MoveNext();
				
		
	}
	else{
		xiangmuming[i].SetWindowText("");
		fenshuxianshic[i].SetWindowText("");
		mingci[i].SetWindowText("");
		shumu=0;
		shumu1=1;
		shumu2=5;
	}
	}
;
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}

void zuichongjieguo::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	OnInitDialog();
}

⌨️ 快捷键说明

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