Click here to Skip to main content
15,887,992 members
Articles / Programming Languages / C++/CLI

N-Track : Work-Time tracking system

Rate me:
Please Sign up or sign in to vote.
4.60/5 (18 votes)
24 Jul 200216 min read 325.2K   9.7K   66  
A work time tracking system that includes a Managed C++ remoting server and MFC clients that use the managed extensions. The application demonstrates how to mix managed and unmanaged code.
__gc class CUser : public MarshalByRefObject,  public IUser
{
public:
	CUser(String*,String*,String*);
	String* GetUsername();
	String* GetPassword();
	String* GetFullname();
	
	void SetPassword(String*);
	void SetFullname(String*);
	
	bool Delete();
protected:
	String* m_username;
	String* m_password;
	String* m_fullname;
public:
	void SetGeneric(String* sqlstr);
};

__gc class CProject : public MarshalByRefObject, public IProject
{
public:
	CProject(String*, String*);

	String* GetProjectcode();

	String* GetProjectname();
	void SetProjectname(String*);

	bool Delete();

protected:
	String* m_projectcode;
	String* m_projectname;
public:
	void SetGeneric(String* sqlstr);
};

__gc class CActivity : public MarshalByRefObject, public IActivity
{
public:
	CActivity(String*, String*);

	String* GetActivitycode();

	String* GetActivitydescription();
	void SetActivitydescription(String*);

	bool Delete();

protected:
	String* m_activitycode;
	String* m_activitydescription;
public:
	void SetGeneric(String* sqlstr);
};

__gc class CTrack : public MarshalByRefObject, public ITrack
{
public:
	CTrack(String*,String* ,String* ,String* ,int);

	String* GetProjectcode();
	String* GetActivitycode();
	String* GetUsername();
	String* GetDate();

	int GetHours();
	void SetHours(int);

	void Delete();
protected:
	String* m_username;
	String* m_activitycode;
	String* m_projectcode;
	String* m_date;
	int m_hours;
public:
	void GenericSql(String* sqlstr);
	String* GenerateWhereSql(void);
};

__gc class CBasic : public MarshalByRefObject,public IBasic
{
public:
	IProject* GetProjects()[];
	IActivity* GetActivities()[];
	IUser* GetUsers()[];

	IUser* GetUser(String* username);
	IActivity* GetActivity(String* activitycode);
	IProject* GetProject(String* projectcode);

	ITrack* GetTracks(String*,String*,String*,TrackFilter)[];//user, project, activity
	
	/*user-activity, project-activity, user-project*/
	ITrack* GetTracks(String*,String*,String*,String*,TrackFilter)[];
	
	ITrack* GetTracks(String*,String*)[];//all

	ITrack* GetTracks(String*,String*,String*,String*,String*)[];

	void DeleteTracks(String*,String*);

	bool AddTrack(String*,String*,String*,String*,int);
	bool AddProject(String*,String*);
	bool AddActivity(String*, String*);
	bool AddUser(String*,String*,String*);

	bool AddGeneric(String* sqlstr);
	ITrack* GenericGetTracks(String* sqlstr)[];
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
Nish Nishant is a technology enthusiast from Columbus, Ohio. He has over 20 years of software industry experience in various roles including Chief Technology Officer, Senior Solution Architect, Lead Software Architect, Principal Software Engineer, and Engineering/Architecture Team Leader. Nish is a 14-time recipient of the Microsoft Visual C++ MVP Award.

Nish authored C++/CLI in Action for Manning Publications in 2005, and co-authored Extending MFC Applications with the .NET Framework for Addison Wesley in 2003. In addition, he has over 140 published technology articles on CodeProject.com and another 250+ blog articles on his WordPress blog. Nish is experienced in technology leadership, solution architecture, software architecture, cloud development (AWS and Azure), REST services, software engineering best practices, CI/CD, mentoring, and directing all stages of software development.

Nish's Technology Blog : voidnish.wordpress.com

Comments and Discussions