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

📄 pingjia.cpp

📁 本源码是关于人事管理系统的Visual C++源代码
💻 CPP
字号:
// Pingjia.cpp: implementation of the CPingjia class.
/*********************************************************************/


#include "stdafx.h"
#include "../Renshi.h"
#include "Pingjia.h"

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


extern CRenshiApp theApp;
/*********************************************************************/

CPingjia::CPingjia()
{
	EvaMonth = "";
	yg_ID = 0;
	ztEva = "";
	jlReason = "";
	jlAmount = 0;
	cfReason = "";
	cfAmount = 0;
	Memo = "";
}

CPingjia::~CPingjia()
{

}

CString CPingjia::GetEvaMonth()
{
	return EvaMonth;
}

void CPingjia::SetEvaMonth(CString cEvaMonth)
{
	EvaMonth = cEvaMonth;
}

int CPingjia::Getyg_ID()
{
	return yg_ID;
}

void CPingjia::Setyg_ID(int iyg_ID)
{
	yg_ID = iyg_ID;
}

CString CPingjia::GetztEva()
{
	return ztEva;
}

void CPingjia::SetztEva(CString cztEva)
{
	ztEva = cztEva;
}

CString CPingjia::GetjlReason()
{
	return jlReason;
}

void CPingjia::SetjlReason(CString cjlReason)
{
	jlReason = cjlReason;
}

int CPingjia::GetjlAmount()
{
	return jlAmount;
}

void CPingjia::SetjlAmount(int ijlAmount)
{
	jlAmount = ijlAmount;
}

CString CPingjia::GetcfReason()
{
	return cfReason;
}

void CPingjia::SetcfReason(CString ccfReason)
{
	cfReason = ccfReason;
}

int CPingjia::GetcfAmount()
{
	return cfAmount;
}

void CPingjia::SetcfAmount(int icfAmount)
{
	cfAmount = icfAmount;
}

CString CPingjia::GetMemo()
{
	return Memo;
}

void CPingjia::SetMemo(CString cMemo)
{
	Memo = cMemo;
}


	
/*********************************************************************/
int CPingjia::HaveRecord(CString cEvaMonth, CString cyg_ID)
{
	_RecordsetPtr m_pRecordset= theApp.m_ado.GetRS("SELECT * FROM Pingjia WHERE EvaMonth='" + cEvaMonth 	+ "' AND yg_ID=" + cyg_ID);
	
	if (m_pRecordset->adoEOF)
		return -1;
	else
		return 1;

}

	
void CPingjia::sql_insert()
{	
	CString stryg_ID,strjlAmount,strcfAmount;
	stryg_ID.Format("%d", yg_ID);
	strjlAmount.Format("%d", jlAmount);
	strcfAmount.Format("%d", cfAmount);

	CString str("INSERT INTO Pingjia VALUES('" + EvaMonth + "'," 
												  + stryg_ID + ",'" 	
												  + ztEva + "','" 
												  + jlReason + "'," 
												  + strjlAmount + ",'" 
												  + cfReason + "'," 		
												  + strcfAmount + ",'" 
												  + Memo + "')" );	

	theApp.m_ado.Execute(str);
}



void CPingjia::sql_update(CString cEvaMonth, CString cyg_ID)
{
	CString stryg_ID,strjlAmount,strcfAmount;
	stryg_ID.Format("%d", yg_ID);
	strjlAmount.Format("%d", jlAmount);
	strcfAmount.Format("%d", cfAmount);

	CString vSQL("UPDATE Pingjia SET ztEva='" +		ztEva 
								  + "', jlReason='" +	jlReason 		
								  + "', jlAmount=" +	strjlAmount 
								  + ",  cfReason='" +	cfReason 
								  + "',  cfAmount="	+	strcfAmount
								  + ",  Memo='" + Memo 
				 + "' WHERE EvaMonth='" + cEvaMonth  + "' AND yg_ID=" + cyg_ID );

	theApp.m_ado.Execute(vSQL);	
}

void CPingjia::sql_delete(CString cEvaMonth, CString cyg_ID)
{
	theApp.m_ado.Execute( "DELETE FROM Pingjia WHERE EvaMonth='" + cEvaMonth	+ "' AND yg_ID=" + cyg_ID);	
}

void CPingjia::sql_deleteByYg(CString cyg_ID)
{
	theApp.m_ado.Execute("DELETE FROM Pingjia WHERE yg_ID=" + cyg_ID);	
}

⌨️ 快捷键说明

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