📄 newlogin.cpp
字号:
// NEWLOGIN.cpp : implementation file
//
#include "stdafx.h"
#include "library.h"
#include "NEWLOGIN.h"
#include "ReadSet.h"
#include "NewReaderInf.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNEWLOGIN dialog
CReadSet newlogin_readerset;
CNEWLOGIN::CNEWLOGIN(CWnd* pParent /*=NULL*/)
: CDialog(CNEWLOGIN::IDD, pParent)
{
//{{AFX_DATA_INIT(CNEWLOGIN)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CNEWLOGIN::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNEWLOGIN)
DDX_Control(pDX, IDC_MSFLEXGRID1, m_grid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNEWLOGIN, CDialog)
//{{AFX_MSG_MAP(CNEWLOGIN)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNEWLOGIN message handlers
BOOL CNEWLOGIN::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_grid.SetCols(4);
m_grid.SetRows(10);
m_grid.SetRow(0);
m_grid.SetCol(0);
m_grid.SetText("序号");
m_grid.SetCol(1);
m_grid.SetText("读者姓名");
m_grid.SetCol(2);
m_grid.SetText("读者登陆号");
m_grid.SetCol(3);
m_grid.SetText("状态");
newlogin_readerset.m_strFilter="lever=0";
newlogin_readerset.Open();
int row=1;
CString str;
while(!newlogin_readerset.IsEOF())
{
m_grid.SetRow(row);
m_grid.SetCol(0);
str.Format("%d",row);
m_grid.SetText(str);
m_grid.SetCol(1);
m_grid.SetText(newlogin_readerset.m_Readername);
m_grid.SetCol(2);
m_grid.SetText(newlogin_readerset.m_ReaderId);
m_grid.SetCol(3);
m_grid.SetText("未通过验证");
newlogin_readerset.MoveNext();
row++;
}
newlogin_readerset.Close();
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BEGIN_EVENTSINK_MAP(CNEWLOGIN, CDialog)
//{{AFX_EVENTSINK_MAP(CNEWLOGIN)
ON_EVENT(CNEWLOGIN, IDC_MSFLEXGRID1, -605 /* MouseDown */, OnMouseDownMsflexgrid1, VTS_I2 VTS_I2 VTS_I4 VTS_I4)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CNEWLOGIN::OnMouseDownMsflexgrid1(short Button, short Shift, long x, long y)
{
// TODO: Add your control notification handler code here
int i=m_grid.GetMouseRow();
m_grid.SetCol(1);
if(m_grid.GetText()=="")
MessageBox("请选择一个用户");
else
{
m_grid.SetCol(3);
CString status=m_grid.GetText();
if(status=="通过验证")
MessageBox("这个读者已经通过验证!");
else
{
if(status=="拒绝验证")
MessageBox("这个读者已经被拒绝验证!");
else
{
m_grid.SetCol(2);
CString backid=m_grid.GetText();
NewReaderInf readerinf;
readerinf.readerid=backid;
readerinf.DoModal();
m_grid.SetCol(3);
switch(readerinf.back)
{
case 1: m_grid.SetText("通过验证");
break;
case 2:m_grid.SetText("拒绝验证");
break;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -