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

📄 jingli.cpp

📁 本源码是关于人事管理系统的Visual C++源代码
💻 CPP
字号:
// Jingli.cpp: implementation of the CJingli class.
/*****************************************************************/
#include "stdafx.h"
#include "../Renshi.h"
#include "Jingli.h"

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

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

CJingli::CJingli()
{
	ID = 0;
	yg_ID = 0;
	StartDate = "";
	EndDate = "";
	Unit = "";
	Title = ""; 
}

CJingli::~CJingli()
{

}

/*****************************************************************/
int CJingli::GetID()
{
	return ID;
}

void CJingli::SetID(int iID)
{
	ID = iID;
}

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

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

CString CJingli::GetStartDate()
{
	return StartDate;
}

void CJingli::SetStartDate(CString cDate)
{
	StartDate = cDate;
}

CString CJingli::GetEndDate()
{
	return EndDate;
}

void CJingli::SetEndDate(CString cDate)
{
	EndDate = cDate;
}

CString CJingli::GetUnit()
{
	return Unit;
}

void CJingli::SetUnit(CString cOrg)
{
	Unit = cOrg;
}

CString CJingli::GetTitle()
{
	return Title;
}

void CJingli::SetTitle(CString cTitle)
{
	Title = cTitle;
}




/*****************************************************************/
//插入新记录
void CJingli::sql_insert()
{	
	CString stryg_ID;
	stryg_ID.Format("%d", yg_ID);

	theApp.m_ado.Execute("INSERT INTO Jingli (yg_ID, StartDate, EndDate, Unit, Title) VALUES(" + stryg_ID + ",'" + StartDate + "','" + EndDate + "','" + Unit + "','" + Title + "')");	
}


//根据员工ID修改
void CJingli::sql_update(CString cID)
{
	CString stryg_ID;
	stryg_ID.Format("%d", yg_ID);

	theApp.m_ado.Execute("UPDATE Jingli SET yg_ID=" + stryg_ID + ", StartDate='" + StartDate +"', EndDate='" + EndDate + "', Unit='" + Unit+ "', Title='" + Title + "' WHERE ID=" + cID);	
}



//删除指定位置的记录
void CJingli::sql_delete(CString cID)
{
	theApp.m_ado.Execute("DELETE FROM Jingli WHERE ID=" + cID);	
}

//根据员工ID删除该条记录
void CJingli::sql_deleteByYg(CString cyg_ID)
{
	theApp.m_ado.Execute("DELETE FROM Jingli WHERE yg_ID=" + cyg_ID);	
}

⌨️ 快捷键说明

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