ReCharge.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // ReCharge.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "ReCharge.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // ReCharge dialog
  13. ReCharge::ReCharge(CWnd* pParent /*=NULL*/)
  14. : CDialog(ReCharge::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(ReCharge)
  17. m_account = _T("");
  18. m_name = _T("");
  19. m_money = _T("");
  20. m_count = _T("");
  21. m_price = _T("");
  22. //}}AFX_DATA_INIT
  23. }
  24. void ReCharge::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CDialog::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(ReCharge)
  28. DDX_Control(pDX, IDC_EDITcount, m_editnum2);
  29. DDX_Control(pDX, IDC_EDITmoney, m_editnum1);
  30. DDX_Text(pDX, IDC_EDITaccount, m_account);
  31. DDX_Text(pDX, IDC_EDITname, m_name);
  32. DDX_Text(pDX, IDC_EDITmoney, m_money);
  33. DDX_Text(pDX, IDC_EDITcount, m_count);
  34. DDX_Text(pDX, IDC_EDITprice, m_price);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(ReCharge, CDialog)
  38. //{{AFX_MSG_MAP(ReCharge)
  39. ON_EN_CHANGE(IDC_EDITmoney, OnChangeEDITmoney)
  40. ON_EN_CHANGE(IDC_EDITcount, OnChangeEDITcount)
  41. //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. // ReCharge message handlers
  45. BOOL ReCharge::OnInitDialog()
  46. {
  47. CDialog::OnInitDialog();
  48. // TODO: Add extra initialization here
  49. /* CRecordset myset(&g_db);
  50. CString sql="select ReCharge from ReCharge";
  51. myset.Open (CRecordset::forwardOnly, sql);
  52. myset.GetFieldValue ("ReCharge", m_oldReCharge);
  53. myset.Close();
  54. this->CenterWindow (g_pMainWnd);*/
  55. return TRUE; // return TRUE unless you set the focus to a control
  56. // EXCEPTION: OCX Property Pages should return FALSE
  57. }
  58. void ReCharge::OnChangeEDITmoney()
  59. {
  60. // TODO: If this is a RICHEDIT control, the control will not
  61. // send this notification unless you override the CDialog::OnInitDialog()
  62. // function and call CRichEditCtrl().SetEventMask()
  63. // with the ENM_CHANGE flag ORed into the mask.
  64. UpdateData();
  65. if(atof(m_count))
  66. {
  67. m_price.Format ("%0.4f", atof(m_money)/atof(m_count));
  68. }
  69. else
  70. m_price="0";
  71. UpdateData(false);
  72. // TODO: Add your control notification handler code here
  73. }
  74. void ReCharge::OnChangeEDITcount()
  75. {
  76. // TODO: If this is a RICHEDIT control, the control will not
  77. // send this notification unless you override the CDialog::OnInitDialog()
  78. // function and call CRichEditCtrl().SetEventMask()
  79. // with the ENM_CHANGE flag ORed into the mask.
  80. OnChangeEDITmoney();
  81. // TODO: Add your control notification handler code here
  82. }
  83. void ReCalAccount(CString account)
  84. {
  85. }
  86. void ReCharge::OnOK()
  87. {
  88. // TODO: Add extra validation here
  89. }