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

📄 wage1.cpp

📁 这是一个用VC++编写的工资管理系统
💻 CPP
字号:
// Wage1.cpp: implementation of the CWage class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Wage.h"
#include "Wage1.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CWage,CObject,1)

CWage::CWage()
{
	 m_month=0;
 m_workernum=0;
 m_basewage=0;
	 m_extrawage=0;
	 m_positionwage=0;
	 m_addwage=0;
 m_housewage=0;
 m_trafficwage=0;
 m_shouldgive=0;
	 m_houserent=0;
	 m_store=0;
 m_meetingmoney=0;
	 m_tax=0;
	 m_shouldsub=0;
	 m_actualgive=0;
}

CWage::~CWage()
{

}

CWage::CWage(int mon,int wnum,double bw,
			 double ew,double pw,double aw,double hw,
			 double tw,double hr,double st,double mm)
{
	//自加
	 m_month=mon;
 m_workernum=wnum;
 m_basewage=bw;
	 m_extrawage=ew;
	 m_positionwage=pw;
	 m_addwage=aw;
 m_housewage=hw;
 m_trafficwage=tw;
 m_shouldgive=ShouldGive();
	 m_houserent=hr;
	 m_store=st;
 m_meetingmoney=mm;
	 m_tax=persontax();
	 m_shouldsub=ShouldSub();
	 m_actualgive=ActualGive();
}

double CWage::persontax()  //自加
{
	if(m_basewage<800)
		m_tax=0;
	else if(m_basewage>=800 && m_basewage<1000)
		m_tax=0.05 * m_basewage;
	else if(m_basewage>=1000 && m_basewage<5000)
		m_tax=0.1 * m_basewage;
	else m_tax=0.2 * m_basewage;
	return m_tax;
}

void CWage::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		ar<<m_workernum<<m_actualgive<<m_addwage<<m_basewage<<m_extrawage<<m_houserent<<m_housewage<<m_meetingmoney<<m_month<<m_positionwage<<m_shouldgive<<m_shouldsub<<m_store<<m_tax<<m_trafficwage;
	}
	else
	{
		ar>>m_workernum>>m_actualgive>>m_addwage>>m_basewage>>m_extrawage>>m_houserent>>m_housewage>>m_meetingmoney>>m_month>>m_positionwage>>m_shouldgive>>m_shouldsub>>m_store>>m_tax>>m_trafficwage;
	}
}


double CWage::ShouldGive()
{
	double t;
	t=m_basewage+m_addwage+m_extrawage+m_housewage+m_positionwage+m_trafficwage;
	return t;
}

double CWage::ShouldSub()
{
	double m;
	m=m_tax+m_houserent+m_meetingmoney+m_store;
	return m;
}

double CWage::ActualGive()
{
	double a;
	a=m_shouldgive-m_shouldsub;
	return a;
}

void CWage::output(CDC *pDC, int hang)
{
//	pDC->TextOut(0,hang*10,m_basewage);
//	pDC->TextOut(20,hang*10,m_actualgive);
//	pDC->TextOut()

}

void CWage::OnDraw( CDC *pDC)
{
	static int i=0;
	CString str;
	str.Format("%i %i %d %d %d %d %d %d %d %d %d %d %d %d %d ",m_month,m_workernum,m_actualgive,m_addwage,m_basewage,m_extrawage,m_houserent,m_housewage,m_meetingmoney,m_positionwage,m_shouldgive,m_shouldsub,m_store,m_tax,m_trafficwage);
	pDC->TextOut(i*10,0,str);
	i++;

}

⌨️ 快捷键说明

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