/*-----------------------------------------------------------------------*/
/*   FS-MTS  1.0  Ver.                                                   */
/*   Copyright (C) 2000 FIRST SAIL                                       */
/*   All Rights Reserved                                                 */
/*   Warning:                                                            */
/*       This program author is GuoHeng,this system is protected         */
/*   by copyright law and international Treaties . Unauthorized          */
/*   reproduction of  distribution of this  system, or any portion       */
/*   of it , may result in severe civil and criminal penalties ,         */
/*   and will be prosecuted to the maximum extern possible under         */
/*   the law.                                                            */
/*                                                                       */
/*   Update Date:2002-06-25                                              */
/*   Update Time:22:35:00                                                */
/*-----------------------------------------------------------------------*/

#ifndef _REPORT_H_H_
#define _REPORT_H_H_

#include <print.h>
class  CRequeryDialog:public CDialog
{
public:
	CRequeryPrint m_RequryPrint;
private:
	BOOL	     m_bPrintStop;
private:
	static ffblk 	     m_Ffblk;
private:
	CGrid*	m_pGrid;
private:
	static  char	m_dateText[50];
	static  char    m_typeText[50];
	static  int     m_nRequeryStyle;
public:
	static BOOL    BuildReportData();
	static void    SetDateText(char *pStr){_fstrcpy(m_dateText,pStr);}
	static void    SetTypeText(char *pStr);
	static void    SetRequeryStyle(int nRequeryStyle) {m_nRequeryStyle = nRequeryStyle;}
	void	SetGrid(CGrid *pGrid){m_pGrid=pGrid;}
	CGrid*	GetGrid(){return(m_pGrid);}
	BOOL    LoadRequeryDataToGrid(CGrid *pGrid);
	BOOL    Print();
public:
	void  FAR KeyF1();
	void  FAR KeyF2();
	void  FAR KeyF3();
	void  FAR KeyCtrlF1();
	void  FAR KeyCtrlF2();
public:
	void  CoReportDialog();
	CRequeryDialog();
	~CRequeryDialog();

};

class CStatisticDialog:public CDialog
{
public:
	CReportPrint m_ReportPrint;
private:
	CGrid*  m_pGrid;
	WORD    m_wStyle;
public:
	void SetGrid(CGrid *pGrid){m_pGrid=pGrid;}
	void SetStyle(WORD wStyle){m_wStyle=wStyle;}
	WORD GetStyle(){return(m_wStyle);}
	BOOL BuildRequeryFile(DWORD dwFirstDate, DWORD dwLastDate,char *pStrType);
	BOOL BuildReportFile(WORD wStyle,char *pStrType);
	BOOL LoadReportFileToGrid(CGrid *pGrid);
	BOOL GetSection(DWORD*dwCount,BYTE *pbyMask,int nCount);
public:
	//virtual void FAR KeyF1();
	virtual void FAR KeyF2();
	virtual void FAR KeyF3();

public:

	CStatisticDialog();
	~CStatisticDialog();
};
BOOL   FAR GetDateAndTypeAttribute(char *pStrType,long *plFirstDate,long  *plLastDate,int *pnStyle);
BOOL   FAR DateDialogBox(char *pStr,char *pStrType);
void   FAR DataRequery();
void   FAR DataStatistic();

#endif