📄 opponentstaff.cpp
字号:
// OpponentStaff.cpp: implementation of the COpponentStaff class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ClientRelationship.h"
#include "OpponentStaff.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
COpponentStaff::COpponentStaff()
{
}
COpponentStaff::~COpponentStaff()
{
}
CString COpponentStaff::GetOpponentID()
{
return opponentID;
}
CString COpponentStaff::GetStaffID()
{
return staffID;
}
CString COpponentStaff::GetStaffName()
{
return staffName;
}
CString COpponentStaff::GetSex()
{
return sex;
}
COleDateTime COpponentStaff::GetBirthday()
{
return birthday;
}
CString COpponentStaff::GetNationality()
{
return nationality;
}
CString COpponentStaff::GetMarriageCondition()
{
return marriageCondition;
}
CString COpponentStaff::GetPartyFeature()
{
return partyFeature;
}
CString COpponentStaff::GetEducationLevel()
{
return educationLevel;
}
CString COpponentStaff::GetGraduateSchool()
{
return graduateSchool;
}
CString COpponentStaff::GetTelephone()
{
return telephone;
}
CString COpponentStaff::GetPostcode()
{
return postcode;
}
CString COpponentStaff::GetMobile()
{
return mobile;
}
CString COpponentStaff::GetQQ()
{
return QQ;
}
CString COpponentStaff::GetEMail()
{
return eMail;
}
CString COpponentStaff::GetDepartment()
{
return department;
}
CString COpponentStaff::GetPositionTitle()
{
return positionTitle;
}
CString COpponentStaff::GetDuty()
{
return duty;
}
CString COpponentStaff::GetAddress()
{
return address;
}
CString COpponentStaff::GetFavourite()
{
return favourite;
}
CString COpponentStaff::GetRemark()
{
return remark;
}
void COpponentStaff::SetOpponentID(CString vOpponentID)
{
opponentID=vOpponentID;
}
void COpponentStaff::SetStaffID(CString vStaffID)
{
staffID=vStaffID;
}
void COpponentStaff::SetStaffName(CString vStaffName)
{
staffName=vStaffName;
}
void COpponentStaff::SetSex(CString vSex)
{
sex=vSex;
}
void COpponentStaff::SetBirthday(COleDateTime vBirthday)
{
birthday=vBirthday;
}
void COpponentStaff::SetNationality(CString vNationality)
{
nationality=vNationality;
}
void COpponentStaff::SetMarriageCondition(CString vMarriageCondition)
{
marriageCondition=vMarriageCondition;
}
void COpponentStaff::SetPartyFeature(CString vPartyFeature)
{
partyFeature=vPartyFeature;
}
void COpponentStaff::SetEducationLevel(CString vEducationLevel)
{
educationLevel=vEducationLevel;
}
void COpponentStaff::SetGraduateSchool(CString vGraduateSchool)
{
graduateSchool=vGraduateSchool;
}
void COpponentStaff::SetTelephone(CString vTelephone)
{
telephone=vTelephone;
}
void COpponentStaff::SetPostcode(CString vPostcode)
{
postcode=vPostcode;
}
void COpponentStaff::SetMobile(CString vMobile)
{
mobile=vMobile;
}
void COpponentStaff::SetQQ(CString vQQ)
{
QQ=vQQ;
}
void COpponentStaff::SetEMail(CString vEMail)
{
eMail=vEMail;
}
void COpponentStaff::SetDepartment(CString vDepartment)
{
department=vDepartment;
}
void COpponentStaff::SetPositionTitle(CString vPositionTitle)
{
positionTitle=vPositionTitle;
}
void COpponentStaff::SetDuty(CString vDuty)
{
duty=vDuty;
}
void COpponentStaff::SetAddress(CString vAddress)
{
address=vAddress;
}
void COpponentStaff::SetFavourite(CString vFavourite)
{
favourite=vFavourite;
}
void COpponentStaff::SetRemark(CString vRemark)
{
remark=vRemark;
}
void COpponentStaff::sqlInsert()
{
CString strSQL;
strSQL="select * from opponentStaff";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(SUCCEEDED(hTRes))
{
m_pRecordset->AddNew();
CString str;
m_pRecordset->PutCollect("opponentID",_variant_t(opponentID.Left(25)));
m_pRecordset->PutCollect("staffID",_variant_t(staffID.Left(25)));
m_pRecordset->PutCollect("birthday",_variant_t(birthday));
m_pRecordset->PutCollect("staffName",_variant_t(staffName.Left(50)));
m_pRecordset->PutCollect("sex",_variant_t(sex.Left(50)));
m_pRecordset->PutCollect("nationality",_variant_t(nationality.Left(50)));
m_pRecordset->PutCollect("marriageCondition",_variant_t(marriageCondition.Left(50)));
m_pRecordset->PutCollect("partyFeature",_variant_t(partyFeature.Left(50)));
m_pRecordset->PutCollect("educationLevel",_variant_t(educationLevel.Left(50)));
m_pRecordset->PutCollect("graduateSchool",_variant_t(graduateSchool.Left(50)));
m_pRecordset->PutCollect("telephone",_variant_t(telephone.Left(50)));
m_pRecordset->PutCollect("postcode",_variant_t(postcode.Left(50)));
m_pRecordset->PutCollect("mobile",_variant_t(mobile.Left(50)));
m_pRecordset->PutCollect("QQ",_variant_t(QQ.Left(50)));
m_pRecordset->PutCollect("eMail",_variant_t(eMail.Left(50)));
m_pRecordset->PutCollect("department",_variant_t(department.Left(50)));
m_pRecordset->PutCollect("positionTitle",_variant_t(positionTitle.Left(50)));
m_pRecordset->PutCollect("duty",_variant_t(duty.Left(50)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("favourit",_variant_t(favourite.Left(50)));
m_pRecordset->PutCollect("remark",_variant_t(remark.Left(100)));
m_pRecordset->Update();
}
}
void COpponentStaff::sqlDelete(CString cOpponentID,CString cStaffID)
{
CString strSQL;
strSQL="delete from opponentStaff where opponentID='";
strSQL=strSQL+cOpponentID+"' and staffID='"+cStaffID+"'";
// AfxMessageBox(strSQL);
(((CClientRelationshipApp*)AfxGetApp())->m_pConn)->Execute((_bstr_t)strSQL,NULL,adCmdText);
}
void COpponentStaff::sqlUpdate(CString cOpponentID,CString cStaffID)
{
CString strSQL;
strSQL="select * from opponentStaff where opponentID='";
strSQL=strSQL+cOpponentID+"' and staffID='"+cStaffID+"'";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(SUCCEEDED(hTRes))
{
CString str;
m_pRecordset->PutCollect("opponentID",_variant_t(opponentID.Left(25)));
m_pRecordset->PutCollect("staffID",_variant_t(staffID.Left(25)));
m_pRecordset->PutCollect("birthday",_variant_t(birthday));
m_pRecordset->PutCollect("staffName",_variant_t(staffName.Left(50)));
m_pRecordset->PutCollect("sex",_variant_t(sex.Left(50)));
m_pRecordset->PutCollect("nationality",_variant_t(nationality.Left(50)));
m_pRecordset->PutCollect("marriageCondition",_variant_t(marriageCondition.Left(50)));
m_pRecordset->PutCollect("partyFeature",_variant_t(partyFeature.Left(50)));
m_pRecordset->PutCollect("educationLevel",_variant_t(educationLevel.Left(50)));
m_pRecordset->PutCollect("graduateSchool",_variant_t(graduateSchool.Left(50)));
m_pRecordset->PutCollect("telephone",_variant_t(telephone.Left(50)));
m_pRecordset->PutCollect("postcode",_variant_t(postcode.Left(50)));
m_pRecordset->PutCollect("mobile",_variant_t(mobile.Left(50)));
m_pRecordset->PutCollect("QQ",_variant_t(QQ.Left(50)));
m_pRecordset->PutCollect("eMail",_variant_t(eMail.Left(50)));
m_pRecordset->PutCollect("department",_variant_t(department.Left(50)));
m_pRecordset->PutCollect("positionTitle",_variant_t(positionTitle.Left(50)));
m_pRecordset->PutCollect("duty",_variant_t(duty.Left(50)));
m_pRecordset->PutCollect("address",_variant_t(address.Left(50)));
m_pRecordset->PutCollect("favourit",_variant_t(favourite.Left(50)));
m_pRecordset->PutCollect("remark",_variant_t(remark.Left(100)));
m_pRecordset->Update();
}
}
void COpponentStaff::GetData(CString cOpponentID,CString cStaffID)
{
CString strSQL;
strSQL="select * from opponentStaff where opponentID='";
strSQL=strSQL+cOpponentID+"' and staffID='"+cStaffID+"'";
_RecordsetPtr m_pRecordset;
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CClientRelationshipApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText);
if(SUCCEEDED(hTRes))
{
CString str;
opponentID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("opponentID"));
staffID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("staffID"));
birthday= m_pRecordset->GetCollect("birthday");
staffName= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("staffName"));
sex= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("sex"));
nationality= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("nationality"));
marriageCondition= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("marriageCondition"));
partyFeature= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("partyFeature"));
educationLevel= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("educationLevel"));
graduateSchool= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("graduateSchool"));
telephone= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("telephone"));
postcode= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("postcode"));
mobile= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("mobile"));
QQ= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("QQ"));
eMail= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("eMail"));
department= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("department"));
positionTitle= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("positionTitle"));
duty= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("duty"));
address= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("address"));
favourite= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("favourit"));
remark= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("remark"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -