📄 suntekview.cpp
字号:
// SUNTEKView.cpp : implementation of the CSUNTEKView class
//
#include "stdafx.h"
#include "SUNTEK.h"
#include "SUNTEKDoc.h"
#include "SUNTEKView.h"
#include "RecordsetPassword.h"
#include "MessageDlg.h"
#include "IOMonitorDlg.h"
#include "CheckDlg.h"
//add necessary head files
#include "TBoundDlg.h"
#include "XYRBoundDlg.h"
#include "Report_21RF1.h"
#include "Report_29SF.h"
#include "Report_51FS.h"
#include "Report_59FS.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView
IMPLEMENT_DYNCREATE(CSUNTEKView, CView)
BEGIN_MESSAGE_MAP(CSUNTEKView, CView)
//{{AFX_MSG_MAP(CSUNTEKView)
ON_COMMAND(ID_OPERATE_MESSAGE, OnOperateMessage)
ON_COMMAND(ID_IOMONITOR, OnIomonitor)
ON_COMMAND(ID_CHECK, OnCheck)
ON_COMMAND(ID_MENU_COCL, OnMenuCocl)
ON_COMMAND(ID_MENU_COSTAT, OnMenuCostat)
ON_COMMAND(ID_MENU_COSTD, OnMenuCostd)
ON_COMMAND(ID_MENUITEM_TBOUND, OnMenuitemTbound)
ON_COMMAND(ID_MENUITEM_XYRBOUND, OnMenuitemXyrbound)
ON_COMMAND(ID_MAINMENU_VIEW_21RF, OnMainmenuView21rf)
ON_COMMAND(ID_MAINMENU_VIEW_29SF, OnMainmenuView29sf)
ON_COMMAND(ID_MAINMENU_VIEW_51FS, OnMainmenuView51fs)
ON_COMMAND(ID_MAINMENU_VIEW_59FS, OnMainmenuView59fs)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView construction/destruction
CSUNTEKView::CSUNTEKView()
{
// TODO: add construction code here
}
CSUNTEKView::~CSUNTEKView()
{
}
BOOL CSUNTEKView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView drawing
void CSUNTEKView::OnDraw(CDC* pDC)
{
CSUNTEKDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CBrush newbrush,*oldbrush;
newbrush.CreateSolidBrush(RGB(67,220,79));
oldbrush=(CBrush*)pDC->SelectObject(&newbrush);
CRect rect;
GetClientRect(rect);
pDC->FillRect(&rect,&newbrush);
pDC->SelectObject(oldbrush);
newbrush.DeleteObject();
CFont newfont,*oldfont;
newfont.CreateFont(
120, // nHeight
(rect.right-rect.left)/17, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"); // lpszFacename
oldfont=pDC->SelectObject(&newfont);
pDC->SetBkColor(RGB(67,220,79));
pDC->TextOut((rect.right-rect.left)/4,-(rect.top-rect.bottom)/4,"舜邦科技");
CFont newfontEnglish,*oldfontEnglish;
newfontEnglish.CreateFont(
50, // nHeight
(rect.right-rect.left)/17, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"); // lpszFacename
oldfontEnglish=pDC->SelectObject(&newfontEnglish);
pDC->SetBkColor(RGB(67,220,79));
pDC->TextOut((rect.right-rect.left)/4+30,-(rect.top-rect.bottom)/3+100,"suntek");
newfontEnglish.DeleteObject();
pDC->SelectObject(oldfontEnglish);
}
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView printing
BOOL CSUNTEKView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSUNTEKView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSUNTEKView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView diagnostics
#ifdef _DEBUG
void CSUNTEKView::AssertValid() const
{
CView::AssertValid();
}
void CSUNTEKView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSUNTEKDoc* CSUNTEKView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSUNTEKDoc)));
return (CSUNTEKDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSUNTEKView message handlers
void CSUNTEKView::OnOperateMessage()
{
// TODO: Add your command handler code here
CMessageDlg dlg;
dlg.DoModal();
}
void CSUNTEKView::OnIomonitor()
{
// TODO: Add your command handler code here
CIOMonitorDlg dlg;
dlg.DoModal();
}
void CSUNTEKView::OnCheck()
{
// TODO: Add your command handler code here
CCheckDlg dlg;
if(dlg.DoModal()==IDOK)
{
Sleep(800);
CMessageDlg MessageDlg;
MessageDlg.DoModal();
}
}
void CSUNTEKView::OnMenuCocl()
{
CRecCL n_recCL;
if(AfxMessageBox("删除数据吗?",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
{
int nTempCountDel=0;
if(n_recCL.IsOpen())
n_recCL.Close();
n_recCL.Open();
if(!(n_recCL.IsEOF()&&n_recCL.IsBOF()))
{
n_recCL.MoveFirst();
while(!n_recCL.IsEOF())
{
n_recCL.MoveNext();
}
nTempCountDel=n_recCL.GetRecordCount();
if(n_recCL.IsEOF())
n_recCL.MovePrev();
}
while(nTempCountDel)
{
n_recCL.MoveLast();
n_recCL.Delete();
nTempCountDel--;
}
n_recCL.Close();
}
}
void CSUNTEKView::OnMenuCostat()
{
CRecSTAT n_recSTAT;
if(AfxMessageBox("删除数据吗?",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
{
int nTempCountDel=0;
if(n_recSTAT.IsOpen())
n_recSTAT.Close();
n_recSTAT.Open();
if(!(n_recSTAT.IsEOF()&&n_recSTAT.IsBOF()))
{
n_recSTAT.MoveFirst();
while(!n_recSTAT.IsEOF())
{
n_recSTAT.MoveNext();
}
nTempCountDel=n_recSTAT.GetRecordCount();
if(n_recSTAT.IsEOF())
n_recSTAT.MovePrev();
}
while(nTempCountDel)
{
n_recSTAT.MoveLast();
n_recSTAT.Delete();
nTempCountDel--;
}
n_recSTAT.Close();
}
}
void CSUNTEKView::OnMenuCostd()
{
CRecsetSTD n_recSTD;
if(AfxMessageBox("删除数据吗?",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
{
int nTempCountDel=0;
if(n_recSTD.IsOpen())
n_recSTD.Close();
n_recSTD.Open();
if(!(n_recSTD.IsEOF()&&n_recSTD.IsBOF()))
{
n_recSTD.MoveFirst();
while(!n_recSTD.IsEOF())
{
n_recSTD.MoveNext();
}
nTempCountDel=n_recSTD.GetRecordCount();
if(n_recSTD.IsEOF())
n_recSTD.MovePrev();
}
while(nTempCountDel)
{
n_recSTD.MoveLast();
n_recSTD.Delete();
nTempCountDel--;
}
n_recSTD.Close();
}
}
void CSUNTEKView::OnMenuitemTbound()
{
// TODO: Add your command handler code here
CTBoundDlg tboundDlg;
tboundDlg.DoModal();
}
void CSUNTEKView::OnMenuitemXyrbound()
{
// TODO: Add your command handler code here
CXYRBoundDlg xyrBoundDlg;
xyrBoundDlg.DoModal();
}
void CSUNTEKView::OnMainmenuView21rf()
{
// TODO: Add your command handler code here
CReport_21RF dlg;
dlg.DoModal();
}
void CSUNTEKView::OnMainmenuView29sf()
{
// TODO: Add your command handler code here
CReport_29SF dlg;
dlg.DoModal();
}
void CSUNTEKView::OnMainmenuView51fs()
{
// TODO: Add your command handler code here
CReport_51FS dlg;
dlg.DoModal();
}
void CSUNTEKView::OnMainmenuView59fs()
{
// TODO: Add your command handler code here
CReport_59FS dlg;
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -