yuangong.cpp
上传用户:xz12345
上传日期:2007-09-12
资源大小:7437k
文件大小:4k
- // yuangong.cpp : implementation file
- //
- #include "stdafx.h"
- #include "工资.h"
- #include "yuangong.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- yuangong::yuangong()
- {
- }
- yuangong::~yuangong()
- {
- };
- /*
- CString yuangong::getbase()
- {
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- _bstr_t vSQL;
- vSQL = "SELECT gzsalary from jibengongzhong b,yuangongxinxi y WHERE y.empid='"+cempid+'" AND y.posi=b.gzname";
-
- _RecordsetPtr m_pRecordset;
- m_pRecordset = m_AdoConn.GetRecordSet(vSQL);
- if (m_pRecordset->adoEOF)
- return "";
- else
- return (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("gzsalary");
- //断开与数据库的连接
- m_AdoConn.ExitConnect();
- }
- int yuangong::getbumenjintie(CString cempid)
- {
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- _bstr_t vSQL;
- vSQL = "SELECT 部门津贴 from 部门津贴表 b,员工信息表 y WHERE y.员工ID=" + cempid + " AND y.所属部门ID=b.部门ID"
- //执行UPDATE语句
- _RecordsetPtr m_pRecordset;
- m_pRecordset = m_AdoConn.GetRecordSet(vSQL);
- if (m_pRecordset->adoEOF)
- return "";
- else
- return (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("部门津贴");
- //断开与数据库的连接
- m_AdoConn.ExitConnect();
-
- }
- int yuangong::jiabanjintie(CString cempid)
- {
- int sum,a1,a2,a3;
- int b1,b2,b3;
- CString s1,s2,s3;
- s1="pingshi";
- s2="zhoumo";
- s3="fading";
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- _bstr_t vSQL;
- vSQL = "SELECT 平时加班总时间 from 考勤信息表 WHERE 考勤信息表.员工ID=" + cempid +;
- a1=m_AdoConn.GetRecordSet(vSQL);
- vSQL = "SELECT 加班津贴每小时 from 加班津贴表 WHERE 加班津贴表.加班类型=" '"+s1+"';
- b1=m_AdoConn.GetRecordSet(vSQL);
- a1*=b1;
- vSQL = "SELECT 周末加班总时间 from 考勤信息表 WHERE 考勤信息表.员工ID=" + cempid +;
- a2=m_AdoConn.GetRecordSet(vSQL);
- vSQL = "SELECT 加班津贴每小时 from 加班津贴表 WHERE 加班津贴表.加班类型=" '"+s2+"';
- b2=m_AdoConn.GetRecordSet(vSQL);
- a2*=b2;
- vSQL = "SELECT 法定假日加班总时间 from 考勤信息表 WHERE 考勤信息表.员工ID=" + cempid +;
- a3=m_AdoConn.GetRecordSet(vSQL);
- vSQL = "SELECT 加班津贴每小时 from 加班津贴表 WHERE 加班津贴表.加班类型=" '"+s3+"';
- b3=m_AdoConn.GetRecordSet(vSQL);
- a3*=b3;
- sum=a1+a2+a3;
- return(sum);
- m_AdoConn.ExitConnect();
- }
- int yuangong::koukuan(CString cempid)
- { int a1,a2,a3;
- int b1,b2,b3,sum;
- CString s1,s2;
- s1="chidao";
- s2="zaotui";
- ADOConn m_AdoConn;
- m_AdoConn.OnInitADOConn();
- _bstr_t vSQL;
- vSQL = "SELECT 迟到次数 from 考勤信息表 WHERE 考勤信息表.员工ID=" + cempid +;
- a1=m_AdoConn.GetRecordSet(vSQL);
- vSQL = "SELECT 扣款额每次 from 考勤扣款表 WHERE 考勤扣款表.考勤类型=" '"+s1+"';
- b1=m_AdoConn.GetRecordSet(vSQL);
- a1*=b1;
- vSQL = "SELECT 早退次数 from 考勤信息表 WHERE 考勤信息表.员工ID=" + cempid +;
- a2=m_AdoConn.GetRecordSet(vSQL);
- vSQL = "SELECT 扣款额每次 from 考勤扣款表 WHERE 考勤扣款表.考勤类型=" '"+s2+"';
- b2=m_AdoConn.GetRecordSet(vSQL);
- a2*=b2;
- sum=a1+a2;
- return(sum);
- m_AdoConn.ExitConnect();
- }
- */
- void yuangong::sql_insert()
- {
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL ="INSERT INTO yuangongxinxi(empid,empname,sex,depid,posi) VALUES('"+cempid+"', '"+empname+"','"+sex+ "','"+depID+"','"+pos+"')";
- m_AdoConn.OnInitADOConn();
- //执行INSERT语句
- m_AdoConn.ExecuteSQL(vSQL);
- //断开与数据库的连接
- m_AdoConn.ExitConnect();
- }
- void yuangong::sql_delete()
- {
- ADOConn m_AdoConn;
- _bstr_t vSQL;
- vSQL = "DELETE FROM yuangongxinxi WHERE empid=" + cempid;
- m_AdoConn.OnInitADOConn();
- //执行INSERT语句
- m_AdoConn.ExecuteSQL(vSQL);
- //断开与数据库的连接
- m_AdoConn.ExitConnect();
- }