TakeMoney4.cpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // TakeMoney4.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TakeMoney4.h"
  6. #include "InputMemberno.h"
  7. #include "UseMemberCard.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // TakeMoney4 dialog
  15. TakeMoney4::TakeMoney4(CWnd* pParent /*=NULL*/)
  16. : CDialog(TakeMoney4::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(TakeMoney4)
  19. m_id = _T("");
  20. m_name1 = _T("");
  21. m_name2 = _T("");
  22. m_sum1 = _T("");
  23. m_sum2 = _T("");
  24. m_sum3 = _T("");
  25. //}}AFX_DATA_INIT
  26. }
  27. void TakeMoney4::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CDialog::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(TakeMoney4)
  31. DDX_Control(pDX, IDC_LIST3, m_List2);
  32. DDX_Control(pDX, IDC_LIST1, m_List1);
  33. DDX_Text(pDX, IDC_EDITid, m_id);
  34. DDX_Text(pDX, IDC_EDITname1, m_name1);
  35. DDX_Text(pDX, IDC_EDITname2, m_name2);
  36. DDX_Text(pDX, IDC_EDITmoney2, m_sum1);
  37. DDX_Text(pDX, IDC_EDITmoney3, m_sum2);
  38. DDX_Text(pDX, IDC_EDITmoney5, m_sum3);
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(TakeMoney4, CDialog)
  42. //{{AFX_MSG_MAP(TakeMoney4)
  43. ON_WM_DESTROY()
  44. //}}AFX_MSG_MAP
  45. END_MESSAGE_MAP()
  46. /////////////////////////////////////////////////////////////////////////////
  47. // TakeMoney4 message handlers
  48. BOOL TakeMoney4::OnInitDialog()
  49. {
  50. CDialog::OnInitDialog();
  51. #ifdef CHILD_VERSION
  52. GetDlgItem(IDC_STATIC10)->SetWindowText("家长:");
  53. GetDlgItem(IDC_STATIC20)->SetWindowText("宝宝:");
  54. #endif
  55. SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
  56. // TODO: Add extra initialization here
  57. g_sendhead.bsql=0;
  58. g_sendhead.code[0]=93;
  59. g_sendhead.code[1]=38;
  60. g_sendhead.code[2]=11;
  61. g_sendhead.code[3]=68;
  62. g_sendhead.tabcount=4;
  63. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';";
  64. g_pMainWnd->ProcessChatMessageRequest2(filter);
  65. if(g_bSendOK==0)return 0;
  66. CArray<CStringArray, CStringArray>dindanarray;
  67. CArray<CStringArray, CStringArray>memberarray;
  68. DataToArray( &m_List1array,&m_List2array,&dindanarray,&memberarray);
  69. CenterWindow(g_pMainWnd);
  70. CString m_money1 = dindanarray.ElementAt (0).ElementAt (1);
  71. CString m_taoxijiage = dindanarray.ElementAt (0).ElementAt (8);
  72. CString m_payed4 = dindanarray.ElementAt (0).ElementAt (19);
  73. CString m_payed5 = dindanarray.ElementAt (0).ElementAt (20);
  74. m_sum1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  75. m_sum2.Format ("%f", atof(m_payed5)+atof(m_money1));
  76. m_sum3.Format ("%f", atof(m_sum1)-atof(m_sum2));
  77. ConvertToPrice(m_sum1);
  78. ConvertToPrice(m_sum2);
  79. ConvertToPrice(m_sum3);
  80. UpdateData(false);
  81. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(115)))
  82. m_List1.SetHeadings("id,0;金额,55;日期,90;开单人,70;收款人,70;备注,90;收款项目,90;支付方式,90;接单点,80" );
  83. else
  84. m_List1.SetHeadings("id,0;金额,60;日期,90;开单人,70;收款人,70;备注,90;收款项目,90;支付方式,90" );
  85. // m_List1.LoadColumnInfo (115);
  86. for(int i=0; i<m_List1array.GetSize (); i++)
  87. {
  88. if(m_List1array.ElementAt (i).ElementAt (9)!="")
  89. {
  90. CString discount="(打"+m_List1array.ElementAt (i).ElementAt (9)+"折)";
  91. m_List1array.ElementAt (i).SetAt (6, m_List1array.ElementAt (i).ElementAt (6)+discount);
  92. }
  93. }
  94. m_List2.SetHeadings("id,0;加挑金额,80;日期,100;录单,80;加挑物品,100" );
  95. // m_List2.LoadColumnInfo (123);
  96. FillGrid();
  97. return TRUE; // return TRUE unless you set the focus to a control
  98. // EXCEPTION: OCX Property Pages should return FALSE
  99. }
  100. void TakeMoney4::FillGrid()
  101. {
  102. m_List1.DeleteAllItems2 ();
  103. int ii=0;
  104. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  105. int count=0;
  106. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  107. {
  108. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  109. }
  110. m_List1.m_arLabels.SetSize(count, 1);
  111. ii=count;
  112. m_List1.m_LabelCount=ii;
  113. m_List1.SetItemCountEx (ii);
  114. {
  115. m_List2.DeleteAllItems2 ();
  116. int ii=0;
  117. m_List2.m_arLabels.SetSize( m_List2array.GetSize (), 1 );
  118. int count=0;
  119. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  120. {
  121. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  122. }
  123. m_List2.m_arLabels.SetSize(count, 1);
  124. ii=count;
  125. m_List2.m_LabelCount=ii;
  126. m_List2.SetItemCountEx (ii);
  127. }
  128. }
  129. BOOL TakeMoney4::PreTranslateMessage(MSG* pMsg)
  130. {
  131. // TODO: Add your specialized code here and/or call the base class
  132. if(pMsg->message==WM_KEYDOWN)
  133. {
  134. switch (pMsg->wParam)
  135. {
  136. case VK_RETURN:
  137. return 1;
  138. }
  139. }
  140. return CDialog::PreTranslateMessage(pMsg);
  141. }