SQLserver數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告_第1頁
SQLserver數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告_第2頁
SQLserver數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告_第3頁
SQLserver數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告_第4頁
SQLserver數(shù)據(jù)庫課程設(shè)計(jì)報(bào)告_第5頁
已閱讀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ò)121 系 (院): 計(jì)算機(jī)工程學(xué)院 設(shè)計(jì)時(shí)間: 2014.6.192014.6.25 設(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ì)文

2、檔管理全程跟蹤的要求。二、 概念結(jié)構(gòu)設(shè)計(jì)1.系統(tǒng)功能結(jié)構(gòu) 文檔管理系統(tǒng)系統(tǒng)設(shè)置基本信息文檔管理數(shù)據(jù)庫管理用戶管理口令修改退出系統(tǒng)單位檔案文檔類別添加文檔修改文檔刪除文檔文檔瀏覽查看屬性數(shù)據(jù)庫備份數(shù)據(jù)庫還原日志管理2.業(yè)務(wù)流程圖管理人員數(shù)據(jù)庫管理文檔管理信息數(shù)據(jù)庫備份數(shù)據(jù)庫還原添加文檔修改文檔集刪除文檔集三、 物理結(jié)構(gòu)設(shè)計(jì)系統(tǒng)表文檔表單位表文檔表用戶表 四、 應(yīng)用系統(tǒng)實(shí)現(xiàn)與測(cè)試 登陸界面系統(tǒng)界面文檔基本信息日志管理文檔基本信息文檔類別單位列表五、部分代碼/ ADO.cpp: implementation of the CADO class./#include stdafx.h#include A

3、DO.h#include #ifdef _DEBUG#undef THIS_FILEstatic char THIS_FILE=_FILE_;#define new DEBUG_NEW#endif/ Construction/Destruction/int ConCount = 0;CADOConnection g_Connection;/全局?jǐn)?shù)據(jù)庫連接對(duì)象CADOConnection * GetConnection()return &g_Connection;CADOConnection:CADOConnection()InitADO();m_Connection.CreateInstanc

4、e(ADODB.Connection);CADOConnection:CADOConnection()if (IsOpen()m_Connection-Close();m_Connection = NULL;UnInitADO();void CADOConnection:InitADO()if (ConCount+ = 0) CoInitialize(NULL);void CADOConnection:UnInitADO()if (-ConCount = 0) CoUninitialize();BOOL CADOConnection:Open(CString ConStr)if (IsOpen

5、()m_Connection-Close();m_Connection-Open(_bstr_t)ConStr,adModeUnknown);return IsOpen();CString CADOConnection:GetSQLConStr(CString IP, CString DBName)CString Str;Str.Format(Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=%s;Data Source=%s,DBName,IP);return Str;_ConnectionP

6、tr CADOConnection:GetConnection()return m_Connection;BOOL CADOConnection:IsOpen()long State;m_Connection-get_State(&State);if (State = adStateOpen)return true;return false;/CADODataSet:CADODataSet()m_DataSet.CreateInstance(ADODB.Recordset);CADODataSet:CADODataSet()if (IsOpen()m_DataSet-Close();m_Dat

7、aSet = NULL;m_Connection = NULL;void CADODataSet:SetConnection(CADOConnection *pCon)m_Connection = pCon;int CADODataSet:GetRecordCount()if (IsOpen()return m_DataSet-GetRecordCount();elsereturn 0;BOOL CADODataSet:Open(CString SQLStr)if (IsOpen()m_DataSet-Close();/*/m_DataSet-Open(_bstr_t(SQLStr),_var

8、iant_t(IDispatch*)g_Connection.GetConnection(), true),adOpenKeyset, adLockOptimistic, adCmdText);return IsOpen();/*/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 CADO

9、DataSet:Next()if (m_DataSet-adoEOF)return false;m_DataSet-MoveNext();return true;void CADODataSet:AddNew()m_DataSet-AddNew();void CADODataSet:SetFieldValue(CString FieldName, _variant_t Value)m_DataSet-PutCollect(_bstr_t)FieldName,Value);void CADODataSet:Save()m_DataSet-Update();void CADODataSet:mov

10、e(int nIndex)m_DataSet-MoveFirst();m_DataSet-Move(nIndex);int CADODataSet:GetRecordNo()return m_DataSet-AbsolutePosition;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),_vari

11、ant_t(IDispatch*)g_Connection.GetConnection(), true),adOpenKeyset,(LockTypeEnum) LockType, adCmdText);return 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/ CCh

12、eckSum dialogCCheckSum:CCheckSum(CWnd* pParent /*=NULL*/): CDialog(CCheckSum:IDD, pParent)/AFX_DATA_INIT(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_l

13、ist);DDX_Control(pDX, IDC_CYY, m_cyy);DDX_Control(pDX, IDC_CMM, m_cmm);DDX_Control(pDX, IDC_CEMP, m_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_C

14、EMP, OnCloseupCemp)ON_CBN_CLOSEUP(IDC_CYY, OnCloseupCyy)ON_CBN_CLOSEUP(IDC_CMM, OnCloseupCmm)/AFX_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ù));

15、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.InsertColumn(i,病假總天數(shù));m_list.SetColumnWidth(i+,100);m_list.InsertColumn(i,事假總天數(shù));m_list.SetColumnWidth(i+,100);m_list.SetExtendedStyle(LVS_EX_FUL

16、LROWSELECT|LVS_EX_GRIDLINES);int curyear,curmonth;CTime time(CTime:GetCurrentTime();curyear = 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,

17、10);m_cmm.InsertString(n-1,value);m_cmm.SetCurSel(curmonth-1);CADODataSet dataset;dataset.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; /

18、return TRUE unless you set the focus to a control / EXCEPTION: OCX Property Pages should return FALSEvoid CCheckSum:UpdateList()m_list.DeleteAllItems();this-UpdateData();CADODataSet dataset;dataset.SetConnection(:GetConnection();CString str,temp,where,datestr,StartDate,EndDate;StartDate = m_yy + - +

19、 m_mm + -1 ;EndDate.Format(DATEADD(month,1,%s),StartDate);datestr.Format( between %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

20、,;temp += ROUND(isnull(bjdays.bjday,0),2) bjday,ROUND(isnull(sjdays.sjday,0),2) sjday;temp += 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 em

21、p.emp_name = ;temp += left join;temp += (select (sum(DATEPART(Hour,latetime) * 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 = lat

22、;temp += left join;temp += (select (sum(DATEPART(Hour,leaveearly) * 60 * 60 + ;temp += 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;te

23、mp += = ;temp += left join;temp += (select isnull(sum(DATEDIFF(second,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

24、 isnull(sum(DATEDIFF(second,onleave,offleave) ;temp += / 60.0 / 60.0 / 8.0,0) as sjday,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(te

25、mp,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-Value);m_list.SetItemText(i,n+,(_bstr_t)dataset.GetF

溫馨提示

  • 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)論