版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、精品數據庫原理與設計大作業(yè)源代碼(1) 用戶登錄界面運行超市管理信息系統后,首先進入用戶登錄界面,用戶輸入用戶名和密碼后,系統進行驗證,驗證通過進入程序的主界面。在進行系統登錄過程中,登錄模塊將調用數據庫里的用戶信息表,并對用戶名和密碼進行驗證,只有輸入了正確的賬號和密碼后,系統登錄才會成功。在登錄模塊中,對系統的嘗試登錄次數進行了限制,禁止用戶無終止的進行系統登錄嘗試,在本系統中,當用戶對系統的三次登錄失敗后,系統將自動機制登錄,突出登錄模塊。并在輸入了錯誤的或者是不存在的賬戶和密碼時,系統會給出出錯信息提示,指明登錄過程中的錯誤輸入或者錯誤操作,以便用戶進行正確的登錄。登錄界面如圖5-2所
2、示。 圖5-2 登錄界面主要實現代碼如下:/登錄 private void radBtnOk_Click(object sender, EventArgs e) try if (radTxtBoxUser.Text.Trim() = ) this.radLbInfo.Text = 請輸入您的用戶名!; else if (radTxtBoxPsw.Text.Trim() = ) this.radLbInfo.Text = 請輸入您的密碼!; else commandUnit com = new commandUnit(); string str = select * from UserInfo
3、where loginNo = + radTxtBoxUser.Text.ToString() + ; DataTable table = com.GetDataSet(str); if (table.Rows.Count 0) _currentUser = radTxtBoxUser.Text; _currentPsw = radTxtBoxPsw.Text; IsLogin = true; this.Close(); else this.radLbInfo.Text = 密碼錯誤!; radTxtBoxPsw.Text = ; catch (System.Exception ex) thr
4、ow ex; (2) 主界面系統登錄成功后,進入主界面菜單。主界面如圖5-3所示。圖5-3 主界面(3) 修改密碼界面成功登錄系統后,單擊“用戶信息管理”菜單的“修改密碼”,可以進入“修改密碼”界面,進行密碼的修改。修改密碼界面如圖5-4所示。圖5-4 修改密碼界面主要實現代碼如下:/修改密碼protected virtual void radBtnOk_Click(object sender, EventArgs e) if (radTxtBoxOldPsw.Text = null | radTxtBoxOldPsw.Text.Trim() = ) MessageBox.Show(請輸入舊密
5、碼!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); return; if (radTxtBoxNewPsw.Text = null | radTxtBoxNewPsw.Text.Trim() = | radTxtBoxEnterPsw.Text = null | radTxtBoxEnterPsw.Text.Trim() = ) MessageBox.Show(請輸入新密碼!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); return; string curr
6、Pwd = RFrmLogin.CurrentPsw; if (currPwd = radTxtBoxOldPsw.Text.Trim() if (isSame() commandUnit com = new commandUnit(); string str = update UserInfo set passWord = + radTxtBoxEnterPsw.Text.ToString() + where loginNo = + RFrmLogin.CurrentUser + ; if (com.ExecuteCommand(str) 0) MessageBox.Show(密碼修改成功!
7、。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(密碼修改失敗,請聯系管理員!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(兩次密碼輸入不一致!, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(輸入密碼錯誤!, 提醒, MessageBoxButtons.OK, Messa
8、geBoxIcon.Information); (4) 修改密碼界面管理員成功登錄系統后,單擊“用戶信息管理”菜單的“修改權限”,可以進入“修改權限”界面,進行員工權限的修改。修改權限界面如圖5-5所示。 圖5-5 修改權限界面主要實現代碼如下:/修改權限protected override void radBtnOk_Click(object sender, EventArgs e) if (radTxtBoxOldPsw.Text = null | radTxtBoxOldPsw.Text.Trim() = ) MessageBox.Show(請輸入用戶名!。, 提醒, MessageBo
9、xButtons.OK, MessageBoxIcon.Information); return; if (radComBoxPower.Text = null | radComBoxPower.Text.Trim() = ) MessageBox.Show(請為用戶設置權限!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); return; commandUnit com = new commandUnit(); string str = update UserInfo set power = + radComBoxPower.
10、SelectedValue.ToString() + where loginNo = + radTxtBoxOldPsw.Text.ToString() + ; if (com.ExecuteCommand(str) 0) MessageBox.Show(權限修改成功!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(權限修改失敗,請聯系管理員!。, 提醒, MessageBoxButtons.OK, MessageBoxIcon.Information); (5) 編輯員工信息界面管理
11、員成功登錄系統后,單擊“基本信息管理”菜單的“員工信息”,可以進入“查看員工信息”界面和“編輯員工信息”界面,“查看員工信息”界面只能查看員工信息,“編輯員工信息”界面進行員工信息的修改、添加、刪除等功能。編輯員工信息界面如圖5-6所示。圖5-6 編輯員工信息界面主要實現代碼如下:/保存 protected virtual void tSBtnSave_Click(object sender, EventArgs e) try if (IsVilude() bool isSuccess = false; commandUnit com = new commandUnit(); Employee
12、Model emp; for (int j = 0; j radWithGV.RowCount; j+) emp = new EmployeeModel(); #region 同步數據 if (radWithGV.Rowsj.Tag != null) emp = radWithGV.Rowsj.Tag as EmployeeModel; else emp.EmployeeNo = radWithGV.Rowsj.CellsemployeeNo.Value.ToString(); emp.Name = radWithGV.Rowsj.Cellsname.Value.ToString(); emp
13、.Sex = radWithGV.Rowsj.Cellssex.Value.ToString(); emp.IdCard = radWithGV.Rowsj.CellsidCard.Value.ToString(); emp.Duty = radWithGV.Rowsj.Cellsduty.Value.ToString(); emp.Note = radWithGV.Rowsj.Cellsnote.Value.ToString(); emp.IsNew = true; #endregion if (emp.IsNew) string str = select * from EmployeeIn
14、fo where employeeNo = + emp.EmployeeNo + ; DataTable dtable = com.GetDataSet(str); if (dtable.Rows.Count 0) _isSaved = true; isSuccess = true; emp.IsNew = false; radWithGV.Rowsj.Tag = emp; else MessageBox.Show(該員工已存在,請審核信息!); else if (emp.IsModified) string strSql = update EmployeeInfo set name = +
15、emp.Name + ,sex = + emp.Sex + ,idCard = + emp.IdCard + ,duty = + emp.Duty + ,note = + emp.Note + where employeeNo = + emp.EmployeeNo + ; if (com.ExecuteCommand(strSql) 0) _isSaved = true; isSuccess = true; emp.IsModified = false; radWithGV.Rowsj.Tag = emp; else continue; if (isSuccess) MessageBox.Sh
16、ow(保存成功!); else MessageBox.Show(數據非法!); catch (System.Exception ex) throw ex; (6) 職務信息界面管理員成功登錄系統后,單擊“基本信息管理”菜單的“職務信息”,可以進入“職務信息”界面 ,“職務信息”界面進行職務信息的修改、添加、刪除等功能。職務信息界面如圖5-7所示。圖5-7 職務信息界面主要實現代碼如下: protected override void tSBtnDelete_Click(object sender, EventArgs e) DutyModel employee = this.radWithGV.CurrentRow.Tag as DutyModel; if (employee != null) if (!employee.IsNew) commandUnit com = new commandUnit(); string numRow = radWithGV.CurrentRow.CellsdutyId.Value.ToString(); string str = delete
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 紙尿褲的舒適度技術發(fā)展
- 斷指再植術后患者的自我管理教育
- 護理管理:時間管理與效率提升
- 易貨公司培訓
- 2026年綠源環(huán)保餐具科技公司新技術研發(fā)管理制度
- 互聯網思維 新互聯時代的覺醒案例
- 六勝肽培訓課件
- 中東呼吸綜合征冠狀病毒-Middle-East-Respiratory
- 一年數學下冊認識人民幣微課2
- 六一大型活動培訓課件
- 吉林省梅河口市五中2025-2026學年高二上學期期末語文試卷及答案
- 2026年張家界航空工業(yè)職業(yè)技術學院單招職業(yè)傾向性考試模擬測試卷新版
- 2026遼寧機場管理集團校招面筆試題及答案
- 2026年共青團中央所屬單位高校畢業(yè)生公開招聘66人備考題庫及參考答案詳解
- 2025徽銀金融租賃有限公司社會招聘筆試歷年典型考題及考點剖析附帶答案詳解
- 2026年遼寧軌道交通職業(yè)學院單招綜合素質筆試備考題庫帶答案解析
- 2026年6級英語模擬真題及答案
- 2025內蒙古鄂爾多斯市委政法委所屬事業(yè)單位引進高層次人才3人考試題庫含答案解析(奪冠)
- 2025年全國單獨招生考試綜合試卷(附答案) 完整版2025
- 2025-2026學年外研版八年級上冊英語期末模擬考試題(含答案)
- 高密度聚乙烯(HDPE)排水管(八角雙密封)
評論
0/150
提交評論