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

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、 淮 海 工 學 院 計算機工程學院課程設計報告設計名稱: 數(shù)據(jù)庫課程設計 姓 名: 學 號: 專業(yè)班級: 網(wǎng)絡121 系 (院): 計算機工程學院 設計時間: 2014.6.192014.6.25 設計地點: 機房、宿舍、文通樓、圖書館 成績:指導教師評語: 簽名: 年 月 日課程設計報告 第 15 頁,共 15 頁一、 需求分析目前,大多數(shù)文檔管理系統(tǒng)在實現(xiàn)了企業(yè)各部門日常文件管理的基本功能外,還增設了很多的新功能用以滿足文檔管理電子化、標準化的新要求,功能強大的檔案查詢模塊大大方便了管理者日常查找文檔的工作,解決了傳統(tǒng)管理中查找困難、查找耗時間等問題。使用現(xiàn)代化的文檔管理系統(tǒng)滿足了企業(yè)“

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

3、e stdafx.h#include ADO.h#include #ifdef _DEBUG#undef THIS_FILEstatic char THIS_FILE=_FILE_;#define new DEBUG_NEW#endif/ Construction/Destruction/int ConCount = 0;CADOConnection g_Connection;/全局數(shù)據(jù)庫連接對象CADOConnection * GetConnection()return &g_Connection;CADOConnection:CADOConnection()InitADO();m_Conn

4、ection.CreateInstance(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(CStri

5、ng ConStr)if (IsOpen()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);ret

6、urn Str;_ConnectionPtr 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_D

7、ataSet-Close();m_DataSet = 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(

8、_bstr_t(SQLStr),_variant_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-G

9、etFields();BOOL CADODataSet: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();

10、void CADODataSet:move(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(_

11、bstr_t(SQLStr),_variant_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

12、= _FILE_;#endif/ CCheckSum 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(p

13、DX, IDC_LISTEMP, m_list);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)

14、ON_CBN_CLOSEUP(IDC_CEMP, 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.In

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

16、ndedStyle(LVS_EX_FULLROWSELECT|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=1

17、2 ;n+)_itoa(n,value,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);UpdateLi

18、st();return TRUE; / 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;St

19、artDate = m_yy + - + 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

20、,0),2) leaveearlyday,;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)

21、;temp += works on emp.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 o

22、n emp.emp_name = ;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) leaveearly

23、s on emp.emp_name;temp += = ;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

24、join;temp += (select 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

25、= (全部) 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-Value);m_list.SetItemText(i,n+,(_bstr_t)dataset.Ge

溫馨提示

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

評論

0/150

提交評論