⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statisticdialog.cpp

📁 VC+SQL SERVER 2000环境下开发的商品销售管理系统
💻 CPP
字号:
// StatisticDialog.cpp : 实现文件
//

#include "stdafx.h"
#include "SaleManager.h"
#include "StatisticDialog.h"
#include ".\statisticdialog.h"
#include "SaleListDialog.h"
#include "TotalSaleDialog.h"
#include "GoodsStockDialog.h"


IMPLEMENT_DYNAMIC(CStatisticDialog, CDialog)
CStatisticDialog::CStatisticDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CStatisticDialog::IDD, pParent)
{
}

CStatisticDialog::~CStatisticDialog()
{
}

void CStatisticDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_DATETIMEPICKER_STATISTICDATEFROM, m_StatisticDateFrom);
	DDX_Control(pDX, IDC_DATETIMEPICKERSTATISTICDATEFROM, m_StatisticDateTo);
}


BEGIN_MESSAGE_MAP(CStatisticDialog, CDialog)
	ON_BN_CLICKED(IDC_BUTTON_SALELIST, OnBnClickedButtonSalelist)
	ON_BN_CLICKED(IDC_BUTTON_EXITSTATISTIC, OnBnClickedButtonExitstatistic)
	ON_BN_CLICKED(IDC_BUTTON_TOTALSELLLIST, OnBnClickedButtonTotalselllist)
	ON_BN_CLICKED(IDC_BUTTON_GOODSLIST, OnBnClickedButtonGoodslist)
END_MESSAGE_MAP()


// CStatisticDialog 消息处理程序

void CStatisticDialog::OnBnClickedButtonSalelist()
{
   	CTime timeFrom , timeTo;
	m_StatisticDateFrom.GetTime (timeFrom);
	m_StatisticDateTo.GetTime (timeTo);

	if(timeFrom.GetMonth () > timeTo.GetMonth ())
		return;

	if(timeFrom.GetMonth () == timeTo.GetMonth ())
		if(timeFrom.GetDay () > timeTo.GetDay ())
			return;

	CSaleListDialog dlg;
	CString  strValue;
	
	m_StatisticDateFrom.GetWindowText (strValue);
	dlg.m_StatisticDateFrom = strValue;
	m_StatisticDateTo.GetWindowText (strValue);
	dlg.m_StatisticDateTo = strValue;

	dlg.DoModal ();
}

void CStatisticDialog::OnBnClickedButtonExitstatistic()
{
	CDialog::OnCancel ();
}

BOOL CStatisticDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_StatisticDateFrom.SetFormat ("yyyyMMdd");
	m_StatisticDateTo.SetFormat ("yyyyMMdd");
   
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}

void CStatisticDialog::OnBnClickedButtonTotalselllist()
{
	CTime timeFrom , timeTo;
	m_StatisticDateFrom.GetTime (timeFrom);
	m_StatisticDateTo.GetTime (timeTo);

	if(timeFrom.GetMonth () > timeTo.GetMonth ())
		return;

	if(timeFrom.GetMonth () == timeTo.GetMonth ())
		if(timeFrom.GetDay () > timeTo.GetDay ())
			return;
	
	CTotalSaleDialog dlg;
    CString  strValue;
	
	m_StatisticDateFrom.GetWindowText (strValue);
	dlg.m_StatisticDateFrom = strValue;
	m_StatisticDateTo.GetWindowText (strValue);
	dlg.m_StatisticDateTo = strValue;

	dlg.DoModal ();
}

void CStatisticDialog::OnBnClickedButtonGoodslist()
{
	CTime timeFrom , timeTo;
	m_StatisticDateFrom.GetTime (timeFrom);
	m_StatisticDateTo.GetTime (timeTo);

	if(timeFrom.GetMonth () > timeTo.GetMonth ())
		return;

	if(timeFrom.GetMonth () == timeTo.GetMonth ())
		if(timeFrom.GetDay () > timeTo.GetDay ())
			return;
	CGoodsStockDialog dlg;
    CString  strValue;
	
	m_StatisticDateFrom.GetWindowText (strValue);
	dlg.m_StatisticDateFrom = strValue;
	m_StatisticDateTo.GetWindowText (strValue);
	dlg.m_StatisticDateTo = strValue;

	dlg.DoModal ();

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -