📄 protectdlg.cpp
字号:
// ProtectDlg.cpp : implementation file
//
#include "stdafx.h"
#include "trans.h"
#include "ProtectDlg.h"
#include "Protect.h"
#include "RepTabDlg.h"
#include "column.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProtectDlg dialog
CProtectDlg::CProtectDlg(CWnd* pParent /*=NULL*/)
: CDialog(CProtectDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProtectDlg)
m_DiffTime = _T("");
m_FlowLoad = _T("");
m_Gas = _T("");
m_Trem = _T("");
m_ZeroI = _T("");
m_ZeroV = _T("");
m_ProtectId = _T("");
//}}AFX_DATA_INIT
}
void CProtectDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProtectDlg)
DDX_Text(pDX, IDC_DIFFTIME, m_DiffTime);
DDX_Text(pDX, IDC_FLOWLOAD, m_FlowLoad);
DDX_Text(pDX, IDC_GAS, m_Gas);
DDX_Text(pDX, IDC_TREM, m_Trem);
DDX_Text(pDX, IDC_ZEROI, m_ZeroI);
DDX_Text(pDX, IDC_ZEROV, m_ZeroV);
DDX_Text(pDX, IDC_PRETECTID, m_ProtectId);
DDX_Control(pDX, IDC_DATAGRID1, m_datagrid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProtectDlg, CDialog)
//{{AFX_MSG_MAP(CProtectDlg)
ON_BN_CLICKED(IDC_PROTECT_INSERT, OnProtectInsert)
ON_BN_CLICKED(IDC_PROTECT_DELETE, OnProtectDelete)
ON_BN_CLICKED(IDC_SPRINT6, OnSprint6)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProtectDlg message handlers
void CProtectDlg::OnProtectInsert()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData();
CProtect pro;
pro.DiffTime=m_DiffTime;
pro.FlowLoad=m_FlowLoad;
pro.Gas=m_Gas;
pro.ProtectId=m_ProtectId;
pro.Trem=m_Trem;
pro.ZeroI=m_ZeroI;
pro.ZeroV=m_ZeroV;
pro.sql_insert();
}
void CProtectDlg::OnProtectDelete()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData();
CProtect pro;
pro.sql_delete(m_ProtectId);
}
void CProtectDlg::OnSprint6()
{
CString str;
CRepTabDlg dlg;
dlg.strTitle="保护";
dlg.nColCount=7;
dlg.nRowCount=5;
dlg.arrTxt.Add("变压器编号");
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<7;j++)
{
str=m_datagrid.GetItem(j);
dlg.arrTxt.Add(str);
}
}
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -