LocalUserRenameDlg.cpp
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
源码类别:

网格计算

开发平台:

Visual C++

  1. // LocalUserRenameDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "trfAgent.h"
  5. #include "LocalUserRenameDlg.h"
  6. #include "variantex.h"
  7. // CLocalUserRenameDlg dialog
  8. CLocalUserRenameDlg::CLocalUserRenameDlg(CWnd* pParent /*=NULL*/)
  9. : CDialog(CLocalUserRenameDlg::IDD, pParent)
  10. {
  11. this->m_nRenamedAgentId = 0;
  12. //{{AFX_DATA_INIT(CLocalUserRenameDlg)
  13. m_sNewUsrName = _T("");
  14. //}}AFX_DATA_INIT
  15. }
  16. void CLocalUserRenameDlg::DoDataExchange(CDataExchange* pDX)
  17. {
  18. CDialog::DoDataExchange(pDX);
  19. //{{AFX_DATA_MAP(CLocalUserRenameDlg)
  20. DDX_Text(pDX, IDC_EDTUSRNAME, m_sNewUsrName);
  21. DDV_MaxChars(pDX, m_sNewUsrName, 32);
  22. //}}AFX_DATA_MAP
  23. }
  24. BEGIN_MESSAGE_MAP(CLocalUserRenameDlg, CDialog)
  25. //{{AFX_MSG_MAP(CLocalUserRenameDlg)
  26. //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28. // CLocalUserRenameDlg message handlers
  29. BOOL CLocalUserRenameDlg::OnInitDialog() 
  30. {
  31. CDialog::OnInitDialog();
  32. this->CenterWindow();
  33. return TRUE;
  34. }
  35. void CLocalUserRenameDlg::OnOK() 
  36. {
  37. CGuiRecordSet rs;
  38. CVariantEx varex;
  39. bool result;
  40. UpdateData(TRUE);
  41. //if variable is zero then using default value.
  42. if(this->m_nRenamedAgentId == 0)
  43. {
  44. this->m_nRenamedAgentId = theApp.m_oCSHelper.GetClientID();
  45. }
  46. if(this->m_sNewUsrName.IsEmpty())
  47. {
  48. MSGBOX_WARNING(_LoadString(IDS_USERNAMEEMPTY).GetBuffer(0));
  49. return ;
  50. }
  51. result = theApp.m_oCSHelper.AGRename(this->m_sNewUsrName.GetBuffer(0), 
  52.  this->m_nRenamedAgentId);
  53. if(result)
  54. {
  55. MSGBOX_INFO(_LoadString(IDS_DBAGRENAME_OK).GetBuffer(0));
  56. }
  57. else
  58. {
  59. MSGBOX_INFO(_LoadString(IDS_DBAGRENAME_FAILED).GetBuffer(0));
  60. }
  61. //
  62. CDialog::OnOK();
  63. }
  64. void CLocalUserRenameDlg::SetRenamedAgentId(const int nAgentId)
  65. {
  66. this->m_nRenamedAgentId = nAgentId;
  67. }