2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩32頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、<p><b>  高校工資管理系統(tǒng)</b></p><p><b>  數(shù)據(jù)庫原理課程設(shè)計(jì)</b></p><p><b>  目 錄</b></p><p>  1.概述··········

2、;····································

3、83;··3</p><p>  1.1項(xiàng)目背景·····························

4、;·····················3</p><p>  1.2編寫目的··········&

5、#183;····································

6、;···3</p><p>  1.3軟件定義····························&

7、#183;·····················3</p><p>  1.4開發(fā)環(huán)境·········

8、83;····································&

9、#183;···3</p><p>  2.需求分析····························

10、;·················4</p><p>  2.1需求分析說明··············

11、;································4</p><p>  2.2

12、數(shù)據(jù)庫需求分析···································

13、83;········4</p><p>  2.2.1 系統(tǒng)功能基本要求······················

14、;··············4</p><p>  2.2.2 數(shù)據(jù)庫要求················

15、3;·························4</p><p>  2.3數(shù)據(jù)流圖······&

16、#183;····································

17、;·······5</p><p>  2.3.1頂層數(shù)據(jù)流圖·······················

18、83;···············5</p><p>  2.3.21 層數(shù)據(jù)流圖···············

19、························5</p><p>  2.3.32層數(shù)據(jù)流圖_1驗(yàn)證賬號(hào)·····

20、3;·······················6 </p><p>  2.3.42層數(shù)據(jù)流圖_2系統(tǒng)用戶管理······

21、;···················6</p><p>  2.3.52層數(shù)據(jù)流圖_3員工信息管理··········&

22、#183;··············7</p><p>  2.3.62層數(shù)據(jù)流圖_4工資設(shè)立標(biāo)準(zhǔn)··············

23、83;··········7</p><p>  2.3.72層數(shù)據(jù)流圖_5工資信息管理···················

24、;······8</p><p>  3.數(shù)據(jù)庫概念結(jié)構(gòu)設(shè)計(jì)························

25、3;···········9</p><p>  3.1 E-R模型圖···················

26、83;····························9</p><p>  3.2 關(guān)系模型··

27、3;····································&#

28、183;·········10</p><p>  3.2.1由E-R圖轉(zhuǎn)換的關(guān)系模型····················

29、;·········10</p><p>  3.2.2工資部分實(shí)體屬性圖·····················

30、;············10</p><p>  3.2.3教職工部分實(shí)體屬性圖·················

31、3;·············11</p><p>  3.2.4出勤狀況實(shí)體屬性圖················

32、3;················11</p><p>  3.2.5用戶實(shí)體屬性圖··············

33、·······················11</p><p>  4.數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計(jì)·······

34、3;···························12</p><p>  4.1數(shù)據(jù)表關(guān)系圖···

35、83;····································&

36、#183;·····12</p><p>  4.2教職工信息表·························

37、·····················12</p><p>  4.3工資信息表··········&

38、#183;····································

39、;·12</p><p>  4.4工資結(jié)算方表·····························

40、3;················13</p><p>  4.5工作情況信息表··············

41、83;·····························14</p><p>  4.6用戶信息表·

42、83;····································&

43、#183;·········14</p><p>  5.程序結(jié)構(gòu)圖·····················

44、83;·····················15</p><p>  5.1系統(tǒng)架構(gòu)圖·········

45、83;····································&

46、#183;·15</p><p>  5.2程序功能圖·····························&

47、#183;··················15</p><p>  6.程序源代碼及其說明············

48、;·······················16</p><p>  6.1登陸界面實(shí)現(xiàn)代碼和截圖·······

49、;·····························16</p><p>  6.1.1核心代碼·

50、3;····································&#

51、183;····16</p><p>  6.1.2登陸界面··························&

52、#183;················16</p><p>  6.2工資查詢實(shí)現(xiàn)代碼及截圖·············&#

53、183;······················17</p><p>  6.2.1核心代碼 ········

54、;·································17</p><p&g

55、t;  6.2.2查詢界面··································&#

56、183;········20</p><p>  6.3出勤功能實(shí)現(xiàn)代碼及截圖·····················&#

57、183;··············21</p><p>  6.3.1核心代碼················&

58、#183;··························21</p><p>  6.3.2考勤情況界面···

59、3;···································23</p

60、><p>  6.4教職工基本信息添加實(shí)現(xiàn)代碼及截····························23</p>&l

61、t;p>  6.4.1核心代碼·································

62、83;·········23</p><p>  6.4.2 教職工信息查詢界面····················&#

63、183;············25</p><p>  6.5系統(tǒng)設(shè)置實(shí)現(xiàn)代碼和截圖·················&#

64、183;··················26</p><p>  6.5.1確定修改系統(tǒng)設(shè)置實(shí)現(xiàn)代碼···········

65、;················26</p><p>  6.5.1刪除教職工信息功能實(shí)現(xiàn)代碼·············&

66、#183;···········27</p><p>  總結(jié)····················&#

67、183;································29</p><p> 

68、 參考文獻(xiàn)····································

69、;············29</p><p><b>  概 述</b></p><p><b>  1.1項(xiàng)目背景</b></p><p>  隨著高等學(xué)校的快速發(fā)展,高校規(guī)模越來越大,教職工的數(shù)量

70、也越來越多,高校工資管理更加的復(fù)雜,而工資管理是一項(xiàng)瑣碎、復(fù)雜而又十分細(xì)致的工作,工資計(jì)算、發(fā)放、核算的工作量很大,一般不允許出錯(cuò),如果實(shí)行手工操作,每月發(fā)放工資須手工填制大量的表格,這就會(huì)耗費(fèi)工作人員大量的時(shí)間和精力,計(jì)算機(jī)進(jìn)行工資發(fā)放工作,不僅能夠保證工資核算準(zhǔn)確無誤、快速輸出,而且還可以利用計(jì)算機(jī)對(duì)有關(guān)工資的各種信息進(jìn)行統(tǒng)計(jì),服務(wù)于財(cái)務(wù)部門其他方面的核算和財(cái)務(wù)處理,同時(shí)計(jì)算機(jī)具有著手工管理所無法比擬的優(yōu)點(diǎn).例如:檢索迅速、查找方便

71、、可靠性高、存儲(chǔ)量大、保密性好、壽命長、成本低等。這些優(yōu)點(diǎn)能夠極大地提高人事工資資管理的效率,也是企業(yè)的科學(xué)化、正規(guī)化管理,與世界接軌的重要條件。這就對(duì)高校工資管理提出了新的要求,用計(jì)算機(jī)管理系統(tǒng)來管理高校工資已經(jīng)成為目前的趨勢,使用計(jì)算機(jī)可以高速,快捷地完成以上工作。在計(jì)算機(jī)聯(lián)網(wǎng)后,數(shù)據(jù)在網(wǎng)上傳遞,可以實(shí)現(xiàn)數(shù)據(jù)共享,避免重復(fù)勞動(dòng),規(guī)范數(shù)據(jù)管理行為,從而提高了管理效率和水平。高校工資管理系統(tǒng)便是以計(jì)算機(jī)為工具,通過對(duì)工資管理所需的信息管

72、理,不僅把管理人員從繁瑣的數(shù)據(jù)計(jì)算處理中解脫出來,而且優(yōu)化了管理體</p><p><b>  1.2編寫目的</b></p><p>  為了分析人工管理高校工資的流程,把人工模式抽象為可在計(jì)算機(jī)上處理的自動(dòng)模式,對(duì)高校工資的科學(xué)管理進(jìn)行分析與總結(jié),便于開發(fā)小組成員對(duì)系統(tǒng)整體功能的認(rèn)識(shí),通過該文檔,確定了系統(tǒng)的目的和功能,以及管理的流程和方法,同時(shí)也為使用者提供參考

73、。</p><p><b>  1.3軟件定義</b></p><p> ?。?)員工基本信息的錄入,修改,刪除。</p><p> ?。?)工資標(biāo)準(zhǔn)設(shè)定功能。具體包括職務(wù)工資,職稱工資以及其他工資標(biāo)準(zhǔn)的設(shè)定。</p><p>  (3)工資信息查詢。</p><p>  (4)員工工資表創(chuàng)建。&

74、lt;/p><p> ?。?)工資調(diào)整管理。</p><p><b> ?。?)工資統(tǒng)計(jì)。</b></p><p>  為完善系統(tǒng)管理功能,增加工資系統(tǒng)用戶管理功能,包括系統(tǒng)用戶數(shù)據(jù)的添加,修改和刪除。教職員工為系統(tǒng)普通用戶,只能運(yùn)行系統(tǒng)個(gè)人工資查詢功能;系統(tǒng)管理員則能運(yùn)行系統(tǒng)所有功能,從而有效保證系統(tǒng)數(shù)據(jù)的安全性。</p><

75、p><b>  1.4開發(fā)環(huán)境</b></p><p>  Windows7 + Visual C++6.0 + SQL Server 2005</p><p><b>  需求分析</b></p><p>  2.1 需求分析說明</p><p>  2.2.1 系統(tǒng)功能的基本要求:<

76、/p><p>  教職工各個(gè)職位和職稱所確定的基本工資的設(shè)定</p><p>  加班津貼管理,根據(jù)加班時(shí)間和類型給予不同的加班津貼;</p><p>  按照不同職位和職稱的基本工資情況、教職工的考勤情況產(chǎn)生教職工的每月的月工資;</p><p>  教職工年終獎(jiǎng)金的生成,教職工的年終獎(jiǎng)金計(jì)算公式=(教職工本年度的工資總和+津貼的總和)/12;

77、</p><p>  教職工工資報(bào)表。能夠查詢單個(gè)教職工的工資情況、每個(gè)部門的工資情況、按月的工資統(tǒng)計(jì),并能夠打??;</p><p>  2.2.2 數(shù)據(jù)庫要求:</p><p>  在數(shù)據(jù)庫中至少應(yīng)該包含下列數(shù)據(jù)表:</p><p><b>  教職工考勤情況表;</b></p><p>  教

78、職工情況表,反映教職工的職位、職稱,基本工資等信息;</p><p>  教職工津貼信息表,反映教職工的加班時(shí)間,科研貢獻(xiàn)以及其他津貼情況等;</p><p><b>  教職工基本信息表;</b></p><p><b>  教職工月工資表。</b></p><p><b>  2.2

79、數(shù)據(jù)流圖</b></p><p><b>  頂層數(shù)據(jù)流圖</b></p><p><b>  1層數(shù)據(jù)流圖</b></p><p>  2層數(shù)據(jù)流圖_1驗(yàn)證帳號(hào)</p><p>  2層數(shù)據(jù)流圖_2系統(tǒng)用戶管理</p><p>  2層數(shù)據(jù)流圖_3員工信息管理&

80、lt;/p><p>  2層數(shù)據(jù)流圖_4工資標(biāo)準(zhǔn)設(shè)立</p><p>  2層數(shù)據(jù)流圖_5工資信息管理</p><p><b>  數(shù)據(jù)庫概念結(jié)構(gòu)設(shè)計(jì)</b></p><p><b>  E—R模型圖</b></p><p><b>  關(guān)系模型</b>&l

81、t;/p><p>  3.2.1由E-R圖轉(zhuǎn)換的關(guān)系模型</p><p>  員工信息表(教職工號(hào),姓名,院系,職位,職稱,電話號(hào)碼)</p><p>  此為聯(lián)系“員工信息管理”對(duì)應(yīng)的關(guān)系模式</p><p>  工資表(教職工號(hào),姓名,基本工資,獎(jiǎng)金,津貼,扣除工資,年份,月份)</p><p>  此為聯(lián)系“工資信息

82、管理”對(duì)應(yīng)的關(guān)系模式</p><p>  工資結(jié)算方案表(方案號(hào),基本工資設(shè)置,獎(jiǎng)金設(shè)置,津貼設(shè)置,缺勤減分設(shè)置,遲到早退減分設(shè)置,請(qǐng)假減分設(shè)置,課時(shí)不足減分設(shè)置,工作完成量減分設(shè)置)</p><p>  此為工資實(shí)體對(duì)應(yīng)的關(guān)系模式,,該關(guān)系模式已包含了聯(lián)系“工資信息管理”所對(duì)應(yīng)的關(guān)系模式。</p><p>  工作情況表(教職工號(hào),月份,缺勤次數(shù),遲到早退次數(shù),請(qǐng)

83、假次數(shù),缺少課時(shí),工作完成量)</p><p>  此為考勤信息對(duì)應(yīng)的關(guān)系模式。</p><p>  用戶信息(帳號(hào),密碼)</p><p>  此為用戶實(shí)體對(duì)應(yīng)的關(guān)系模式。</p><p>  3.2.2 工資部分實(shí)體屬性圖</p><p>  3.2.3 教職工部分實(shí)體屬性圖</p><p>

84、;  3.2.4 出勤狀況實(shí)體屬性圖</p><p>  3.2.5 用戶實(shí)體屬性圖</p><p><b>  數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計(jì)</b></p><p><b>  4.1數(shù)據(jù)表關(guān)系圖</b></p><p><b>  4.2教職工信息表</b></p>&

85、lt;p><b>  4.3工資信息表</b></p><p>  4.4工資結(jié)算方案表</p><p>  4.5工作情況信息表</p><p><b>  4.6 用戶信息表</b></p><p><b>  程序結(jié)構(gòu)圖</b></p><p&g

86、t;<b>  系統(tǒng)架構(gòu)圖</b></p><p><b>  程序功能圖</b></p><p>  高校工資管理系統(tǒng)功能模塊結(jié)構(gòu)圖</p><p><b>  程序源代碼及其說明</b></p><p>  6.1 登陸界面實(shí)現(xiàn)代碼及截圖</p><p&

87、gt;<b>  6.1.1核心代碼</b></p><p>  void CLogInDlg::OnOK() </p><p><b>  {</b></p><p>  // TODO: Add extra validation here</p><p>  UpdateData(TRUE);&

88、lt;/p><p>  if(m_usrName == "")</p><p><b>  {</b></p><p>  AfxMessageBox("用戶賬號(hào)不能為空!");</p><p><b>  return;</b></p><p

89、><b>  }</b></p><p>  if(m_usrPasswd == "")</p><p><b>  {</b></p><p>  AfxMessageBox("用戶密碼不能為空!");</p><p><b>  retur

90、n;</b></p><p><b>  }</b></p><p>  CDatabase db;</p><p>  CString sql;</p><p>  db.Open(NULL,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL&quo

91、t;);</p><p>  ClogInSet* pset = new ClogInSet(&db);</p><p>  sql.Format("select * from login where ID=\'%s\' and passwd=\'%s\'",m_usrName,m_usrPasswd);</p>&

92、lt;p>  pset->Open(AFX_DB_USE_DEFAULT_TYPE,sql);</p><p>  if(m_usrName != pset->m_ID || m_usrPasswd != pset->m_passwd)</p><p><b>  {</b></p><p>  AfxMessageBo

93、x("用戶賬號(hào)或密碼錯(cuò)誤!");</p><p><b>  return;</b></p><p><b>  }</b></p><p>  CDialog::OnOK();</p><p><b>  }</b></p><p>

94、;  6.1.2 登陸界面</p><p>  6.2 工資查詢實(shí)現(xiàn)代碼及截圖</p><p>  6.2.1 核心代碼</p><p>  void CpaySearch::OnQuery() </p><p><b>  {</b></p><p>  // TODO: Add your co

95、ntrol notification handler code here</p><p>  CDatabase db;</p><p>  CString sql;</p><p>  db.Open(NULL,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL");</p><

96、;p>  Csalaryset* pset = new Csalaryset(&db);</p><p><b>  int i=0;</b></p><p>  CString str;</p><p>  CString ty,tm,td;</p><p>  m_years.GetWindowText

97、(ty);</p><p>  m_months.GetWindowText(tm);</p><p>  m_departments.GetWindowText(td);</p><p>  //str.Format("%d",m_years.GetCurSel());</p><p>  //AfxMessageB

98、ox(str);</p><p>  if(radioSel == 0)</p><p><b>  {</b></p><p>  if(m_years.GetCurSel() == 0)</p><p><b>  {</b></p><p>  if(m_months.

99、GetCurSel() == 0 && m_departments.GetCurSel() != 0)</p><p>  sql.Format("select * from searchSalary where dept=\'%s\'",td);</p><p><b>  else</b></p>

100、<p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() == 0)</p><p>  sql.Format("select * from searchSalary where month=\'%s\'",tm);</p><p><b>  el

101、se</b></p><p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() != 0)</p><p>  sql.Format("select * from searchSalary where dept=\'%s\' and month=\'%s\&#

102、39;",td,tm);</p><p><b>  else</b></p><p>  sql.Format("select * from searchSalary");</p><p><b>  }</b></p><p><b>  else<

103、/b></p><p>  //if(m_years.GetCurSel() != 0)</p><p><b>  {</b></p><p>  if(m_months.GetCurSel() == 0 && m_departments.GetCurSel() != 0)</p><p> 

104、 sql.Format("select * from searchSalary where dept=\'%s\' and year=\'%s\'",td,ty);</p><p><b>  else</b></p><p>  if(m_months.GetCurSel() != 0 && m_d

105、epartments.GetCurSel() == 0)</p><p>  sql.Format("select * from searchSalary where month=\'%s\' and year=\'%s\'",tm,ty);</p><p><b>  else</b></p><

106、;p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() != 0)</p><p>  sql.Format(</p><p>  "select * from searchSalary where year=\'%s\' and month=\'%s\'

107、and dept=\'%s\'",</p><p><b>  ty,tm,td</b></p><p><b>  );</b></p><p><b>  else</b></p><p>  sql.Format("select * f

108、rom searchSalary where year=\'%s\'",ty);</p><p><b>  }</b></p><p><b>  }</b></p><p><b>  else</b></p><p><b>  {&l

109、t;/b></p><p>  UpdateData(TRUE);</p><p>  if(m_years.GetCurSel() == 0)</p><p><b>  {</b></p><p>  if(m_months.GetCurSel() == 0 && m_departments.G

110、etCurSel() != 0)</p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and dept=\'%s\'",m_ID,td);</p><p><b>  else</b></p><p>  if(m_

111、months.GetCurSel() != 0 && m_departments.GetCurSel() == 0)</p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and month=\'%s\'",m_ID,tm);</p><p>&l

112、t;b>  else</b></p><p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() != 0)</p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and dept=\&#

113、39;%s\' and month=\'%s\'",m_ID,td,tm);</p><p><b>  else</b></p><p>  sql.Format("select * from searchSalary where ID=\'%s\'",m_ID);</p><

114、p><b>  }</b></p><p><b>  else</b></p><p>  //if(m_years.GetCurSel() != 0)</p><p><b>  {</b></p><p>  if(m_months.GetCurSel() ==

115、 0 && m_departments.GetCurSel() != 0)</p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and dept=\'%s\' and year=\'%s\'",m_ID,td,ty);</p><p&

116、gt;<b>  else</b></p><p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() == 0)</p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and mon

117、th=\'%s\' and year=\'%s\'",m_ID,tm,ty);</p><p><b>  else</b></p><p>  if(m_months.GetCurSel() != 0 && m_departments.GetCurSel() != 0)</p><p>

118、;  sql.Format(</p><p>  "select * from searchSalary where ID=\'%s\' and year=\'%s\' and month=\'%s\' and dept=\'%s\'",</p><p>  m_ID,ty,tm,td</p>

119、<p><b>  );</b></p><p><b>  else</b></p><p>  sql.Format("select * from searchSalary where ID=\'%s\' and year=\'%s\'",m_ID,ty);</p>

120、<p><b>  }</b></p><p>  UpdateData(FALSE);</p><p><b>  }</b></p><p>  //sql.Format("select * from searchSalary");</p><p>  Afx

121、MessageBox(sql);</p><p>  m_printList.DeleteAllItems();</p><p>  pset->Open(AFX_DB_USE_DEFAULT_TYPE,sql);</p><p>  if(pset->GetRecordCount() == 0)</p><p><b>

122、;  {</b></p><p>  delete pset;</p><p><b>  return;</b></p><p><b>  }</b></p><p>  while(!pset->IsEOF())</p><p><b>  

123、{</b></p><p>  str.Format("%s",pset->m_ID);</p><p>  m_printList.InsertItem(i,str);</p><p>  str.Format("%s",pset->m_name);</p><p>  m_p

124、rintList.SetItemText(i,name,str);</p><p>  str.Format("%s",pset->m_dept);</p><p>  m_printList.SetItemText(i,department,str);</p><p>  str.Format("%s",pset-&g

125、t;m_position);</p><p>  m_printList.SetItemText(i,position,str);</p><p>  str.Format("%.2f",pset->m_allowance);</p><p>  m_printList.SetItemText(i,allowance,str);</p

126、><p>  str.Format("%.2f",pset->m_salary);</p><p>  m_printList.SetItemText(i,salary,str);</p><p>  str.Format("%.2f",pset->m_reward);</p><p>  m_

127、printList.SetItemText(i,reward,str);</p><p>  str.Format("%d",pset->m_year);</p><p>  m_printList.SetItemText(i,year,str);</p><p>  str.Format("%d",pset->m

128、_month);</p><p>  m_printList.SetItemText(i,month,str);</p><p><b>  i++;</b></p><p>  pset->MoveNext();</p><p><b>  }</b></p><p>

129、;  db.Close();</p><p>  delete pset;</p><p><b>  }</b></p><p>  6.2.2 查詢界面</p><p>  6.3出勤功能實(shí)現(xiàn)代碼及截圖</p><p><b>  6.3.1核心代碼</b></p&

130、gt;<p>  void CcheckOn::OnRefresh() </p><p><b>  {</b></p><p>  // TODO: Add your control notification handler code here</p><p>  UpdateData(TRUE);</p><

131、;p>  CDatabase db;</p><p>  CString sql,str;</p><p>  db.Open(NULL,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL");</p><p>  CcheckOnSet *pset = new CcheckOnSet(&am

132、p;db);</p><p>  if(m_isAttend.GetCurSel() == 0)</p><p><b>  {</b></p><p>  sql.Format("UPDATE attend SET attendedTime=attendedTime+1 WHERE ID=\'%s\'",m

133、_number);</p><p>  if(m_addedTimes !=0)</p><p>  sql.Format("update attend set attendedTime=attendedTime+1,extraHours=extraHours+\'%.1f\' where ID=\'%s\'",m_addedTimes,

134、m_number);</p><p>  AfxMessageBox(sql);</p><p>  db.ExecuteSQL(sql);</p><p><b>  }</b></p><p>  sql.Format("select * from attend where ID=\'%s\'

135、;",m_number);</p><p>  //int count = m_list.GetItemCount();</p><p>  pset->Open(AFX_DB_USE_DEFAULT_TYPE,sql);</p><p>  /*if(pset->GetRecordCount() == 0)</p><

136、p><b>  {</b></p><p>  delete pset;</p><p><b>  return;</b></p><p><b>  }</b></p><p>  int flag=0;</p><p><b>  

137、int i=0;</b></p><p>  if(count != 0)</p><p>  for(i;i<count;i++)</p><p><b>  {</b></p><p>  CString str = m_list.GetItemText(i,id);</p><

138、p>  //AfxMessageBox(str);</p><p>  if(m_number == str)</p><p><b>  {</b></p><p><b>  flag = 1;</b></p><p><b>  }</b></p>

139、<p><b>  }*/</b></p><p>  str.Format("%s",pset->m_ID);</p><p>  m_list.InsertItem(0,str);</p><p>  str.Format("%s",pset->m_name);</p>

140、;<p>  m_list.SetItemText(0,name,str);</p><p>  str.Format("%d",pset->m_attendedTime);</p><p>  m_list.SetItemText(0,attend,str);</p><p>  str.Format("%d&qu

141、ot;,pset->m_extraHours);</p><p>  m_list.SetItemText(0,atime,str);</p><p><b>  }</b></p><p>  6.3.2 考勤情況界面</p><p>  6.4教職工基本信息添加實(shí)現(xiàn)代碼及截圖</p><p&

142、gt;<b>  6.4.1核心代碼</b></p><p>  void CWorkersInfo::OnModify() </p><p><b>  {</b></p><p>  // TODO: Add your control notification handler code here</p>

143、<p>  int count = m_wkrsInfo.GetItemCount();</p><p><b>  try</b></p><p><b>  {</b></p><p>  CDatabase db;</p><p>  CString sql;</p>

144、<p>  db.Open(NULL,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL");</p><p>  CsysSet *sset = new CsysSet(&db);</p><p>  double al = 0;</p><p>  double sal = 0

145、;</p><p>  //CcheckOnSet *cset = new CcheckOnSet(&db);</p><p>  CTime times = CTime::GetCurrentTime();</p><p>  int year=times.GetYear();</p><p>  int month=times.

146、GetMonth();</p><p>  /*sql.Format("%d",count);</p><p>  AfxMessageBox(sql);</p><p>  sql.Format("%d-%d",year,month);</p><p>  AfxMessageBox(sql);&

147、lt;/p><p><b>  */</b></p><p>  CString ID,Name,Pos,Title,Dept,Phone;</p><p>  for(int i = 0;i < count;i++)</p><p><b>  {</b></p><p&

148、gt;  ID = m_wkrsInfo.GetItemText(i,id);</p><p>  Name = m_wkrsInfo.GetItemText(i,name);</p><p>  Pos = m_wkrsInfo.GetItemText(i,position);</p><p>  Title = m_wkrsInfo.GetItemText(i,

149、title);</p><p>  Dept = m_wkrsInfo.GetItemText(i,department);</p><p>  Phone = m_wkrsInfo.GetItemText(i,phone);</p><p>  /*sql.Format("%s,%s,%s,%s,%s,%s",ID,Name,Pos,Tit

150、le,Dept,Phone);</p><p>  AfxMessageBox(sql);// Print the sql statement for check.</p><p><b>  */</b></p><p>  //-------Add to baseInfo table.-------</p><p>

151、  sql.Format("insert into baseInfo (ID,name,position,title,dept,phone) values (\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\')",</p><p>  ID,Name,Pos,Titl

152、e,Dept,Phone);</p><p>  db.ExecuteSQL(sql);</p><p>  //-------Add to attend table.-------</p><p>  sql.Format("insert into attend (ID,name,attendedTime,extraHours) values (\

153、9;%s\',\'%s\',0,0)",ID,Name);</p><p>  db.ExecuteSQL(sql);</p><p>  //-------Add to searchSalary table.-------</p><p>  /*Get position default salary from table sys

154、Set.*/</p><p>  sql.Format("select * from sysSet where position=\'%s\'",Pos);</p><p>  sset->Open(AFX_DB_USE_DEFAULT_TYPE,sql);</p><p>  sal = sset->m_salar

155、y;</p><p>  al = sset->m_pAllowance;</p><p>  sql.Format("%.2f",sal);</p><p>  /*AfxMessageBox(sql); // Print the sql statement for check.*/</p><p>  sse

156、t->Close();//Close is needed.</p><p>  sql.Format("insert into searchSalary (ID,name,dept,position,allowance,salary,reward,year,month) values (\'%s\',\'%s\',\'%s\',\'%s

157、\',\'%.2f\',\'%.2f\',0,\'%d\',\'%d\')",</p><p>  ID,Name,Dept,Pos,al,sal,year,month);</p><p>  db.ExecuteSQL(sql);</p><p><b>  }</b

158、></p><p>  db.Close();</p><p><b>  }</b></p><p>  catch(CDBException e)</p><p><b>  {</b></p><p>  CString err;</p><p

159、>  err.Format("數(shù)據(jù)庫操作錯(cuò)誤!");</p><p>  AfxMessageBox(err);</p><p><b>  }</b></p><p><b>  }</b></p><p>  6.4.2 教職工信息查詢界面</p><

160、;p>  6.5 系統(tǒng)設(shè)置實(shí)現(xiàn)代碼和截圖</p><p>  6.5.1確定修改系統(tǒng)設(shè)置實(shí)現(xiàn)代碼</p><p>  void CSystemSetting::OnConfirm() </p><p><b>  {</b></p><p>  // TODO: Add your control notificat

161、ion handler code here</p><p>  CDatabase db;</p><p>  CString sql,sql1,sql2,sql3,sql4,sql5;</p><p>  sql.Format("select * from sysSet");</p><p>  db.Open(NULL

162、,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL");</p><p>  CsysSet *pset = new CsysSet(&db);</p><p>  pset->Open(AFX_DB_USE_DEFAULT_TYPE,sql);</p><p>  m_1_1 =

163、pset->m_salary;</p><p>  m_1_2 = pset->m_aAllowance;</p><p>  m_1_3 = pset->m_pAllowance;</p><p>  m_1_4 = pset->m_tAllowance;</p><p>  pset->MoveNext();

164、</p><p>  m_2_1 = pset->m_salary;</p><p>  m_2_2 = pset->m_aAllowance;</p><p>  m_2_3 = pset->m_pAllowance;</p><p>  m_2_4 = pset->m_tAllowance;</p>

165、<p>  pset->MoveNext();</p><p>  m_3_1 = pset->m_salary;</p><p>  m_3_2 = pset->m_aAllowance;</p><p>  m_3_3 = pset->m_pAllowance;</p><p>  m_3_4 = pse

166、t->m_tAllowance;</p><p>  pset->MoveNext();</p><p>  m_4_1 = pset->m_salary;</p><p>  m_4_2 = pset->m_aAllowance;</p><p>  m_4_3 = pset->m_pAllowance;<

167、;/p><p>  m_4_4 = pset->m_tAllowance;</p><p>  pset->MoveNext();</p><p>  m_5_1 = pset->m_salary;</p><p>  m_5_2 = pset->m_aAllowance;</p><p>  m_

168、5_3 = pset->m_pAllowance;</p><p>  m_5_4 = pset->m_tAllowance;</p><p>  pset->MoveFirst();</p><p>  UpdateData(TRUE);</p><p>  sql1.Format("update sysSet

169、set salary=\'%.1f\',aAllowance=\'%.1f\',pAllowance=\'%.1f\',tAllowance=\'%.1f\' where SID=0001",</p><p>  m_1_1,m_1_2,m_1_3,m_1_4);</p><p>  sql2.Format(&quo

170、t;update sysSet set salary=\'%.1f\',aAllowance=\'%.1f\',pAllowance=\'%.1f\',tAllowance=\'%.1f\' where SID=0002",</p><p>  m_2_1,m_2_2,m_2_3,m_2_4);</p><p>  

171、sql3.Format("update sysSet set salary=\'%.1f\',aAllowance=\'%.1f\',pAllowance=\'%.1f\',tAllowance=\'%.1f\' where SID=0003",</p><p>  m_3_1,m_3_2,m_3_3,m_3_4);</p&

172、gt;<p>  sql4.Format("update sysSet set salary=\'%.1f\',aAllowance=\'%.1f\',pAllowance=\'%.1f\',tAllowance=\'%.1f\' where SID=0004",</p><p>  m_4_1,m_4_2,m_4_

173、3,m_4_4);</p><p>  sql5.Format("update sysSet set salary=\'%.1f\',aAllowance=\'%.1f\',pAllowance=\'%.1f\',tAllowance=\'%.1f\' where SID=0005",</p><p>  

174、m_5_1,m_5_2,m_5_3,m_5_4);</p><p>  db.ExecuteSQL(sql1);</p><p>  db.ExecuteSQL(sql2);</p><p>  db.ExecuteSQL(sql3);</p><p>  db.ExecuteSQL(sql4);</p><p>  

175、db.ExecuteSQL(sql5);</p><p>  db.Close();</p><p><b>  }</b></p><p>  6.5.2刪除教職工信息功能實(shí)現(xiàn)代碼</p><p>  void CSystemSetting::OnDelete() </p><p><b&

176、gt;  {</b></p><p>  // TODO: Add your control notification handler code here</p><p>  UpdateData(TRUE);</p><p>  if(m_delete=="")</p><p><b>  {<

177、;/b></p><p>  AfxMessageBox("請(qǐng)輸入教職工編號(hào)!");</p><p><b>  return;</b></p><p><b>  }</b></p><p>  Calert *dlg = new Calert();</p>

178、<p>  if(dlg->DoModal()==IDOK)</p><p><b>  {</b></p><p>  CString sql;</p><p>  CDatabase db;</p><p>  sql.Format("delete from baseInfo where

179、ID=\'%s\'",m_delete);</p><p>  db.Open(NULL,FALSE,FALSE,"ODBC;DSN=salaryDB;UID=zhang,PWD=NULL");</p><p>  db.ExecuteSQL(sql);</p><p>  db.Close();</p>

180、<p><b>  }</b></p><p><b>  }</b></p><p><b>  7.總 結(jié)</b></p><p>  此次課程設(shè)計(jì)給了我們一次很好的檢驗(yàn)自我的機(jī)會(huì),它可以說是以后畢業(yè)課程設(shè)計(jì)的一個(gè)預(yù)演。平時(shí)在談到課程設(shè)計(jì)的時(shí)候,大多只是在心里有點(diǎn)認(rèn)識(shí)而已,真正自己設(shè)計(jì)

溫馨提示

  • 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. 眾賞文庫僅提供信息存儲(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)論