245 lines
4.7 KiB
C++
245 lines
4.7 KiB
C++
|
// FBill.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "corpsms.h"
|
|||
|
#include "FPay.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// CFPay dialog
|
|||
|
#include "MainFrm.h"
|
|||
|
#include "ProcessSocket.h"
|
|||
|
|
|||
|
|
|||
|
CFPay::CFPay(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(CFPay::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(CFPay)
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
m_bInit = false;
|
|||
|
m_bRefresh = false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void CFPay::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(CFPay)
|
|||
|
DDX_Control(pDX, IDC_PAY_S1, m_S_S1);
|
|||
|
DDX_Control(pDX, IDC_PAY_QUERYMONTH, m_L_Month);
|
|||
|
DDX_Control(pDX, IDC_PAY_LIST, m_wndList);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(CFPay, CDialog)
|
|||
|
//{{AFX_MSG_MAP(CFPay)
|
|||
|
ON_WM_SIZE()
|
|||
|
ON_BN_CLICKED(IDC_BILL_QUERY, OnBillQuery)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// CFPay message handlers
|
|||
|
|
|||
|
BOOL CFPay::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
//ȡ<>ù<EFBFBD><C3B9>ò<EFBFBD><C3B2><EFBFBD>
|
|||
|
//CMainFrame * pFrame = static_cast <CMainFrame *>((CMainFrame *)AfxGetMainWnd());
|
|||
|
this->GetParent()->GetParentFrame();
|
|||
|
m_pMainFrame = (CMainFrame *)this->GetParent()->GetParentFrame();
|
|||
|
m_pSocket = &m_pMainFrame->m_Socket;
|
|||
|
m_AdoRS.SetAdoConnection( &m_pMainFrame->m_adoConnection );
|
|||
|
|
|||
|
//<2F><>ʼ<EFBFBD><CABC>List
|
|||
|
m_Image.Create(16,16,ILC_COLOR32|ILC_MASK,5,5);
|
|||
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_ADDRESSM) );
|
|||
|
m_Image.Add(AfxGetApp()->LoadIcon(IDI_L_LOCK) );
|
|||
|
m_wndList.SubClassWindow2();
|
|||
|
m_wndList.SetHeadings(_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,50; <20><>ֵʱ<D6B5><CAB1>,120; <20><> <20><>,80; <20><> <20><>,80; С <20><>,80; <20><> <20><>,80; <20><> <20><>,90;"));
|
|||
|
m_wndList.SetGridLines(true);
|
|||
|
m_wndList.SetImageList(&m_Image,LVSIL_SMALL);
|
|||
|
|
|||
|
m_bInit = true;
|
|||
|
|
|||
|
//ֻ<>ܲ<EFBFBD>ǰ3<C7B0><33><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
SYSTEMTIME t; ::GetLocalTime(&t);
|
|||
|
CString strTemp;
|
|||
|
long lCount = 0;
|
|||
|
for ( int i=0 ; i<5 ; i++ )
|
|||
|
{
|
|||
|
if ( t.wMonth <=0 )
|
|||
|
{
|
|||
|
t.wYear --;
|
|||
|
t.wMonth = 12;
|
|||
|
}
|
|||
|
/*
|
|||
|
if ( i==0 && t.wDay <=5 )
|
|||
|
continue;
|
|||
|
*/
|
|||
|
strTemp.Format( _T("%04d<34><64>%02d<32>·<EFBFBD>") , t.wYear , t.wMonth );
|
|||
|
int iTemp = m_L_Month.AddString(strTemp);
|
|||
|
strTemp.Format( _T("%04d%02d") , t.wYear , t.wMonth );
|
|||
|
m_L_Month.SetItemData(iTemp,_ttol(strTemp));
|
|||
|
lCount ++;
|
|||
|
if ( lCount>=4 )
|
|||
|
break;
|
|||
|
|
|||
|
t.wMonth = t.wMonth-1;
|
|||
|
}
|
|||
|
m_L_Month.SetCurSel(0);
|
|||
|
/*
|
|||
|
m_tBegin.SetDate( t.wYear,t.wMonth,t.wDay ); //<2F><>ʼ
|
|||
|
if ( t.wMonth == 1 ||
|
|||
|
t.wMonth == 3 ||
|
|||
|
t.wMonth == 5 ||
|
|||
|
t.wMonth == 7 ||
|
|||
|
t.wMonth == 8 ||
|
|||
|
t.wMonth == 10 ||
|
|||
|
t.wMonth == 12 )
|
|||
|
{
|
|||
|
t.wDay = 31;
|
|||
|
}
|
|||
|
else
|
|||
|
if (t.wMonth == 2 )
|
|||
|
t.wDay = 28;
|
|||
|
else
|
|||
|
t.wDay = 30;
|
|||
|
*/
|
|||
|
|
|||
|
UpdateData(false);
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
void CFPay::OnSize(UINT nType, int cx, int cy)
|
|||
|
{
|
|||
|
CDialog::OnSize(nType, cx, cy);
|
|||
|
|
|||
|
if ( m_bInit )
|
|||
|
{
|
|||
|
CRect rect;
|
|||
|
m_S_S1.GetWindowRect(&rect);
|
|||
|
m_wndList.MoveWindow( 0 , 0+rect.Height()+12 , cx,cy-rect.Height()-12);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
BOOL CFPay::ReShow(BOOL bRefresh)
|
|||
|
{
|
|||
|
ShowWindow( SW_SHOW );
|
|||
|
if ( bRefresh || !m_bRefresh )
|
|||
|
{
|
|||
|
RefreshInfo();
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
BOOL CFPay::ReHide()
|
|||
|
{
|
|||
|
ShowWindow( SW_HIDE );
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
BOOL CFPay::RefreshInfo()
|
|||
|
{
|
|||
|
//Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD>ѯ<EFBFBD>Լ<EFBFBD>
|
|||
|
//û<>в<EFBFBD>ѯ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>ֻ<EFBFBD>ܲ<EFBFBD>ѯ<EFBFBD>Լ<EFBFBD>
|
|||
|
UpdateData(false);
|
|||
|
/*
|
|||
|
if ( !m_pMainFrame->GetUserPurview( PURVIEW_SEEBILL , false ) )
|
|||
|
{
|
|||
|
//û<>в<EFBFBD>ѯ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>ֻ<EFBFBD>ܲ<EFBFBD>ѯ<EFBFBD>Լ<EFBFBD>
|
|||
|
m_strUser = m_pMainFrame->m_pCurUser->szUser;
|
|||
|
m_lUserID = m_pMainFrame->m_lUserID;
|
|||
|
UpdateData(false);
|
|||
|
}
|
|||
|
*/
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void CFPay::OnBillQuery()
|
|||
|
{
|
|||
|
UpdateData(true);
|
|||
|
|
|||
|
long lQuery= m_L_Month.GetItemData(m_L_Month.GetCurSel());
|
|||
|
|
|||
|
if ( lQuery<200512 )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD>ѯ<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
return ;
|
|||
|
}
|
|||
|
long lYear = lQuery/100;
|
|||
|
long lMon = lQuery%100;
|
|||
|
long lDay = 31;
|
|||
|
if ( lMon == 1 ||
|
|||
|
lMon == 3 ||
|
|||
|
lMon == 5 ||
|
|||
|
lMon == 7 ||
|
|||
|
lMon == 8 ||
|
|||
|
lMon == 10 ||
|
|||
|
lMon == 12 )
|
|||
|
{
|
|||
|
lDay = 31;
|
|||
|
}
|
|||
|
else
|
|||
|
if (lMon == 2 )
|
|||
|
lDay = 28;
|
|||
|
else
|
|||
|
lDay = 30;
|
|||
|
|
|||
|
|
|||
|
/*
|
|||
|
REQ_Bill2 * pBill = new REQ_Bill2;memset(pBill,0,sizeof(REQ_Bill2));
|
|||
|
|
|||
|
pBill->lCorpID = m_pMainFrame->m_lCorpID; //<2F><>ҵID
|
|||
|
pBill->lUserID = m_lUserID; //<2F><>ѯ<EFBFBD>û<EFBFBD>ID
|
|||
|
|
|||
|
pBill->tBegin.wYear = lYear;
|
|||
|
pBill->tBegin.wMonth = lMon;
|
|||
|
pBill->tBegin.wDay = 1;
|
|||
|
|
|||
|
pBill->tEnd.wYear = lYear;
|
|||
|
pBill->tEnd.wMonth = lMon;
|
|||
|
pBill->tEnd.wDay = lDay;
|
|||
|
|
|||
|
m_pMainFrame->SendFrame(SMSFUNC_BILL3,(BYTE*)pBill,sizeof(REQ_Bill));
|
|||
|
//m_pMainFrame->SendFrame(SMSFUNC_BILL2,(BYTE*)pBill,sizeof(REQ_Bill));
|
|||
|
*/
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
long CFPay::ProcessSocket(Socket_Head *pHead)
|
|||
|
{
|
|||
|
if ( pHead->lFuncType == SMSFUNC_BILL3 )
|
|||
|
{
|
|||
|
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
void CFPay::OnOK()
|
|||
|
{
|
|||
|
return ;
|
|||
|
CDialog::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
void CFPay::OnCancel()
|
|||
|
{
|
|||
|
return ;
|
|||
|
CDialog::OnCancel();
|
|||
|
}
|
|||
|
|