SQLserver數(shù)據(jù)庫課程設(shè)計(jì)_第1頁
SQLserver數(shù)據(jù)庫課程設(shè)計(jì)_第2頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、淮海 工學(xué)院 計(jì)算機(jī)工程學(xué)院課程設(shè)計(jì)報(bào)告設(shè)計(jì)名稱:數(shù)據(jù)庫課程設(shè)計(jì)姓名:學(xué)號(hào):專業(yè)班級(jí):網(wǎng)絡(luò) 121121系(院):計(jì)算機(jī)工程學(xué)院設(shè)計(jì)時(shí)間:設(shè)計(jì)地點(diǎn):機(jī)房、佰舍、文通樓、圖書館指導(dǎo)教師評(píng)語:簽名:年 月 日成績:需求分析目前,大多數(shù)文檔管理系統(tǒng)在實(shí)現(xiàn)了企業(yè)各部門日常文件管理的基本功能外,還增設(shè)了很多的新功 能用以滿足文檔管理電子化、標(biāo)準(zhǔn)化的新要求,功能強(qiáng)大的檔案查詢模塊大大方便了管理者日常查 找文檔的工作,解決了傳統(tǒng)管理中查找困難、查找耗時(shí)間等問題。使用現(xiàn)代化的文檔管理系統(tǒng)滿足 了企業(yè)“無紙化”的辦公要求,實(shí)現(xiàn)了通過計(jì)算機(jī)對(duì)文檔管理全程跟蹤的要求。概念結(jié)構(gòu)設(shè)計(jì)1.系統(tǒng)功能結(jié)構(gòu)2.業(yè)務(wù)流程圖數(shù)據(jù)庫

2、備份亠數(shù)據(jù)庫管理- 數(shù)據(jù)庫還原*添加文檔L*文檔管理信息- -修改文檔集*刪除文檔集三、物理結(jié)構(gòu)設(shè)計(jì)系統(tǒng)表_ Dwxxbdbo2006/3/15J Rizhibdbc2006/3/25 Usersdbo2CXJ6/3/14_3 Zdmlbdbo2006/3/23 Zdxxbdbc2005/3/24文檔表表-dlbo.Dwxxb睛賽 XDWbhDWmcLxrLxdhLxdzMemon淮海工學(xué)院陶玉燦1836057736蒼梧路59號(hào)2計(jì)算機(jī)學(xué)院李存華1233765342計(jì)算機(jī)工程學(xué)MJLLMLNLALNLALNULLNLIL文檔表DWbhIBbhWDbhWDn*cG2zWJQMerroTJIMJI

3、IrAUfNULLNULLMJILNULLNULLNULl用戶表UsernamePwdJBmirmreoft1mrig1111州q1230AUZAtti他四、應(yīng)用系統(tǒng)實(shí)現(xiàn)與測試可丈檔琶參蜿*_ 穀蠢說言 眉唱皂 交趨官理 睛尊辭匕C基本倍息琶理m 淮海工學(xué)院 出 r 計(jì)耳機(jī)字院酉林省匪E科技有限覽司當(dāng)前用戶;E當(dāng)前日朋;W06登陸界面系統(tǒng)界面冒同罔対q I 0 |單幡改遠(yuǎn)退 E 基筑文檔基本信息日志管理文檔基本信息哲文檔管理* d基本信息信患刪除|用戶容narutonarutonarutonarutonarutonrutc登錄時(shí)間動(dòng)作OEHB-2506-03-2506-03-2506-03-2

4、505-03-256-03-25改改改錄錄fefeffefef他錄_登登單單單登-文檔類別單位列表單位編號(hào)單位名稱聯(lián)系人 聯(lián)系電話1836057788蒼梧住1238765342甘算*五、部分代碼/ ADO.cpp: impleme ntation of the CADO class./#include stdafx.h#i nclude ADO.h#in clude #ifdef _DEBUG#un def THIS_FILEstatic char THIS_FILE=_FILE.如類別#define new DEBUG_NEW#endif/ Construction/Destruction

5、/ int ConCount = 0;CADOConnection g_Connection;/全局?jǐn)?shù)據(jù)庫連接對(duì)象CADOConnection * GetConnection()return &g_Connection;CADOConnection:CADOConnection()InitADO(); m_Connection.CreateInstance(ADODB.Connection);CADOConnection:CADOConnection()if (IsOpen() m_Connection-Close();m_Connection = NULL;UnInitADO();void

6、CADOConnection:InitADO()if (ConCount+ = 0) CoInitialize(NULL);void CADOConnection:UnInitADO()if (-ConCount = 0) CoUninitialize();BOOL CADOConnection:Open(CString ConStr)if (IsOpen() m_Connection-Close();m_Connection-Open(_bstr_t)ConStr,adModeUnknown); return IsOpen();CString CADOConnection:GetSQLCon

7、Str(CString IP, CString DBName)CString Str;Str.Format(Provider=SQLOLEDB.1;Persist Security Info=False;User Catalog=%s;DataSource=%s,DBName,IP);return Str;_ConnectionPtr CADOConnection:GetConnection()return m_Connection;BOOL CADOConnection:IsOpen()long State; m_Connection-get_State(&State); if (State

8、 = adStateOpen) return true;return false;/ CADODataSet:CADODataSet()m_DataSet.CreateInstance(ADODB.Recordset);CADODataSet:CADODataSet()if (IsOpen() m_DataSet-Close();m_DataSet = NULL;m_Connection = NULL;void CADODataSet:SetConnection(CADOConnection *pCon)m_Connection = pCon;int CADODataSet:GetRecord

9、Count()if (IsOpen()ID=sa;Initialreturn m_DataSet-GetRecordCount();else return 0;BOOL CADODataSet:Open(CString SQLStr)if (IsOpen() m_DataSet-Close();/*/ m_DataSet-Open(_bstr_t(SQLStr),_variant_t(IDispatch*)g_Connection.GetConnection(), true), adOpenKeyset,adLockOptimistic, adCmdText);return IsOpen();

10、/*/BOOL CADODataSet:IsOpen()long State; m_DataSet-get_State(&State); if (State = adStateOpen) return true;return false;FieldsPtr CADODataSet:GetFields()return m_DataSet-GetFields();BOOL CADODataSet:Next()if (m_DataSet-adoEOF) return false;m_DataSet-MoveNext();return true;void CADODataSet:AddNew()m_D

11、ataSet-AddNew();void CADODataSet:SetFieldValue(CString FieldName, _variant_t Value)m_DataSet-PutCollect(_bstr_t)FieldName,Value);void CADODataSet:Save()m_DataSet-Update();void CADODataSet:move(int nIndex)m_DataSet-MoveFirst(); m_DataSet-Move(nIndex);int CADODataSet:GetRecordNo()return m_DataSet-Abso

12、lutePosition;void CADODataSet:Delete()m_DataSet-Delete(adAffectCurrent);BOOL CADODataSet:Open(CString SQLStr, int LockType)if (IsOpen() m_DataSet-Close();/*/ m_DataSet-Open(_bstr_t(SQLStr),_variant_t(IDispatch*)g_Connection.GetConnection(), true),adOpenKeyset,(LockTypeEnum) LockType, adCmdText); ret

13、urn IsOpen();/ CheckSum.cpp : implementation file/#include stdafx.h#include Person.h#include CheckSum.h#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ / CCheckSum dialogCCheckSum:CCheckSum(CWnd* pParent /*=NULL*/) : CDialog(CCheckSum:IDD, pParent)/AFX_DATA_IN

14、IT(CCheckSum) m_emp = _T();m_mm = _T();m_yy = _T(); /AFX_DATA_INITvoid CCheckSum:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX); /AFX_DATA_MAP(CCheckSum) DDX_Control(pDX,IDC_LISTEMP, m_list);DDX_Control(pDX, IDC_CYY, m_cyy);DDX_Control(pDX, IDC_CMM, m_cmm);DDX_Control(pDX, IDC_CEMP, m

15、_cemp);DDX_CBString(pDX, IDC_CEMP, m_emp);DDX_CBString(pDX, IDC_CMM, m_mm);DDX_CBString(pDX, IDC_CYY, m_yy); /AFX_DATA_MAPBEGIN_MESSAGE_MAP(CCheckSum, CDialog)/AFX_MSG_MAP(CCheckSum) ON_CBN_CLOSEUP(IDC_CEMP, OnCloseupCemp)ON_CBN_CLOSEUP(IDC_CYY, OnCloseupCyy) ON_CBN_CLOSEUP(IDC_CMM,OnCloseupCmm) /AF

16、X_MSG_MAPEND_MESSAGE_MAP()/ CCheckSum message handlersBOOL CCheckSum:OnInitDialog()CDialog:OnInitDialog();int i = 0; m_list.InsertColumn(i,人員姓名); m_list.SetColumnWidth(i+,100);m_list.InsertColumn(i,工作總天數(shù)); m_list.SetColumnWidth(i+,100);m_list.InsertColumn(i,遲到總天數(shù)); m_list.SetColumnWidth(i+,100);m_li

17、st.InsertColumn(i,早退總天數(shù)); m_list.SetColumnWidth(i+,100);m_list.InsertColumn(i,病假總天數(shù)); m_list.SetColumnWidth(i+,100);m_list.InsertColumn(i,事假總天數(shù)); m_list.SetColumnWidth(i+,100);m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);int curyear,curmonth;CTime time(CTime:GetCurrentTime();curyea

18、r = time.GetYear(); curmonth = time.GetMonth();char value10;for (int y = 2000; y 2100 ;y+)_itoa(y,value,10); m_cyy.InsertString(y-2000,value);m_cyy.SetCurSel(curyear-2000);for (int n = 1 ; n=12 ;n+)_itoa(n,value,10); m_cmm.InsertString(n-1,value);m_cmm.SetCurSel(curmonth-1);CADODataSet dataset; data

19、set.SetConnection(:GetConnection();dataset.Open(Select * From tab_Employees); m_cemp.InsertString(0,(全部);for (int index = 1 ; index Itememp_name-Value); dataset.Next();m_cemp.SetCurSel(0);UpdateList();return TRUE; / return TRUE unless you set the focus to a control / EXCEPTION: OCX PropertyPages sho

20、uld return FALSEvoid CCheckSum:UpdateList()m_list.DeleteAllItems(); this-UpdateData(); CADODataSet dataset;dataset.SetConnection(:GetConnection();CString str,temp,where,datestr,StartDate,EndDate;StartDate = m_yy + - + m_mm + -1 ; EndDate.Format(DATEADD(month,1,%s),StartDate);datestr.Format( between

21、%s and %s,StartDate,EndDate);/*/temp += select emp.emp_name ,ROUND(isnull(works.workday,0),2);temp += workday,ROUND(isnull(lates.lateday,0),2) lateday,;temp += ROUND(isnull(leaveearlys.leaveearlyday,0),2) leaveearlyday,;temp += ROUND(isnull(bjdays.bjday,0),2) bjday,ROUND(isnull(sjdays.sjday,0),2) te

22、mp += from tab_Employees emp ;temp += left join;temp += (select sum(DATEDIFF(second,ontime,offtime) / 60.0 / 60.0 / 8.0;temp += as workday,name From tab_Check where checkdate %s group by name);temp += works on emp.emp_name = ;temp += left join;temp += (select (sum(DATEPART(Hour,latetime) *

23、 60 * 60 + ;temp += sum(DATEPART(minute,latetime) * 60 + sum(DATEPART(second,latetime);temp += /60.0 /60.0 /8.0 as lateday,name From tab_Check where checkdate;temp += %s group by name) lates on emp.emp_name = ;temp += left join;temp += (select (sum(DATEPART(Hour,leaveearly) * 60 * 60 + ;te

24、mp += sum(DATEPART(minute,leaveearly) * 60 + sum(DATEPART(second,leaveearly);temp += /60.0 /60.0 /8.0 as leaveearlyday,name From tab_Check where ;temp += checkdate %s group by name) leaveearlys on emp.emp_name;sjday;temp += = ;temp += left join;temp += (select isnull(sum(DATEDIFF(sec

25、ond,onleave,offleave);temp += / 60.0 / 60.0 / 8.0,0) as bjday,name From tab_Check where;temp += leave = 病假 and checkdate %s group by name) ;temp += bjdays on emp.emp_name = ;temp += left join;temp += (select isnull(sum(DATEDIFF(second,onleave,offleave) ;temp += / 60.0 / 60.0 / 8.0,0) as s

26、jday,name From tab_Check where ;temp += leave = 事假 and checkdate %s group by name) ;temp += sjdays on emp.emp_name = ;temp += %s;/*/where.Format( where emp.emp_name = %s,m_emp);if (m_emp = (全部)str.Format(temp,datestr,datestr,datestr,datestr,datestr,);elsestr.Format(temp,datestr,datestr,datestr,datestr,datestr,where);/*/dataset.Open(str,adLockUnspecified);for (int i = 0; i Itememp_name-Value);m_list.SetItemText(i,n+,(_bstr_t)dataset.GetFields()-Itemworkday-Value);m_list.SetItemText(i,n+,(_bstr_t)dataset.GetFields()-Itemlateday-Valu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論