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

📄 dlgpr0003day.cpp

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

#include "stdafx.h"
#include "Kvip.h"
#include "DlgPr0003Day.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0003Day

IMPLEMENT_DYNCREATE(CDlgPr0003Day, CFormView)

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

CDlgPr0003Day::~CDlgPr0003Day()
{
}

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


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

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0003Day diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CDlgPr0003Day message handlers

void CDlgPr0003Day::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	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);
//3类型 
	m_Project.InsertString(0,"正常ZC");
	m_Project.InsertString(0,"迟到QD");
	m_Project.InsertString(0,"早退ZT");
	m_Project.InsertString(0,"扩工KG");
	m_Project.InsertString(0,"全部");
    m_Project.SetCurSel(0);
//2初始化搜索窗口
	m_Report.Create(IDD_PR0003_DAY_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 CDlgPr0003Day::OnUp() 
{
	// TODO: Add your control notification handler code here
   m_Report.PageUp();
}

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

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

void CDlgPr0003Day::OnPrint() 
{
	// TODO: Add your control notification handler code here
  m_Report.OnPrint("考勤日报表");
	
}

void CDlgPr0003Day::OnRetrieve() 
{
	// TODO: Add your control notification handler code here
  CString sCode	, sDep = _T(""), sPro = _T(""), sDate = _T("");
  CStringSQL sSQL;
//搜索
  int i = m_Dep.GetCurSel();
  if (i > 0) 
	  m_Dep.GetLBText(i, sDep);
  i = m_Project.GetCurSel();
  if (i > 0) 
  {
	  m_Project.GetLBText(i, sPro);
	  sPro = sPro.Right(2);
  }
  m_Date.GetWindowText(sDate);
  sDate = _T("#") + sDate + _T("#");
  m_edCode.GetWindowText(sCode);
  sSQL.SetSelect(_T("Select * From kv_staff_mr, kv_kt_confirm"));
  sSQL.SetWhere("SM_CODE", sCode);
  sSQL.SetWhere("SM_DEPT", sDep, false);
  sSQL.SetWhere("kt_state", sPro, false);
  sSQL.SetWhere("kt_Date", sDate, false, false);
  sSQL.SetWhere("SM_CODE", "KT_CODE", false, false);
  if(m_Report.Retrieve(sSQL.GetSQL()+_T(" Order by sm_code, sm_dept")) == 0)
	m_btPrint.EnableWindow(true);
	
}

⌨️ 快捷键说明

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