You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.4 KiB
C++

#include "stdafx.h"
#include "LaiPuLaser.h"
#include "DlgWorkRecord.h"
#include "afxdialogex.h"
#include "WorkRecord.h"
#include "ProgramLaserTuiHuo.h"
#include "PenParMgr.h"
#include "LogMgr.h"
#include "MsgBox.h"
#include "GlobalFunction.h"
IMPLEMENT_DYNAMIC(CDlgWorkRecord, CDialogEx)
CDlgWorkRecord::CDlgWorkRecord(CWnd* pParent /*=NULL*/)
: CDialogEx(CDlgWorkRecord::IDD, pParent)
{
m_CurSelIdx = -1;//<2F><>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>ֵ
}
CDlgWorkRecord::~CDlgWorkRecord()
{
}
void CDlgWorkRecord::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_SEARCH_BTN, m_SearchBtn);
DDX_Control(pDX, IDC_RECORD_LIST, m_RecordList);
DDX_Control(pDX, IDC_RECORD_INFO_LIST, m_RecordInfoList);
DDX_Control(pDX, IDC_MONTHCALENDAR1, m_montCtrl);
DDX_Text(pDX, IDC_LOT_NUMBER, m_SearchNumber);
}
BEGIN_MESSAGE_MAP(CDlgWorkRecord, CDialogEx)
ON_NOTIFY(MCN_SELCHANGE, IDC_MONTHCALENDAR1, OnMcnSelchangecalendar)
ON_BN_CLICKED(IDC_SEARCH_BTN, &CDlgWorkRecord::OnBnClickedSearchBtn)
ON_NOTIFY(NM_CLICK, IDC_RECORD_LIST, &CDlgWorkRecord::OnNMClickList)
ON_BN_CLICKED(IDC_TO_EXCEL_BTN, &CDlgWorkRecord::OnBnClickedToExcelBtn)
END_MESSAGE_MAP()
BOOL CDlgWorkRecord::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_SearchBtn.SetUpColor(RGB_GREEN);
UpdateData(FALSE);
return TRUE;
}
//<2F><>Ӧ<EFBFBD><D3A6><EFBFBD>ڱ仯
void CDlgWorkRecord::OnMcnSelchangecalendar(NMHDR *pNMHDR, LRESULT *pResult)
{
m_CurSelIdx = -1;
*pResult = 0;
}
CString CDlgWorkRecord::GetSelDate()
{
CTime month;
m_montCtrl.GetCurSel(month); //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
CWorkTime WorkTime;
CString SelDate = WorkTime.GetDateStr(month,"_");
return SelDate;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
void CDlgWorkRecord::OnNMClickList(NMHDR *pNMHDR, LRESULT *pResult)
{
*pResult = 0;
int idx = GetCurListIdx(m_RecordList);
if(idx>=0)
{
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>idx Ϊ<><CEAA>ǰ<EFBFBD><C7B0>¼
m_CurSelIdx = idx;
}
}
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>к<EFBFBD>
bool CDlgWorkRecord::CheckCurSelIdx()
{
if(m_CurSelIdx<0)
{
CMsgBox MsgBox;
MsgBox.Show("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>¼!");
return false;
}
return true;
}
//ͨ<><CDA8>ID <20>Ų<EFBFBD><C5B2>Ҽ<EFBFBD>¼
void CDlgWorkRecord::OnBnClickedSearchBtn()
{
if(!UpdateData(TRUE))
return;
m_CurSelIdx = -1;
}
//ѡ<>еļ<D0B5>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>excel
void CDlgWorkRecord::OnBnClickedToExcelBtn()
{
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>к<EFBFBD>
if(!CheckCurSelIdx())
return;
}