提交 df0abc3b 编写于 作者: xengine-qyt's avatar xengine-qyt

added:modify user information

上级 8f707dc5
// CDialog_Info.cpp: 实现文件
//
#include "pch.h"
#include "../XEngine_AuthorizeApp.h"
#include "CDialog_Info.h"
#include "afxdialogex.h"
// CDialog_Info 对话框
IMPLEMENT_DYNAMIC(CDialog_Info, CDialogEx)
CDialog_Info::CDialog_Info(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG_MODIFY, pParent)
{
}
CDialog_Info::~CDialog_Info()
{
}
void CDialog_Info::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, m_EditUser);
DDX_Control(pDX, IDC_EDIT11, m_EditPass);
DDX_Control(pDX, IDC_EDIT16, m_EditEMail);
DDX_Control(pDX, IDC_EDIT17, m_EditPhone);
DDX_Control(pDX, IDC_EDIT18, m_EditCardID);
DDX_Control(pDX, IDC_EDIT19, m_EditLeftTime);
DDX_Control(pDX, IDC_COMBO1, m_ComboType);
}
BEGIN_MESSAGE_MAP(CDialog_Info, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON6, &CDialog_Info::OnBnClickedButton6)
ON_BN_CLICKED(IDC_BUTTON7, &CDialog_Info::OnBnClickedButton7)
END_MESSAGE_MAP()
// CDialog_Info 消息处理程序
BOOL CDialog_Info::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
CDialog_User* pWnd = (CDialog_User*)CDialog_User::FromHandle(hUserWnd);
POSITION pSt_Sition = pWnd->m_ListCtrlOnlineClient.GetFirstSelectedItemPosition();
int nItemCount = pWnd->m_ListCtrlOnlineClient.GetNextSelectedItem(pSt_Sition);
CString m_StrUser = pWnd->m_ListCtrlOnlineClient.GetItemText(nItemCount, 1);
AUTHREG_USERTABLE st_UserTable;
memset(&st_UserTable, '\0', sizeof(AUTHREG_USERTABLE));
AuthService_SQLPacket_UserQuery(m_StrUser.GetBuffer(), &st_UserTable);
m_EditUser.SetWindowText(m_StrUser);
m_EditPass.SetWindowText(st_UserTable.st_UserInfo.tszUserPass);
m_EditEMail.SetWindowText(st_UserTable.st_UserInfo.tszEMailAddr);
CString m_StrNumber;
m_StrNumber.Format(_T("%lld"), st_UserTable.st_UserInfo.nIDNumber);
m_EditCardID.SetWindowText(m_StrNumber);
m_StrNumber.ReleaseBuffer();
m_StrNumber.Format(_T("%lld"), st_UserTable.st_UserInfo.nPhoneNumber);
m_EditPhone.SetWindowText(m_StrNumber);
m_EditLeftTime.SetWindowText(st_UserTable.tszLeftTime);
m_ComboType.InsertString(0, _T("未知"));
m_ComboType.InsertString(1, _T("分钟"));
m_ComboType.InsertString(2, _T("天数"));
m_ComboType.InsertString(3, _T("次数"));
m_ComboType.InsertString(4, _T("自定义"));
m_ComboType.SetCurSel(st_UserTable.en_AuthRegSerialType);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CDialog_Info::OnBnClickedButton6()
{
// TODO: 在此添加控件通知处理程序代码
AUTHREG_USERTABLE st_UserTable;
memset(&st_UserTable, '\0', sizeof(AUTHREG_USERTABLE));
m_EditUser.GetWindowText(st_UserTable.st_UserInfo.tszUserName, sizeof(st_UserTable.st_UserInfo.tszUserName));
m_EditPass.GetWindowText(st_UserTable.st_UserInfo.tszUserPass, sizeof(st_UserTable.st_UserInfo.tszUserPass));
m_EditEMail.GetWindowText(st_UserTable.st_UserInfo.tszEMailAddr, sizeof(st_UserTable.st_UserInfo.tszEMailAddr));
m_EditLeftTime.GetWindowText(st_UserTable.tszLeftTime, sizeof(st_UserTable.tszLeftTime));
CString m_StrNumber;
m_EditPhone.GetWindowText(m_StrNumber);
st_UserTable.st_UserInfo.nPhoneNumber = _ttoi64(m_StrNumber.GetBuffer());
m_StrNumber.ReleaseBuffer();
m_EditCardID.GetWindowText(m_StrNumber);
st_UserTable.st_UserInfo.nIDNumber = _ttoi64(m_StrNumber.GetBuffer());
st_UserTable.en_AuthRegSerialType = (ENUM_HELPCOMPONENTS_AUTHORIZE_SERIAL_TYPE)m_ComboType.GetCurSel();
if (AuthService_SQLPacket_UserSet(&st_UserTable))
{
AfxMessageBox(_T("修改成功"));
}
else
{
AfxMessageBox(_T("修改失败"));
}
OnOK();
}
void CDialog_Info::OnBnClickedButton7()
{
// TODO: 在此添加控件通知处理程序代码
OnCancel();
}
#pragma once
// CDialog_Info 对话框
class CDialog_Info : public CDialogEx
{
DECLARE_DYNAMIC(CDialog_Info)
public:
CDialog_Info(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CDialog_Info();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG_MODIFY };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CEdit m_EditUser;
CEdit m_EditPass;
CEdit m_EditEMail;
CEdit m_EditPhone;
CEdit m_EditCardID;
CEdit m_EditLeftTime;
CComboBox m_ComboType;
virtual BOOL OnInitDialog();
afx_msg void OnBnClickedButton6();
afx_msg void OnBnClickedButton7();
};
......@@ -54,6 +54,8 @@ BOOL CDialog_User::OnInitDialog()
m_ListCtrlOnlineClient.InsertColumn(5, _T("充值类型"), LVCFMT_LEFT, 80);
m_ListCtrlOnlineClient.InsertColumn(6, _T("设备类型"), LVCFMT_LEFT, 80);
m_ListCtrlOnlineClient.SetExtendedStyle(LVS_EX_FULLROWSELECT);
hUserWnd = this->m_hWnd;
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
......@@ -139,12 +141,8 @@ void CDialog_User::OnBnClickedButton2()
return;
}
CString m_StrSerial = m_ListCtrlOnlineClient.GetItemText(nItemCount, 4);
if (nItemCount <= 0)
{
AfxMessageBox(_T("你没有选择任何用户!"));
return;
}
AfxMessageBox(_T("暂时不支持!"));
CDialog_Info m_DlgInfo;
m_DlgInfo.DoModal();
}
......
......@@ -5,8 +5,9 @@ void __stdcall XEngine_TaskEvent_Client(LPCSTR lpszUserAddr, LPCSTR lpszUserName
{
CXEngineAuthorizeAppDlg* pClass_This = (CXEngineAuthorizeAppDlg*)lParam;
CString m_StrFormat;
int nListCount = pClass_This->m_DlgUser.m_ListCtrlOnlineClient.GetItemCount();
for (int i = 0; i < pClass_This->m_DlgUser.m_ListCtrlOnlineClient.GetItemCount(); i++)
for (int i = 0; i < nListCount; i++)
{
CString m_StrUser = pClass_This->m_DlgUser.m_ListCtrlOnlineClient.GetItemText(i, 1);
if (0 == _tcsncmp(lpszUserName, m_StrUser.GetBuffer(), _tcslen(lpszUserName)))
......
......@@ -9,4 +9,6 @@ XHANDLE xhTCPPacket = 0;
XHANDLE xhWSPacket = 0;
XNETHANDLE xhTCPPool = 0;
XNETHANDLE xhWSPool = 0;
AUTHORIZE_CONFIGURE st_AuthConfig;
\ No newline at end of file
AUTHORIZE_CONFIGURE st_AuthConfig;
HWND hUserWnd = NULL;
\ No newline at end of file
......@@ -69,6 +69,8 @@ extern XNETHANDLE xhTCPPool;
extern XNETHANDLE xhWSPool;
extern AUTHORIZE_CONFIGURE st_AuthConfig;
extern HWND hUserWnd;
typedef struct
{
int nPoolIndex;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册