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

📄 stsbugdlg.cpp

📁 基本信息的添加、修改、删除和查询。基本信息包括配件信息、维修项目信息和故障定义信息。此功能为修车业务信息管理提供数据。 业务信息的添加、修改、删除和查询。业务信息包括业务登记信息和业务结算统计等。
💻 CPP
字号:
// StsBugDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CarService.h"
#include "StsBugDlg.h"
#include "COMDEF.H"
#include "Columns.h"
#include "Column.h"
#include "_Recordset.h"

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

/////////////////////////////////////////////////////////////////////////////
// CStsBugDlg dialog


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


void CStsBugDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStsBugDlg)
	DDX_Control(pDX, IDC_ADODC1, m_Adodc);
	DDX_Control(pDX, IDC_DATAGRID1, m_Datagrid);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CStsBugDlg message handlers

BOOL CStsBugDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	RefreshData();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
// 更新数据
void CStsBugDlg::RefreshData()
{
	UpdateData(TRUE);
	// 设置Select语句
	CString cSource = "SELECT b.BugName AS 故障名称, "
		"(Case  When Count(l.BugId) Is Null Then 0 Else Count(l.BugId) End) AS 故障数量"
		" FROM Bugs b Left Join ListBug l On b.BugId=l.BugId"
		" Group By b.BugName ";

	//刷新ADO Data控件的记录源
	m_Adodc.SetRecordSource(cSource);
	m_Adodc.Refresh();
	
	//设置列宽度
	_variant_t vIndex;
	vIndex = long(0);
	m_Datagrid.GetColumns().GetItem(vIndex).SetWidth(200);
	vIndex = long(1);
	m_Datagrid.GetColumns().GetItem(vIndex).SetWidth(100);
}

⌨️ 快捷键说明

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