CorpSms/DLG_Group_ModifyUsed.cpp

129 lines
3.2 KiB
C++
Raw Normal View History

2025-02-27 16:58:16 +08:00
// DLG_Group_ModifyUsed.cpp: 实现文件
//
#include "stdafx.h"
#include "CorpSms.h"
#include "afxdialogex.h"
#include "DLG_Group_ModifyUsed.h"
// DLG_Group_ModifyUsed 对话框
#include "MainFrm.h"
#include "FGAddress.h"
IMPLEMENT_DYNAMIC(DLG_Group_ModifyUsed, CDialogEx)
DLG_Group_ModifyUsed::DLG_Group_ModifyUsed(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_GROUP_MODIFYUSED, pParent)
, m_strCreateTime(_T(""))
, m_strCreateUser(_T(""))
, m_strLocal(_T(""))
, m_strHelp(_T(""))
, m_strMmsUsed(_T(""))
, m_strSmsUsed(_T(""))
{
m_pFGAddress = (CFGAddress*)pParent;
m_AdoRS.SetAdoConnection(&m_pFGAddress->m_pMainFrame->m_adoConnection);
memset(&m_GAdd, 0, sizeof(m_GAdd));
m_strDBName = "users";
memset(m_szLocal, 0, sizeof(m_szLocal));
m_strLocal = _T("");
m_bModifyUsed = false;
}
DLG_Group_ModifyUsed::~DLG_Group_ModifyUsed()
{
}
void DLG_Group_ModifyUsed::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_GROUPMODIFY_CREATETIME, m_strCreateTime);
DDX_Text(pDX, IDC_GROUPMODIFY_CREATEUSER, m_strCreateUser);
DDX_Text(pDX, IDC_GROUPMODIFY_LOCAL, m_strLocal);
DDX_Text(pDX, IDC_GROUPMODIFYUSED_HELP, m_strHelp);
DDX_Text(pDX, IDC_GROUPMODIFYUSED_MMS, m_strMmsUsed);
DDV_MaxChars(pDX, m_strMmsUsed, 10);
DDX_Text(pDX, IDC_GROUPMODIFYUSED_SMS, m_strSmsUsed);
DDV_MaxChars(pDX, m_strSmsUsed, 10);
}
BEGIN_MESSAGE_MAP(DLG_Group_ModifyUsed, CDialogEx)
ON_BN_CLICKED(IDOK, &DLG_Group_ModifyUsed::OnBnClickedOk)
END_MESSAGE_MAP()
// DLG_Group_ModifyUsed 消息处理程序
void DLG_Group_ModifyUsed::OnBnClickedOk()
{
if(!UpdateData(true))
return ;
m_bModifyUsed = false;
CString strTip, strTip2;
strTip.Format(_T("将要对%s的所有账号做以下修改\r\n\r\n"), m_strLocal);
if (m_strSmsUsed.GetLength() > 0)
{
strTip2.Format(_T("短信量统一修改成:%s条\r\n"), m_strSmsUsed);
m_bModifyUsed = true;
strTip += strTip2;
}
if (m_strMmsUsed.GetLength() > 0)
{
strTip2.Format(_T("彩信量统一修改成:%s条\r\n"), m_strMmsUsed);
m_bModifyUsed = true;
strTip += strTip2;
}
if (m_bModifyUsed)
{
int iRet = MessageBox(strTip,_T("提问"), MB_ICONQUESTION | MB_OKCANCEL|MB_DEFBUTTON2);
if (iRet != IDOK)
return;
}
CDialogEx::OnOK();
}
BOOL DLG_Group_ModifyUsed::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_strHelp = _T("注意:此操作会批量修改组(包含子组)下所有账号的短/彩信量限额为统一数值\r\n如有统计需要,请先记录好每个子账号的用量。\r\n修改后将无法还原!");
m_strLocal = m_szLocal;
m_strCreateUser = m_GAdd.szCreateUser;
m_strCreateTime.Format(_T("%04d.%02d.%02d %02d:%02d:%02d"), m_GAdd.tCreateTime.wYear, m_GAdd.tCreateTime.wMonth, m_GAdd.tCreateTime.wDay, m_GAdd.tCreateTime.wHour, m_GAdd.tCreateTime.wMinute, m_GAdd.tCreateTime.wSecond);
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void DLG_Group_ModifyUsed::SetParam(ANS_GAddress_Group_AddData GAdd, TCHAR* pLocal, CString strDBName)
{
m_GAdd = GAdd;
_tcscpy(m_szLocal, pLocal);
m_strDBName = strDBName;
}
ANS_GAddress_Group_AddData DLG_Group_ModifyUsed::GetParam()
{
return m_GAdd;
}