📄 clientstaff.cpp
字号:
// ClientStaff.cpp: implementation of the CClientStaff class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ClientRelationship.h"
#include "ClientStaff.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CClientStaff::CClientStaff()
{
}
CClientStaff::~CClientStaff()
{
}
CString CClientStaff::GetClientID()
{
return clientID;
}
CString CClientStaff::GetStaffID()
{
return staffID;
}
CString CClientStaff::GetStaffName()
{
return staffName;
}
CString CClientStaff::GetSex()
{
return sex;
}
COleDateTime CClientStaff::GetBirthday()
{
return birthday;
}
CString CClientStaff::GetNationality()
{
return nationality;
}
CString CClientStaff::GetMarriageCondition()
{
return marriageCondition;
}
CString CClientStaff::GetPartyFeature()
{
return partyFeature;
}
CString CClientStaff::GetEducationLevel()
{
return educationLevel;
}
CString CClientStaff::GetGraduateSchool()
{
return graduateSchool;
}
CString CClientStaff::GetTelephone()
{
return telephone;
}
CString CClientStaff::GetPostCode()
{
return postCode;
}
CString CClientStaff::GetMobile()
{
return mobile;
}
CString CClientStaff::GetQQ()
{
return QQ;
}
CString CClientStaff::GetEMail()
{
return eMail;
}
CString CClientStaff::GetDepartment()
{
return department;
}
CString CClientStaff::GetPositionTitle()
{
return positionTitle;
}
CString CClientStaff::GetDuty()
{
return duty;
}
CString CClientStaff::GetAddress()
{
return address;
}
CString CClientStaff::GetFavourit()
{
return favourit;
}
CString CClientStaff::GetRemark()
{
return remark;
}
void CClientStaff::SetClientID(CString vClientID)
{
clientID=vClientID;
}
void CClientStaff::SetStaffID(CString vStaffID)
{
staffID=vStaffID;
}
void CClientStaff::SetStaffName(CString vStaffName)
{
staffName=vStaffName;
}
void CClientStaff::SetSex(CString vSex)
{
sex=vSex;
}
void CClientStaff::SetBirthday(COleDateTime vBirthday)
{
birthday=vBirthday;
}
void CClientStaff::SetNationality(CString vNationality)
{
nationality=vNationality;
}
void CClientStaff::SetMarriageCondition(CString vMarriageCondition)
{
marriageCondition=vMarriageCondition;
}
void CClientStaff::SetPartyFeature(CString vPartyFeature)
{
partyFeature=vPartyFeature;
}
void CClientStaff::SetEducationLevel(CString vEducationLevel)
{
educationLevel=vEducationLevel;
}
void CClientStaff::SetGraduateSchool(CString vGraduateSchool)
{
graduateSchool=vGraduateSchool;
}
void CClientStaff::SetTelephone(CString vTelephone)
{
telephone=vTelephone;
}
void CClientStaff::SetPostCode(CString vPostcode)
{
postCode=vPostcode;
}
void CClientStaff::SetMobile(CString vMobile)
{
mobile=vMobile;
}
void CClientStaff::SetQQ(CString vQQ)
{
QQ=vQQ;
}
void CClientStaff::SetEMail(CString vEMail)
{
eMail=vEMail;
}
void CClientStaff::SetDepartment(CString vDepartment)
{
department=vDepartment;
}
void CClientStaff::SetPositionTitle(CString vPositionTitle)
{
positionTitle=vPositionTitle;
}
void CClientStaff::SetDuty(CString vDuty)
{
duty=vDuty;
}
void CClientStaff::SetAddress(CString vAddress)
{
address=vAddress;
}
void CClientStaff::SetFavourit(CString vFavourit)
{
favourit=vFavourit;
}
void CClientStaff::SetRemark(CString vRemark)
{
remark=vRemark;
}
void CClientStaff::sqlInsert()
{
CString strSQL;
strSQL="select * from clientStaff";
_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("clientID",_variant_t(clientID.Left(25)));
m_pRecordset->PutCollect("staffID",_variant_t(staffID.Left(25)));
m_pRecordset->PutCollect("staffName",_variant_t(staffName));
m_pRecordset->PutCollect("sex",_variant_t(sex.Left(50)));
m_pRecordset->PutCollect("birthday",_variant_t(birthday));
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(100)));
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(favourit.Left(50)));
m_pRecordset->PutCollect("remark",_variant_t(remark.Left(100)));
m_pRecordset->Update();
}
}
void CClientStaff::sqlUpdate(CString cClientID,CString cStaffID)
{
CString strSQL;
strSQL="select * from clientStaff where clientID='";
strSQL=strSQL+cClientID+"' 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("clientID",_variant_t(clientID.Left(25)));
m_pRecordset->PutCollect("staffName",_variant_t(staffName));
m_pRecordset->PutCollect("sex",_variant_t(sex.Left(50)));
m_pRecordset->PutCollect("birthday",_variant_t(birthday));
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(100)));
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(favourit.Left(50)));
m_pRecordset->PutCollect("remark",_variant_t(remark.Left(100)));
m_pRecordset->Update();
}
}
void CClientStaff::sqlDelete(CString cClientID,CString cStaffID)
{
CString strSQL;
strSQL="delete from clientStaff where clientID='";
strSQL=strSQL+cClientID+"' and staffID='";
strSQL=strSQL+cStaffID+"'";
(((CClientRelationshipApp*)AfxGetApp())->m_pConn)->Execute((_bstr_t)strSQL,NULL,adCmdText);
}
void CClientStaff::GetData(CString cClientID,CString cStaffID)
{
CString strSQL;
strSQL="select * from clientStaff where clientID='";
strSQL=strSQL+cClientID+"' 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;
clientID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("clientID"));
staffID= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("staffID"));
staffName= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("staffName"));
sex= ((CClientRelationshipApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("sex"));
birthday= m_pRecordset->GetCollect("birthday");
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"));
favourit= ((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 + -