📄 filter.cpp
字号:
// Filter.cpp : implementation file
//
#include "stdafx.h"
#include "trans.h"
#include "Filter.h"
#include "Filter1.h"
#include "RepTabDlg.h"
#include "column.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFilter dialog
CFilter::CFilter(CWnd* pParent /*=NULL*/)
: CDialog(CFilter::IDD, pParent)
{
//{{AFX_DATA_INIT(CFilter)
m_ErrorEnd = _T("");
m_ErrorI = _T("");
m_ErrorPhase = _T("");
m_ErrorStart = _T("");
m_ErrorV = _T("");
m_FilterId = _T("");
//}}AFX_DATA_INIT
}
void CFilter::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFilter)
DDX_Text(pDX, IDC_ERROR_END, m_ErrorEnd);
DDX_Text(pDX, IDC_ERROR_I, m_ErrorI);
DDX_Text(pDX, IDC_ERROR_PHASE, m_ErrorPhase);
DDX_Text(pDX, IDC_ERROR_START, m_ErrorStart);
DDX_Text(pDX, IDC_ERROR_V, m_ErrorV);
DDX_Text(pDX, IDC_FILTERID, m_FilterId);
DDX_Control(pDX, IDC_DATAGRID1, m_datagrid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFilter, CDialog)
//{{AFX_MSG_MAP(CFilter)
ON_BN_CLICKED(IDC_FILTERINSERT, OnFilterinsert)
ON_BN_CLICKED(IDC_FILTERDELETE, OnFilterdelete)
ON_BN_CLICKED(IDC_PRINT7, OnPrint7)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFilter message handlers
void CFilter::OnFilterinsert()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData();
CFilter1 filter;
filter.ErrorEnd=m_ErrorEnd;
filter.ErrorI=m_ErrorI;
filter.ErrorPhase=m_ErrorPhase;
filter.ErrorStart=m_ErrorStart;
filter.ErrorV=m_ErrorV;
filter.FilterId=m_FilterId;
filter.sql_insert();
}
void CFilter::OnFilterdelete()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData();
CFilter1 filter;
filter.sql_delete(m_FilterId);
}
void CFilter::OnPrint7()
{
CString str;
CRepTabDlg dlg;
dlg.strTitle="故障滤波器";
dlg.nColCount=6;
dlg.nRowCount=5;
dlg.arrTxt.Add("故障编号");
dlg.arrTxt.Add("故障相");
dlg.arrTxt.Add("故障电流");
dlg.arrTxt.Add("故障电压");
dlg.arrTxt.Add("故障开始时间");
dlg.arrTxt.Add("故障结束时间");
for(int i=0;i<4;i++)
{
m_datagrid.SetRow(i);
for(long j=0;j<6;j++)
{
str=m_datagrid.GetItem(j);
dlg.arrTxt.Add(str);
}
}
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -