aspnet基于web公司人事管理系统(编辑修改稿)内容摘要:

a(strSQL)。 } else if(6==m_nCondition) {//按婚姻 状况查询 (select * from person where ismarry=39。 %s39。 ,m_strContent)。 RefreshData(strSQL)。 } else if(7==m_nCondition) {//按职工民族查询 (select * from person where folk=39。 %s39。 ,m_strContent)。 RefreshData(strSQL)。 } else if(8==m_nCondition) {//按政治面貌查询 (select * from person where political=39。 %s39。 ,m_strContent)。 RefreshData(strSQL)。 } else if(9==m_nCondition) {//按文化程度查询 (select * from person where education=39。 %s39。 ,m_strContent)。 RefreshData(strSQL)。 } //设置按钮状态 (TRUE)。 (TRUE)。 (FALSE)。 (FALSE)。 m_bNew = FALSE。 (TRUE)。 (FALSE)。 } 6. 3 人事档案 查询 void CSearchDlg::OnButtonSearch() { // TODO: Add your control notification handler code here UpdateData()。 CString strSQL。 CString strTemp。 CString strType。 BOOL bNoCondition = TRUE。 //选择是否进行模糊查询 if(m_bType) strType = =。 else strType = like。 //根据查询条件构造 SQL 语句 /////////////////////////////////////////////// strSQL = select * from person where。 if(m_strAboutPay!=) { ( aboutpay %s 39。 %s39。 ,strType,m_strAboutPay)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strDept!=) { ( dept %s 39。 %s39。 ,strType,m_strDept)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strDuty!=) { ( duty %s 39。 %s39。 ,strType,m_strDuty)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strEducation!=) { ( education %s 39。 %s39。 ,strType,m_strEducation)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strFolk!=) { ( folk %s 39。 %s39。 ,strType,m_strFolk)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strIsWorker!=) { ( isworker %s 39。 %s39。 ,strType,m_strIsWorker)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strMarry!=) { ( ismarry %s 39。 %s39。 ,strType,m_strMarry)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strPolitical!=) { ( political %s 39。 %s39。 ,strType,m_strPolitical)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strSex!=) { ( sex %s 39。 %s39。 ,strType,m_strSex)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strTechnical!=) { ( technical %s 39。 %s39。 ,strType,m_strTechnical)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_nAge0) { ( age = %d ,strType,m_nAge)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } // MessageBox(strSQL)。 if(m_strDept2!=) { ( dept2 %s 39。 %s39。 ,strType,m_strDept2)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strDept3!=) { ( dept3 %s 39。 %s39。 ,strType,m_strDept3)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strName!=) { ( name %s 39。 %s39。 ,strType,m_strName)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(m_strNative!=) { ( native %s 39。 %s39。 ,strType,m_strNative)。 if(!bNoCondition) strSQL += and。 strSQL += strTemp。 bNoCondition = FALSE。 } if(bNoCondition) { strSQL = select * from person。 } /////////////////////////////////////////////////////////// //MessageBox(strSQL)。 ()。 (FALSE)。 if(!(AFX_DB_USE_DEFAULT_TYPE,strSQL)) { MessageBox(打开数据库失败 !,数据库错误 ,MB_OK)。 return。 } char buffer[20]。 CString strTime。 int i=0。 if(()) { MessageBox(没有符合条件的记录 !)。 return。 } while(!()) { (i,)。 (i,1,)。 (i,2,)。 (%d%d%d,(),nth(),())。 (i,3,strTime)。 _itoa(,buffer,10)。 (i,4,buffer)。 (i,5,)。 (i,6,)。 (i,7,)。 (i,8,)。 (i,9,)。 (i,10,)。 (i,11,)。 (%d%d%d,(),onth(),())。 (i,12,strTime)。 i++。 ()。 } ()。 (TRUE)。 } 6. 4 人事资料统计 主要代码如下: void CStatDlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here CString strSQL。 CString strValue=0。 CDatabase db。 (_T(Manager1))。 CRecordset recordset(amp。 db)。 UpdateData(TRUE)。 //获得统计类型 int nType = ()。 int i=0。 switch(nType) { case 0://按性别统计 ()。 (1)。 (0)。 (0,性别 )。 (1,人数 )。 (0,100)。 (1,100)。 strSQL=select count(ID) as num ,sex from person group by sex。 //MessageBox(strSQL)。 if(!(CRecordset::forwardOnly,strSQL)) { MessageBox(打开数据库失败 !,数据库错误 ,MB_OK)。 return。 } while(!()) { (sex,strValue)。 (i,strValue)。 (num,strValue)。 //MessageBox(strValue)。 (i,1,strValue)。 i++。 ()。 } ()。 break。 case 1://按年龄统计 ()。 (1)。 (0)。 (0,年龄 )。 (1,人数 )。 (0,100)。 (1,100)。 strSQL=select count(ID) as num ,age from person group by age。 if(!(CRecordset::forwardOnly,strSQL)) { MessageBox(打开数据库失败 !,数据库错误 ,MB_OK)。 return。 } while(!()) { (age,strValue)。 (i,strValue)。 (num,strValue)。 (i,1,strValue)。 i++。 ()。 } ()。 break。 case 2://按民族统计 ()。 (1)。 (0)。 (0,民族 )。 (1,人数 )。 (0,100)。 (1,100)。 strSQL=select count(ID) as num ,folk from person group by folk。 if(!(CReco。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。