287 lines
8.6 KiB
C++
287 lines
8.6 KiB
C++
|
|
// sp.h : main header file for the SP application
|
|
//
|
|
|
|
#if !defined(AFX_SP_H__A74C37E5_FC36_11D3_964F_00C0F02C4B69__INCLUDED_)
|
|
#define AFX_SP_H__A74C37E5_FC36_11D3_964F_00C0F02C4B69__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#ifndef __AFXWIN_H__
|
|
#error include 'stdafx.h' before including this file for PCH
|
|
#endif
|
|
|
|
#include "resource.h" // main symbols
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CSpApp:
|
|
// See sp.cpp for the implementation of this class
|
|
//
|
|
#define NUMVIEWS 8
|
|
//rights and area numbers
|
|
#define RSTAT 0
|
|
#define RWORKORDER 1
|
|
#define RSNR 2
|
|
#define REMAIL 3
|
|
#define RDBUTIL 4
|
|
#define RSECURITY 5
|
|
#define RSEARCH 6
|
|
#define RREPORTS 7
|
|
#define RPRINTSETUP 8
|
|
#define RCLIENTS 9
|
|
#define RRATES 10
|
|
#define RZONES 11
|
|
#define RUNITS 12
|
|
#define RMODELS 13
|
|
#define RPARTS 14
|
|
#define RTASKS 15
|
|
#define RPROJECTS 16
|
|
#define RCATEGORIES 17
|
|
#define RNONCLIENTS 18
|
|
#define RUSERS 19
|
|
#define RPM 20
|
|
#define RLOANERS 21
|
|
#define RSCHEDULE 22
|
|
#define RSCHEDGROUPS 23//schedule groups screen
|
|
#define RSCHEDMARKERS 24//schedule groups screen
|
|
#define RUSERPREFS 25//user preferences
|
|
#define RARASREQUESTS 26//ARAS service request screen
|
|
|
|
|
|
//#include "crpe.h"
|
|
#include "gzrset.h"
|
|
#include "gzrsetpool.h"
|
|
#include "gzk.h"
|
|
#include "DlgStartUp.h"
|
|
#import "C:\Program Files\Crystal Decisions\Report Designer Component\craxdrt9.dll" no_namespace rename("FindText","crFindText")
|
|
#include "ReportViewerDlg.h"
|
|
//Help file screenshots best setting:
|
|
//550 pixels wide, 10%sharpen,32 colors, 100% dither
|
|
//#define _WTF_ 1 //DEFINE THIS TO TRACE RELEASE BUILD
|
|
|
|
/* VERSION HISTORY
|
|
|
|
v1.6.9.7 - Feb 9th 2001
|
|
- Modified units screen to allow adding duplicate
|
|
- fixed bug in units screen when duplicate serial number would cause crash
|
|
|
|
v1.6.9.8 - Feb 15th 2001
|
|
- added color to status items
|
|
- added default password to eval version for "dummies"
|
|
- changes to schedule screen to show more info on highlight
|
|
and color on time bars
|
|
- fixed missing hyperlink on standard workorder for
|
|
status edit/add table
|
|
|
|
*/
|
|
class CSpApp : public CWinApp
|
|
{
|
|
public:
|
|
HCURSOR hcHand;
|
|
CString m_strThisVersion;
|
|
int CompareVersions(CString strThisVersion, CString strTargetVersion);
|
|
bool m_bShowProblemActionFields;//on standard workorder screen
|
|
long m_lSchedWindowDays;
|
|
long m_lSchedRefreshSecs;
|
|
void Delay(int nSeconds);
|
|
bool m_bRefreshReportsScreen;
|
|
bool m_bRefreshStatScreen;
|
|
CGZRsetPool* rsPool;
|
|
CString m_strDBVersion;
|
|
bool VerifyDatabaseVersion();
|
|
bool m_bBadDatabaseVersion;
|
|
void DoHelp();
|
|
long m_lUsersDefRate;
|
|
long m_lUsersDefTravelRate;
|
|
bool m_bDefOnsite;
|
|
bool m_bDefSchedRnd;
|
|
bool m_bDefSchedOneDay;
|
|
|
|
//workorder default status items
|
|
long m_lDefNewWOStatus;
|
|
long m_lDefClosedWOStatus;
|
|
long m_lDefReOpenWOStatus;
|
|
|
|
//Added Sept 30th 2002
|
|
//forces db execute queries
|
|
//to be wrapped in transactions
|
|
//if set to true
|
|
bool m_bUseTransactions;
|
|
|
|
|
|
void SecurityWarning();
|
|
long m_lGroupID;
|
|
int Allowed(int right, bool bRefresh);
|
|
CString m_strDataVersion;
|
|
bool VerifyData();
|
|
void ShowStuff(CString strStuff);
|
|
CString m_strRegEvalLimit;
|
|
UINT m_uiFeatures;
|
|
long m_lRegLicCount;
|
|
CString m_strRegCompany;
|
|
CString m_strRegKey;
|
|
CString m_strDBPATH;
|
|
CString ReportDirectory();
|
|
|
|
GZK* cryp;
|
|
//indicates this user is a tech
|
|
bool m_bTech;
|
|
void SetMainCaption(CString pCaption);
|
|
void OpenNonClientAddressBook(long ltype);
|
|
//void PrintSetup();
|
|
|
|
|
|
//Test function to try out sub reports
|
|
//currently only supports 1 sub report
|
|
//void PrintSubCMReport(CString VirtReportName, _RecordsetPtr m_pRecordSet, CString strSubName, _RecordsetPtr m_pSubRecordSet);
|
|
void PrintSubCMReportRDC(CString VirtReportName, _RecordsetPtr m_pRecordSet, CString strSubName, _RecordsetPtr m_pSubRecordSet);
|
|
|
|
|
|
//takes a physical report name and preview prints it to default printer
|
|
//void PrintReport(CString ReportName, _RecordsetPtr m_pRecordSet);
|
|
|
|
//Print built in report using user settings
|
|
//void PrintCMReport(CString VirtReportName, _RecordsetPtr m_pRecordSet);
|
|
|
|
//Print built in report using user settings
|
|
void PrintCMReportRDC(CString VirtReportName, _RecordsetPtr m_pRecordSet);
|
|
|
|
//,CString strWOID="",CString strRegTo="",CString strEstRate="",CString strEstHours="",CString strSchedTech="");
|
|
|
|
|
|
//these two functions are used only for report development
|
|
//they generate skeleton reports and ttx files based on passed record
|
|
//set name and desired report name and locations.
|
|
void CreateTTX(CString ReportName,_RecordsetPtr m_pRecordSet, bool bSilent=false);
|
|
//void CreateTTXandReport(CString ReportName,CString DefName,_RecordsetPtr m_pRecordSet);
|
|
|
|
CString m_strCurrentUserName;
|
|
CString m_strRights;
|
|
bool m_bSuperUser;
|
|
|
|
long m_lusrID;
|
|
CString strConnectString;
|
|
CString strConnectStringExclusive;
|
|
CSpApp();
|
|
bool ProcessActiveViewOpen();
|
|
bool ProcessActiveViewClose();
|
|
CView * SwitchView( UINT nIndex ); // Switch between views
|
|
private:
|
|
|
|
CDlgStartUp *m_pDlgStartUp;
|
|
BOOL PeekAndPump();
|
|
//=======================
|
|
//Crystal reports RDC objects
|
|
IReportPtr m_Report;
|
|
IReportPtr m_SubReport;
|
|
ISectionsPtr pSections;
|
|
ISectionPtr pSection;
|
|
IReportObjectsPtr pRepObjects;
|
|
IReportObjectPtr pRepObject;
|
|
IParameterFieldDefinitionPtr pParamDef;
|
|
IParameterFieldDefinitionsPtr pParamDefs;
|
|
public:
|
|
IApplicationPtr pApplication;//needs to be visible to other areas that might call into it
|
|
//========================
|
|
protected:
|
|
// Array of views attached to single document
|
|
CView * m_pViews[NUMVIEWS];
|
|
// Index to current view
|
|
UINT m_nCurView;
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CSpApp)
|
|
public:
|
|
virtual BOOL InitInstance();
|
|
virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT);
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
//{{AFX_MSG(CSpApp)
|
|
afx_msg void OnAppAbout();
|
|
afx_msg void OnViewWorkorders();
|
|
afx_msg void OnExit();
|
|
afx_msg void OnOptionsReports();
|
|
afx_msg void OnOptionsEditClients();
|
|
afx_msg void OnOptionsEditZones();
|
|
afx_msg void OnOptionsEditUsers();
|
|
afx_msg void OnOptionsEditTasks();
|
|
afx_msg void OnOptionsEditUnits();
|
|
afx_msg void OnOptionsEditUnitmodels();
|
|
afx_msg void OnOptionsEditParts();
|
|
afx_msg void OnOptionsEditProjects();
|
|
afx_msg void OnToolsSecurity();
|
|
afx_msg void OnOptionsEditAddressbookCouriersshippers();
|
|
afx_msg void OnViewMail();
|
|
afx_msg void OnOptionsEditRates();
|
|
afx_msg void OnOptionsEditAddressbookManufacturerssuppliers();
|
|
afx_msg void OnOptionsEditAddressbookResellerscompetitors();
|
|
afx_msg void OnOptionsEditAddressbookSubcontractors();
|
|
afx_msg void OnOptionsEditWorkordertypes();
|
|
afx_msg void OnHelpEmailtechsupport();
|
|
afx_msg void OnHelpSuggestions();
|
|
afx_msg void OnHelpVisitourwebsite();
|
|
afx_msg void OnSearch();
|
|
afx_msg void OnViewDatabase();
|
|
afx_msg void OnViewShippingreceiving();
|
|
afx_msg void OnFileLoanersrentals();
|
|
afx_msg void OnFilePmcheck();
|
|
afx_msg void OnReports();
|
|
afx_msg void OnOptionsUser();
|
|
afx_msg void OnViewSchedule();
|
|
afx_msg void OnVisualSchedule();
|
|
afx_msg void OnHelpLicense();
|
|
afx_msg void OnHelpPurchase();
|
|
afx_msg void OnOptionsEditSchedgrps();
|
|
afx_msg void OnOptionsEditSchedmarkers();
|
|
afx_msg void OnViewArasServiceRequests();
|
|
afx_msg void OnHelpManual();
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
public:
|
|
|
|
bool m_bDefShowHGridOnMainScreen;
|
|
afx_msg void OnNcAddress();
|
|
afx_msg void OnNcAddress2();
|
|
afx_msg void OnNcAddress3();
|
|
afx_msg void OnNcAddress4();
|
|
afx_msg void OnAcceleratorClients();
|
|
afx_msg void OnAcceleratorCategories();
|
|
afx_msg void OnAcceleratorExit();
|
|
afx_msg void OnAcceleratorModels();
|
|
afx_msg void OnAcceleratorParts();
|
|
afx_msg void OnAcceleratorProjects();
|
|
afx_msg void OnAcceleratorRates();
|
|
afx_msg void OnAcceleratorScheduleGroups();
|
|
afx_msg void OnAcceleratorScheduleMarkers();
|
|
afx_msg void OnAcceleratorTasks();
|
|
afx_msg void OnAcceleratorUnits();
|
|
afx_msg void OnAcceleratorZones();
|
|
private:
|
|
bool InitializeRDC(void);
|
|
public:
|
|
void Test(void);
|
|
afx_msg void OnAcceleratorStatus();
|
|
};
|
|
|
|
/*
|
|
|
|
|
|
afx_msg void OnViewStatus();
|
|
afx_msg void OnViewSearch();
|
|
afx_msg void OnViewReports();
|
|
afx_msg void OnViewOptions();
|
|
afx_msg void OnViewManageroptions();
|
|
afx_msg void OnViewEventsjobbook();
|
|
afx_msg void OnViewWorkorders();
|
|
*/
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
|
|
|
#endif // !defined(AFX_SP_H__A74C37E5_FC36_11D3_964F_00C0F02C4B69__INCLUDED_)
|