?? jingli.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 + -