// Login2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "Login2.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Login2 dialog Login2::Login2(CWnd* pParent /*=NULL*/) : CDialog(Login2::IDD, pParent) { //{{AFX_DATA_INIT(Login2) m_psw = _T(""); m_account = _T(""); m_mode=0; //}}AFX_DATA_INIT } void Login2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(Login2) DDX_Control(pDX, IDC_COMBOaccount, m_comboaccount); DDX_Text(pDX, IDC_EDITpsw, m_psw); DDX_CBString(pDX, IDC_COMBOaccount, m_account); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(Login2, CDialog) //{{AFX_MSG_MAP(Login2) ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Login2 message handlers BOOL Login2::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here if(m_mode==1) SetWindowText("修改订单产品授权"); else if(m_mode==2) SetWindowText("订单打折授权"); else if(m_mode==3) SetWindowText("修改日期授权"); g_sendhead.bsql=0; g_sendhead.code[0]=23; g_sendhead.tabcount=1; int g_nYearposTemp=g_nYearpos; g_nYearpos=-1; g_pMainWnd->ProcessChatMessageRequest2(1); g_nYearpos=g_nYearposTemp; if(g_bSendOK==0) { CDialog::OnCancel(); return 1; } DataToArray(&m_List1array); CenterWindow(g_pMainWnd); try { CFile fp; if(fp.Open (g_mainpath+"\\loginuser.dat", CFile::modeRead)) { DWORD length=fp.GetLength (); if(!length) { fp.Close(); return false; } CArchive ar(&fp, CArchive::load); m_userarray.Serialize (ar); fp.Close (); for(int i=0; i0) { m_comboaccount.SetCurSel (0); m_comboaccount.GetLBText (0, m_account); } } } catch(...) { } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void Login2::OnOK() { // TODO: Add extra validation here // AfxMessageBox("login2"); UpdateData(); if(m_account.IsEmpty()) { AfxMessageBox("资料不全!", MB_ICONINFORMATION); return; } for(int i=0; i