YGFDGZXMB.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:2k
源码类别:
数据库编程
开发平台:
Visual C++
- // Ygfdgzxmb.cpp: implementation of the CYgfdgzxmb class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "Ygfdgzxmb.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CYgfdgzxmb::CYgfdgzxmb()
- {
- }
- CYgfdgzxmb::~CYgfdgzxmb()
- {
- }
- CString CYgfdgzxmb::GetYGid()
- {
- return YGid;
- }
- void CYgfdgzxmb::SetYGid(CString cYGid)
- {
- YGid=cYGid;
- }
- CString CYgfdgzxmb::GetYGxm()
- {
- return YGxm;
- }
- void CYgfdgzxmb::SetYGxm(CString cYGxm)
- {
- YGxm=cYGxm;
- }
- int CYgfdgzxmb::GetGRsds()
- {
- return GRsds;
- }
- void CYgfdgzxmb::SetGRsds(int iGRsds)
- {
- GRsds=iGRsds;
- }
- int CYgfdgzxmb::GetZFbz()
- {
- return ZFbz;
- }
- void CYgfdgzxmb::SetZFbz(int iZFbz)
- {
- ZFbz=iZFbz;
- }
- int CYgfdgzxmb::GetBXf()
- {
- return BXf;
- }
- void CYgfdgzxmb::SetBXf(int iBXf)
- {
- BXf=iBXf;
- }
- int CYgfdgzxmb::GetSHbz()
- {
- return SHbz;
- }
- void CYgfdgzxmb::SetSHbz(int iSHbz)
- {
- SHbz=iSHbz;
- }
- void CYgfdgzxmb::sql_insert()
- {
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL="SELECT * FROM Ygfdgzxmb";
- vSQL="INSERT INTO Ygfdgzxmb(YGid,YGxm)VALUES('"+YGid+"','"+YGxm+"')";
- m_AdoConn.ExecuteSQL(vSQL);
- m_AdoConn.ExitConnect();
- }
- void CYgfdgzxmb::sql_update(CString cYGid)
- {
- ADOConn m_AdoConn;
- CString strGRsds;
- strGRsds.Format("%d",GRsds);
- CString strZFbz;
- strZFbz.Format("%d",ZFbz);
- CString strBXf;
- strBXf.Format("%d",BXf);
- CString strSHbz;
- strSHbz.Format("%d",SHbz);
- _bstr_t vSQL;
- vSQL="UPDATE Ygfdgzxmb SET GRsds="+strGRsds+",ZFbz="+strZFbz+",BXf="
- +strBXf+",SHbz="+strSHbz+" WHERE YGid="+" '"+cYGid+"'";
- m_AdoConn.ExecuteSQL(vSQL);
- m_AdoConn.ExitConnect();
- }
- void CYgfdgzxmb::sql_delete(CString cYGid)
- {
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- CString sql;
- sql.Format("delete from ygfdgzxmb where ygid='%s'",cYGid);
- m_AdoConn.ExecuteSQL((_bstr_t)sql);
- m_AdoConn.ExitConnect();
- }