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

📄 dlgpr0001log.cpp

📁 用户管理系统
💻 CPP
字号:
// DlgPr001Log.cpp : implementation file
//

#include "stdafx.h"
#include "Kvip.h"
#include "DlgPr0001Log.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0001Log

IMPLEMENT_DYNCREATE(CDlgPr0001Log, CFormView)

CDlgPr0001Log::CDlgPr0001Log()
	: CFormView(CDlgPr0001Log::IDD)
{
	//{{AFX_DATA_INIT(CDlgPr0001Log)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_pConnection = NULL;
	m_pApp = NULL;
}

CDlgPr0001Log::~CDlgPr0001Log()
{
	m_Report.DestroyWindow();
}

void CDlgPr0001Log::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgPr0001Log)
	DDX_Control(pDX, IDC_UP, m_btUp);
	DDX_Control(pDX, IDC_DOWN, m_btDown);
	DDX_Control(pDX, IDC_CODE, m_edCode);
	DDX_Control(pDX, IDC_PRINT, m_btPrint);
	DDX_Control(pDX, IDC_DEP, m_Dep);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgPr0001Log, CFormView)
	//{{AFX_MSG_MAP(CDlgPr0001Log)
	ON_BN_CLICKED(IDC_RETRIEVE, OnRetrieve)
	ON_BN_CLICKED(IDC_PRINT, OnPrint)
	ON_BN_CLICKED(IDC_UP, OnUp)
	ON_BN_CLICKED(IDC_CANCEL, OnCancel)
	ON_BN_CLICKED(IDC_DOWN, OnDown)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0001Log diagnostics

#ifdef _DEBUG
void CDlgPr0001Log::AssertValid() const
{
	CFormView::AssertValid();
}

void CDlgPr0001Log::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0001Log message handlers

void CDlgPr0001Log::OnRetrieve() 
{
	// TODO: Add your control notification handler code here
  CString sCode	, sDep = _T("");
  CStringSQL sSQL;
//搜索
  int i = m_Dep.GetCurSel();
  if (i > 0) 
	  m_Dep.GetLBText(i, sDep);
  m_edCode.GetWindowText(sCode);
  sSQL.SetSelect(_T("Select * From kv_staff_mr, kv_rp_log"));
  sSQL.SetWhere("SM_CODE", sCode);
  sSQL.SetWhere("SM_DEPT", sDep, false);
  sSQL.SetWhere("SM_CODE", "RP_CODE", false, false);
  if(m_Report.Retrieve(sSQL.GetSQL()+_T(" Order by sm_code, sm_dept")) == 0)
	m_btPrint.EnableWindow(true);
}

void CDlgPr0001Log::OnPrint() 
{
	// TODO: Add your control notification handler code here
  m_Report.OnPrint("奖惩记录");
	
}

void CDlgPr0001Log::OnCancel() 
{
	// TODO: Add your control notification handler code here
  GetParent()->SendMessage(WM_CLOSE);
}

void CDlgPr0001Log::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CMyMdi Mdi;
	Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);

	m_pApp = (CKvipApp *)AfxGetApp();
	m_pConnection = m_pApp->m_pConWrite;
	if(m_pConnection == NULL) 
	{
		GetParent()->PostMessage(WM_CLOSE);
		return ;
	}
	// TODO: Add your specialized code here and/or call the base class
//1装入部门
	CString sSQL, sText;
	sSQL = _T("Select sm_Dept From kv_staff_mr group by sm_dept");
	m_RecordSet.SetAdoConnection(m_pConnection);
	if(m_RecordSet.Open(sSQL))
	{
	   while(m_RecordSet.IsEOF() == false)
	   {
	    m_RecordSet.GetCollect("sm_dept", sText);
        m_Dep.AddString(sText);
        m_RecordSet.MoveNext();
	   }
	}
	m_Dep.InsertString(0,"所有部门");
    m_Dep.SetCurSel(0);
//2初始化搜索窗口
	m_Report.Create(IDD_PR0001_LOG_TX, this);
	m_Report.m_Font.CreateFont(-12,0,0,0,FW_NORMAL,0,0,0,GB2312_CHARSET,0,0,0,2,"宋体");
	m_Report.SetConnect(m_pConnection);
	m_Report.Init();
	CRect rect;
	rect = CRect(30, 80, 680, 420);
	m_Report.MoveWindow(rect);
	m_Report.SetDoubleRam(TRUE);
	m_Report.ShowWindow(SW_SHOW);
	m_Report.SetPageButton(&m_btUp, &m_btDown);
	m_edCode.SetMask(_T("&#####"));
}

void CDlgPr0001Log::OnUp() 
{
	// TODO: Add your control notification handler code here
	m_Report.PageUp();

}

void CDlgPr0001Log::OnDown() 
{
	// TODO: Add your control notification handler code here
	m_Report.PageDown();
}

⌨️ 快捷键说明

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