// UsePointBlue.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "UsePointBlue.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // UsePointBlue dialog IDC_EDITtime2 UsePointBlue::UsePointBlue(CWnd* pParent /*=NULL*/) : CDialog(UsePointBlue::IDD, pParent) { //{{AFX_DATA_INIT(UsePointBlue) m_name1 = _T(""); m_name2 = _T(""); m_id = _T(""); m_ren = _T(""); m_taoxiname = _T(""); m_memberno = _T(""); m_name = _T(""); m_point = _T(""); m_taoxijiage = _T(""); m_card2no = _T(""); m_goods = _T(""); m_point2 = _T(""); //}}AFX_DATA_INIT } void UsePointBlue::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(UsePointBlue) DDX_Control(pDX, IDC_EDIT3, m_editnum); DDX_Control(pDX, IDC_COMBO5, m_combobox); DDX_Text(pDX, IDC_EDITname, m_name1); DDX_Text(pDX, IDC_EDITname2, m_name2); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITOren, m_ren); DDX_Text(pDX, IDC_EDITtaoxiname, m_taoxiname); DDX_Text(pDX, IDC_EDIT1, m_memberno); DDX_Text(pDX, IDC_EDITmembername, m_name); DDX_Text(pDX, IDC_EDIT2, m_point); DDX_Text(pDX, IDC_EDITtaoxijiage, m_taoxijiage); DDX_Text(pDX, IDC_EDITcard2no, m_card2no); DDX_Text(pDX, IDC_EDIT7, m_goods); DDX_Text(pDX, IDC_EDIT3, m_point2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(UsePointBlue, CDialog) //{{AFX_MSG_MAP(UsePointBlue) ON_CBN_SELCHANGE(IDC_COMBO5, OnSelchangeCombo5) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // UsePointBlue message handlers BOOL UsePointBlue::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here #ifdef CHILD_VERSION GetDlgItem(IDC_STATIC1)->SetWindowText("家长姓名:"); GetDlgItem(IDC_STATIC2)->SetWindowText("宝宝姓名:"); #endif /* m_acCombo.Init(&m_combobox); g_sendhead.bsql=0; g_sendhead.code[0]=30; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(21);if(g_bSendOK==0)return 0; DataToArray(&m_List1array); m_acCombo.m_pArray=&m_List1array; m_combobox.SetFocus (); this->CenterWindow (g_pMainWnd);*/ return false; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void UsePointBlue::OnOK() { // TODO: Add extra validation here UpdateData(); if(atol(m_point)<1) { AfxMessageBox("金额不能小于1!", MB_ICONINFORMATION); return; } if(atol(m_point2)<1) { AfxMessageBox("金额不能小于1!", MB_ICONINFORMATION); return; } if(atol(m_point2)>atol(m_point)) { AfxMessageBox("余额不够!", MB_ICONINFORMATION); return; } CString sql; CString date=g_date; sql="insert into [memberreg2blue]([memberno],[money],[date])values('"+m_memberno+"','"+m_point2+"','"+date+"')"; sql+="~~~~"; sql+=m_memberno; g_sendhead.bsql=1; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); CDialog::OnOK(); } void UsePointBlue::ClientChange() { CString filter="id='"+id+"'"; g_sendhead.code[0]=11; g_sendhead.tabcount=1; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return; DataToArray(&g_List1array); if(g_List1array.GetSize ()) { m_id=g_List1array.ElementAt (0).ElementAt (0); m_name1=g_List1array.ElementAt (0).ElementAt (4); m_name2=g_List1array.ElementAt (0).ElementAt (5); m_taoxiname=g_List1array.ElementAt (0).ElementAt (7); m_point=m_taoxijiage=g_List1array.ElementAt (0).ElementAt (8); m_ren=g_List1array.ElementAt (0).ElementAt (14); UpdateData(false); } } void UsePointBlue::OnSelchangeCombo5() { // TODO: Add your control notification handler code here int pos=m_combobox.GetCurSel (); if(pos==-1)return; if(m_acCombo.m_posarray.GetSize ()<=pos)return; int pos2=m_acCombo.m_posarray .ElementAt (pos); id=m_List1array.ElementAt (pos2).ElementAt (0); ClientChange(); }