GZFFMXB.CPP
资源名称:gongzi.rar [点击查看]
上传用户:ghostdhl
上传日期:2018-06-14
资源大小:9728k
文件大小:4k
源码类别:
数据库编程
开发平台:
Visual C++
- // Gzffmxb.cpp: implementation of the CGzffmxb class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "GZGLXT.h"
- #include "Gzffmxb.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CGzffmxb::CGzffmxb()
- {
- }
- CGzffmxb::~CGzffmxb()
- {
- }
- CString CGzffmxb::GetYGid()
- {
- return YGid;
- }
- void CGzffmxb::SetYGid(CString cYGid)
- {
- YGid=cYGid;
- }
- CString CGzffmxb::GetYGxm()
- {
- return YGxm;
- }
- void CGzffmxb::SetYGxm(CString cYGxm)
- {
- YGxm=cYGxm;
- }
- int CGzffmxb::GetJBgz()
- {
- return JBgz;
- }
- void CGzffmxb::SetJBgz(int iJBgz)
- {
- JBgz=iJBgz;
- }
- int CGzffmxb::GetZWgz()
- {
- return ZWgz;
- }
- void CGzffmxb::SetZWgz(int iZWgz)
- {
- ZWgz=iZWgz;
- }
- int CGzffmxb::GetGLgz()
- {
- return GLgz;
- }
- void CGzffmxb::SetGLgz(int iGLgz)
- {
- GLgz=iGLgz;
- }
- int CGzffmxb::GetYLbxj()
- {
- return YLbxj;
- }
- void CGzffmxb::SetYLbxj(int iYLbxj)
- {
- YLbxj=iYLbxj;
- }
- int CGzffmxb::GetJiaBts()
- {
- return JiaBts;
- }
- void CGzffmxb::SetJiaBts(int iJiaBts)
- {
- JiaBts=iJiaBts;
- }
- int CGzffmxb::GetJiaBgz()
- {
- return JiaBgz;
- }
- void CGzffmxb::SetJiaBgz(int iJiaBgz)
- {
- JiaBgz=iJiaBgz;
- }
- int CGzffmxb::GetSJts()
- {
- return SJts;
- }
- void CGzffmxb::SetSjts(int iSJts)
- {
- SJts=iSJts;
- }
- int CGzffmxb::GetSJkk()
- {
- return SJkk;
- }
- void CGzffmxb::SetSJkk(int iSJkk)
- {
- SJkk=iSJkk;
- }
- int CGzffmxb::GetGRsds()
- {
- return GRsds;
- }
- void CGzffmxb::SetGRsds(int iGRsds)
- {
- GRsds=iGRsds;
- }
- int CGzffmxb::GetZFbz()
- {
- return ZFbz;
- }
- void CGzffmxb::SetZFbz(int iZFbz)
- {
- ZFbz=iZFbz;
- }
- int CGzffmxb::GetBXf()
- {
- return BXf;
- }
- void CGzffmxb::SetBXf(int iBXf)
- {
- BXf=iBXf;
- }
- int CGzffmxb::GetSHbz()
- {
- return SHbz;
- }
- void CGzffmxb::SetSHbz(int iSHbz)
- {
- SHbz=iSHbz;
- }
- int CGzffmxb::GetYFje()
- {
- return YFje;
- }
- void CGzffmxb::SetYFje(int iYFje)
- {
- YFje=iYFje;
- }
- int CGzffmxb::GetSFje()
- {
- return SFje;
- }
- void CGzffmxb::SetSFje(int iSFje)
- {
- SFje=iSFje;
- }
- int CGzffmxb::GetYu_E()
- {
- return Yu_E;
- }
- void CGzffmxb::SetYu_E(int iYu_E)
- {
- Yu_E=iYu_E;
- }
- CString CGzffmxb::GetSJian()
- {
- return SJian;
- }
- void CGzffmxb::SetSJian(CString cSJian)
- {
- SJian=cSJian;
- }
- void CGzffmxb::sql_insert()
- {
- ADOConn m_AdoConn;
- CString strJBgz;
- strJBgz.Format("%d",JBgz);
- CString strZWgz;
- strZWgz.Format("%d",ZWgz);
- CString strGLgz;
- strGLgz.Format("%d",GLgz);
- CString strYLbxj;
- strYLbxj.Format("%d",YLbxj);
- CString strGRsds;
- strGRsds.Format("%d",GRsds);
- CString strZFbz;
- strZFbz.Format("%d",ZFbz);
- CString strBXf;
- strBXf.Format("%d",BXf);
- CString strSHbz;
- strSHbz.Format("%d",SHbz);
- CString strJiaBts;
- strJiaBts.Format("%d",JiaBts);
- CString strJiaBgz;
- strJiaBgz.Format("%d",JiaBgz);
- CString strSJts;
- strSJts.Format("%d",SJts);
- CString strSJkk;
- strSJkk.Format("%d",SJkk);
- CString strYFje;
- strYFje.Format("%d",YFje);
- CString strSFje;
- strSFje.Format("%d",SFje);
- _bstr_t vSQL;
- vSQL="INSERT INTO Gzffmxb(YGid,YGxm,JBgz,ZWgz,GLgz,YLbxj,SHbz,ZFbz,BXf,GRsds,JiaBts,JiaBgz,SJts,SJkk,YFje,SFje)VALUES('"
- +YGid+"','"+YGxm+"',"+strJBgz+","+strZWgz+","+strGLgz+","
- +strYLbxj+","+strSHbz+","+strZFbz+","+strBXf+","+strGRsds+","
- +strJiaBts+","+strJiaBgz+","+strSJts+","+strSJkk+","+strYFje+","
- +strSFje+")";
- m_AdoConn.ExecuteSQL(vSQL);
- m_AdoConn.ExitConnect();
- }
- void CGzffmxb::sql_delete(CString cYGid)
- {
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- CString sql;
- sql.Format("delete from Gzffmxb where ygid='%s'",cYGid);
- m_AdoConn.ExecuteSQL((_bstr_t)sql);
- m_AdoConn.ExitConnect();
- }
- int CGzffmxb::Havesyye(CString cYGid,int y,int m)
- {
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- CString sql;
- sql.Format("select * from gzffmxb where ygid='%s' and year(sjian)='%i' and month(sjian)='%i'",cYGid,y,m);
- _RecordsetPtr m_pRecordset;
- m_pRecordset=m_AdoConn.GetRecordSet((_bstr_t)sql);
- if(m_pRecordset->adoEOF)
- return -1;
- else
- return 1;
- m_AdoConn.ExitConnect();
- }