📄 dcreditreport.cpp
字号:
// DCreditReport.cpp: implementation of the CDCreditReport class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MyProject.h"
#include "DCreditReport.h"
#include "ExternDllHeader.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDCreditReport::CDCreditReport()
{
}
CDCreditReport::~CDCreditReport()
{
}
void CDCreditReport::Init()
{
this->SetWindowText("客户信誉度分析");
this->m_StaClew.SetWindowText("挂账日期");
CString sSQL;
sSQL.Format("SELECT 客户名称, COUNT(客户名称) AS 失信次数 FROM (SELECT a.销售票号,挂帐日期,预计结款日期,c.全称 AS 客户名称,未付金额 FROM 销售挂帐表 a INNER JOIN 销售记录表 b ON a.销售票号=b.销售票号 INNER JOIN 往来单位信息表 c ON b.客户编号=c.编号 WHERE 偿还否=0 AND 预计结款日期<(GetDate()-1)) DERIVEDTBL GROUP BY 客户名称");
rst.Open(sSQL,adCmdText);
this->Invalidate();
this->DlgReport.SetRecordset(rst);
this->DlgChart.SetRecordset(rst,"客户名称","失信次数","次",1);
}
void CDCreditReport::OnButquery()
{
CString sSQL,sDate1,sDate2,sClew;
CTime date1,date2;
m_DtDate1.GetTime(date1);
m_DtDate2.GetTime(date2);
sDate1=CTimeToCString(date1);
sDate2=CTimeToCString(date2);
sSQL.Format("SELECT 客户名称, COUNT(客户名称) AS 失信次数 FROM (SELECT a.销售票号,挂帐日期,预计结款日期,c.全称 AS 客户名称,未付金额 FROM 销售挂帐表 a INNER JOIN 销售记录表 b ON a.销售票号=b.销售票号 INNER JOIN 往来单位信息表 c ON b.客户编号=c.编号 WHERE 偿还否=0 AND 预计结款日期<(GetDate()-1) AND 挂帐日期 BETWEEN '%s' AND '%s') DERIVEDTBL GROUP BY 客户名称",sDate1,sDate2);
rst.Open(sSQL,adCmdText);
this->DlgReport.m_Grid.DeleteAllItems();
this->DlgReport.m_Grid.AddCellValue(rst);
this->DlgChart.SetRecordset(rst,"客户名称","失信次数","次",1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -