📄 patrolmandlg.cpp
字号:
// PatrolManDlg.cpp : implementation file
//
#include "stdafx.h"
#include "trans.h"
#include "PatrolManDlg.h"
#include "PatrolMan.h"
#include "RepTabDlg.h"
#include "column.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPatrolManDlg dialog
CPatrolManDlg::CPatrolManDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPatrolManDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPatrolManDlg)
m_PatrolPhone = _T("");
m_PatrolName = _T("");
m_PatrolId = _T("");
m_PatrolAddress = _T("");
m_PatrolManSex = _T("");
m_CutId = _T("");
//}}AFX_DATA_INIT
}
void CPatrolManDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPatrolManDlg)
DDX_Text(pDX, IDC_EDIT_PHONE, m_PatrolPhone);
DDX_Text(pDX, IDC_EDIT_NAME, m_PatrolName);
DDX_Text(pDX, IDC_EDIT_ID, m_PatrolId);
DDX_Text(pDX, IDC_EDIT_ADDRESS, m_PatrolAddress);
DDX_Text(pDX, IDC_EDIT1, m_PatrolManSex);
DDX_Text(pDX, IDC_CUT_ID, m_CutId);
DDX_Control(pDX, IDC_DATAGRID1, m_datagrid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPatrolManDlg, CDialog)
//{{AFX_MSG_MAP(CPatrolManDlg)
ON_BN_CLICKED(IDC_BUTTON_INSERT, OnButtonInsert)
ON_BN_CLICKED(IDC_BUTTON_CUT, OnButtonCut)
ON_BN_CLICKED(IDC_SPRINT1, OnSprint1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPatrolManDlg message handlers
void CPatrolManDlg::OnButtonInsert()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData(TRUE);
CPatrolMan PMan;
PMan.PatrolManId=m_PatrolId;
PMan.PatrolManName=m_PatrolName;
PMan.PatrolManSex=m_PatrolManSex;
PMan.PatrolManPhone=m_PatrolPhone;
PMan.PatrolManAddress=m_PatrolAddress;
PMan.sql_insert();
}
void CPatrolManDlg::OnButtonCut()
{
if(bUserType=="000")
{
MessageBox("你没有权限,请与管理员联系!");
return;
}
this->UpdateData(TRUE);
CPatrolMan PMan;
PMan.sql_delete(m_PatrolId);
}
void CPatrolManDlg::OnSprint1()
{
CString str;
CRepTabDlg dlg;
dlg.strTitle="巡检人情况";
dlg.nColCount=5;
dlg.nRowCount=5;
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<5;j++)
{
str=m_datagrid.GetItem(j);
dlg.arrTxt.Add(str);
}
}
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -