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

📄 useralltimedlg.cpp

📁 计算机管理系统可以实现开机时自动运行
💻 CPP
字号:
// useralltimeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "System.h"
#include "useralltimeDlg.h"
#include "upassword.h"
#include "utime.h"

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

/////////////////////////////////////////////////////////////////////////////
// useralltimeDlg dialog


useralltimeDlg::useralltimeDlg(CWnd* pParent /*=NULL*/)
: CDialog(useralltimeDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(useralltimeDlg)
	// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void useralltimeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(useralltimeDlg)
	DDX_Control(pDX, IDC_MSFLEXGRID1, m_MSFGrid);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(useralltimeDlg, CDialog)
//{{AFX_MSG_MAP(useralltimeDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// useralltimeDlg message handlers

BOOL useralltimeDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	upassword upass;
	upass.Open();
	upass.MoveFirst();
	utime utime;
	utime.Open();
//time.MoveFirst();
	m_MSFGrid.SetCols(upass.m_nFields+1);
    m_MSFGrid.SetRows(upass.GetRecordCount()+1);
	
	RECT rect;
    m_MSFGrid.GetWindowRect(&rect);
	int wind=rect.right-rect.left;

	m_MSFGrid.SetColWidth(1,wind/3);
	m_MSFGrid.SetColWidth(2,wind/3);
	m_MSFGrid.SetColWidth(3,wind/3);
	
	m_MSFGrid.SetRow(0);
	m_MSFGrid.SetCol(1);
	m_MSFGrid.SetText("学号");
	m_MSFGrid.SetRow(0);
	m_MSFGrid.SetCol(2);
	m_MSFGrid.SetText("姓名");
	m_MSFGrid.SetRow(0);
	m_MSFGrid.SetCol(3);
	m_MSFGrid.SetText("总时间");
	//UpdateData(false);
    
	int tem=0;
	int iRow=1;
	while(!upass.IsEOF())
	{
		utime.MoveFirst();
		while(!utime.IsEOF())
		{			
			if(upass.m_usno==utime.m_usno)
			{
				CString str;
				str.Format("记录%d",iRow);
				m_MSFGrid.SetRow(iRow);
				m_MSFGrid.SetCol(0);
				m_MSFGrid.SetText(str);

				m_MSFGrid.SetRow(iRow);
				m_MSFGrid.SetCol(1);
				m_MSFGrid.SetText(upass.m_usno);
				m_MSFGrid.SetRow(iRow);
				m_MSFGrid.SetCol(2);
				m_MSFGrid.SetText(upass.m_uname);
				iRow++;
				//utime.MoveLast();
				break;
			}
			else
				utime.MoveNext();
		}
		upass.MoveNext();
	}
	
	
	UpdateData(false);
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}


⌨️ 快捷键说明

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