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

📄 cdate.cpp

📁 软件的名称:AA制用餐管理系统 软件的功能:管理消费中产生的费用
💻 CPP
字号:
/***********************************************************************
 * Module:  CDate.cpp
 * Author:  Administrator
 * Modified: 2008年9月8日 16:26:58
 * Purpose: Implementation of the class CDate
 * Comment: 日期类
 ***********************************************************************/

#include "CDate.h"
#include "CConvert.h"
#include <stdlib.h>
#include <string.h>
//using namespace std;
////////////////////////////////////////////////////////////////////////
// Name:       CDate::getM_day()
// Purpose:    Implementation of CDate::getM_day()
// Return:     int
////////////////////////////////////////////////////////////////////////
CDate::CDate()
{
	m_year =0;
	m_month =0;
	m_day =0;
}
int CDate::Getday(void)
{
   return m_day;
}

////////////////////////////////////////////////////////////////////////
// Name:       CDate::setM_day(int newM_day)
// Purpose:    Implementation of CDate::setM_day()
// Parameters:
// - newM_day
// Return:     void
////////////////////////////////////////////////////////////////////////

void CDate::Setday(int day)
{
   m_day = day;
}

////////////////////////////////////////////////////////////////////////
// Name:       CDate::getM_year()
// Purpose:    Implementation of CDate::getM_year()
// Return:     int
////////////////////////////////////////////////////////////////////////

int CDate::Getyear(void)
{
   return m_year;
}

////////////////////////////////////////////////////////////////////////
// Name:       CDate::setM_year(int newM_year)
// Purpose:    Implementation of CDate::setM_year()
// Parameters:
// - newM_year
// Return:     void
////////////////////////////////////////////////////////////////////////

void CDate::Setyear(int year)
{
   m_year = year;
}

////////////////////////////////////////////////////////////////////////
// Name:       CDate::getM_month()
// Purpose:    Implementation of CDate::getM_month()
// Return:     int
////////////////////////////////////////////////////////////////////////

int CDate::Getmonth(void)
{
   return m_month;
}

////////////////////////////////////////////////////////////////////////
// Name:       CDate::setM_month(int newM_month)
// Purpose:    Implementation of CDate::setM_month()
// Parameters:
// - newM_month
// Return:     void
////////////////////////////////////////////////////////////////////////

void CDate::Setmonth(int month)
{
   m_month = month;
}
////////////////////////////////////////////////////////////////////////
bool CDate::Isleapyear(int y)
{
	bool year=false;
	return year =(y%4==0 && y%100!=0) || (y%400==0);
}
/////////////////////////////////////////////////////////////////////////
bool CDate::operator <(CDate& date)
{
	if(this->m_year<date.m_year)
		return true;
	else if(this->m_year>date.m_year)
		return false;
	else
	{
		if(this->m_month<date.m_month)
			return true;
		else if(this->m_month>date.m_month)
			return false;
		else
		{
			if(this->m_day<date.m_day)
				return true;
			else if(this->m_day>date.m_day)
				return false;
			else 
				return false;
		}
	}
}
/////////////////////////////////////////////////////////////////////////
bool CDate::operator >(CDate& date)
{
	if(this->m_year>date.m_year)
		return true;
	else if(this->m_year<date.m_year)
		return false;
	else
	{
		if(this->m_month>date.m_month)
			return true;
		else if(this->m_month<date.m_month)
			return false;
		else
		{
			if(this->m_day>date.m_day)
				return true;
			else if(this->m_day<date.m_day)
				return false;
			else 
				return false;
		}
	}
}
///////////////////////////////////////////////////////////////////////////
bool CDate::operator ==(CDate& date)
{
	if(this->m_year!=date.m_year)
		return false;
	else
	{
		if(this->m_month!=date.m_month)
			return false;
		else
		{
			if(this->m_day!=date.m_day)
				return false;
			else
				return true;
		}
	}
}

⌨️ 快捷键说明

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