員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)模板_第1頁(yè)
員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)模板_第2頁(yè)
員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)模板_第3頁(yè)
員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)模板_第4頁(yè)
員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)模板_第5頁(yè)
已閱讀5頁(yè),還剩51頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

員工出勤管理系統(tǒng)java圖形化界面設(shè)計(jì)資料內(nèi)容僅供參考,如有不當(dāng)或者侵權(quán),請(qǐng)聯(lián)系本人改正或者刪除。目錄設(shè)計(jì)目的………………2功能介紹………………2程序流程………………2設(shè)計(jì)步驟………………3設(shè)計(jì)總結(jié)………………7程序清單………………7一、設(shè)計(jì)目的經(jīng)過課程設(shè)計(jì),使自己提高理論聯(lián)系實(shí)際解決實(shí)際問題的能力;也使自己對(duì)基于面向?qū)ο蟮睦碚撨M(jìn)行系統(tǒng)設(shè)計(jì)過程中的諸多具體問題有感性的認(rèn)識(shí)和深入的理解;進(jìn)而提高自己的學(xué)習(xí)興趣為其將來(lái)順利進(jìn)入畢業(yè)環(huán)節(jié)作必要的準(zhǔn)備。按照教師給出的思路和計(jì)劃進(jìn)度安排獨(dú)立完成課程設(shè)計(jì)二、功能介紹1、具有新用戶注冊(cè)功能。2、具有注冊(cè)用戶登錄功能。3、具有員工信息的錄入功能。4、具有員工出勤信息的錄入功能。5、具有數(shù)據(jù)查詢功能,能夠?qū)崿F(xiàn)查詢?nèi)啃畔⒑桶礂l件執(zhí)行查詢。6、具有按條件刪除數(shù)據(jù)功能。7、具有統(tǒng)計(jì)功能8、.本程序采用RCP技術(shù),和SQL數(shù)據(jù)庫(kù)。三.程序流程四、設(shè)計(jì)步驟(一)程序設(shè)計(jì)步驟1.建立RCP工程并構(gòu)建數(shù)據(jù)庫(kù)2.建立RCP工程需要的view和editor3.構(gòu)建基本框架,并主要修改Perspective和WorkbenchWindowAdvisor兩個(gè)文件4.構(gòu)建需要的輔助文件5.測(cè)試(二)圖片說(shuō)明:1.登錄窗口和注冊(cè)窗口2.菜單部分3.功能實(shí)現(xiàn)模塊查詢所有人的出勤情況修改出勤情況增加新的員工信息刪除不用的信息管理員密碼修改(三)數(shù)據(jù)庫(kù)設(shè)計(jì)員工出勤表管理員表五、設(shè)計(jì)總結(jié)經(jīng)過將近一周的課程設(shè)計(jì),對(duì)java有了更深一層次的認(rèn)識(shí),感覺java很強(qiáng)大。雖然系統(tǒng)的基本功能都已實(shí)現(xiàn),但還是存在系統(tǒng)不穩(wěn)定等多個(gè)問題尚待解決。這個(gè)系統(tǒng)主要是我自己開發(fā)的,但也得到了老師和同學(xué)的很大幫助。我正在做系統(tǒng)的過程中遇到了很多問題,有的是知識(shí)存儲(chǔ)不足,有的是考慮不夠周全,之因此能夠順利實(shí)現(xiàn)基本功功能,離不開老師和同學(xué)的大力相助。事實(shí)證明,只靠自己是不能順利完成一套功能完整的系統(tǒng)的,必須充分利用團(tuán)隊(duì)的力量。開發(fā)一套系統(tǒng),最重要的是細(xì)心,并不是一定要做到面面俱到,但也要充分考慮到客戶的需求和現(xiàn)實(shí)意義,不論什么系統(tǒng),只用運(yùn)用到實(shí)際應(yīng)用中,才具有先現(xiàn)實(shí)意義。因此在準(zhǔn)備工作中要正確分析社會(huì)需求了解現(xiàn)實(shí)應(yīng)用,畫出流程圖,把大致框架做好,然后再逐一細(xì)化。我們不可能做到面面俱到,但一定要做到步步扎實(shí),作為一個(gè)程序編程人員,要保持清醒的頭腦,以現(xiàn)實(shí)為依據(jù),讓自己的每一行代碼都能實(shí)現(xiàn)自己的意義。經(jīng)過這次課程設(shè)計(jì),我收獲的不但僅是課程上的知識(shí)得到實(shí)際應(yīng)用,還有編程的基本習(xí)慣和開發(fā)系統(tǒng)時(shí)應(yīng)注意的流程。雖然課程設(shè)計(jì)結(jié)束了,可是java的學(xué)習(xí)卻沒有結(jié)束,以后更加努力的。六.部分主要程序清單1.RCP中需要修改的ApplicationWorkbenchAdvisor文件importorg.eclipse.swt.SWT;importorg.eclipse.swt.widgets.Display;importorg.eclipse.ui.application.IWorkbenchWindowConfigurer;importorg.eclipse.ui.application.WorkbenchAdvisor;importorg.eclipse.ui.application.WorkbenchWindowAdvisor;importviews.Loginshell;publicclassApplicationWorkbenchAdvisorextendsWorkbenchAdvisor{ privatestaticfinalStringPERSPECTIVE_ID="rsgl.perspective"; publicstaticbooleantag=false;publicWorkbenchWindowAdvisorcreateWorkbenchWindowAdvisor(IWorkbenchWindowConfigurerconfigurer){try{ Displaydisplay=Display.getDefault(); Loginshellshell=newLoginshell(display,SWT.SHELL_TRIM); shell.open(); shell.layout(); while(!shell.isDisposed()){ if(!display.readAndDispatch()) display.sleep(); } }catch(Exceptione){ e.printStackTrace(); } if(tag){ returnnewApplicationWorkbenchWindowAdvisor(configurer); }else{ returnnull; }} publicStringgetInitialWindowPerspectiveId(){ returnPERSPECTIVE_ID; }}2.RCP中需要修改的Perspective文件importorg.eclipse.ui.IPageLayout;importorg.eclipse.ui.IPerspectiveFactory;importviews.Menus;importviews.MyInfo;publicclassPerspectiveimplementsIPerspectiveFactory{ publicvoidcreateInitialLayout(IPageLayoutlayout){ layout.addView(Menus.ID,IPageLayout.LEFT,0.45f,layout.getEditorArea()); layout.addView(MyInfo.ID,IPageLayout.BOTTOM,0.6f,Menus.ID); }}3.功能部分程序3.1用戶注冊(cè)publicclassLoginShellextendsShell{ privateTexttext_2; privateTexttext_1; privateTexttext; publicstaticvoidmain(Stringargs[]){ try{ Displaydisplay=Display.getDefault(); LoginShellshell=newLoginShell(display,SWT.SHELL_TRIM); shell.open(); shell.layout(); while(!shell.isDisposed()){ if(!display.readAndDispatch()) display.sleep(); } }catch(Exceptione){ e.printStackTrace(); } } publicLoginShell(Displaydisplay,intstyle){ super(display,style); createContents(); setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); setBackground(SWTResourceManager.getColor(255,255,255)); setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); setBackgroundMode(SWT.INHERIT_DEFAULT); setText("用戶登陸"); } protectedvoidcreateContents(){ setSize(507,400); finalLabellabel=newLabel(this,SWT.NONE); label.setBackground(SWTResourceManager.getColor(255,255,255)); label.setText("登錄名:"); label.setBounds(148,195,47,17); text=newText(this,SWT.BORDER); text.setBounds(220,192,116,20); finalLabellabel1=newLabel(this,SWT.NONE); label1.setBackground(SWTResourceManager.getColor(255,255,255)); label1.setText("密碼:"); label1.setBounds(148,235,39,17); text_1=newText(this,SWT.BORDER|SWT.PASSWORD); finalLabellabel4=newLabel(this,SWT.NONE); text_1.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ label4.setBackground(SWTResourceManager.getColor(255,255,255)); if(text.getText().trim()!=""){ label4.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG")); }else{ label4.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG")); } label4.setBounds(342,195,23,17); } }); text_1.setBounds(220,232,116,20); finalLabellabel2=newLabel(this,SWT.NONE); label2.setBackground(SWTResourceManager.getColor(255,255,255)); label2.setText("驗(yàn)證碼:"); label2.setBounds(148,274,47,17); text_2=newText(this,SWT.BORDER); finalLabellabel3=newLabel(this,SWT.NONE); label3.setForeground(SWTResourceManager.getColor(255,0,0)); label3.setFont(SWTResourceManager.getFont("@方正舒體",18,SWT.BOLD,true,false)); finalLabellabel4_1=newLabel(this,SWT.NONE); text_2.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ String[]a2={"0","1","2","3","4","5","6","7","8", "9","a","b","c","d","e","f","g","h","i","j", "k","l","m","n","o","p","q","r","s","t","u", "v","w","x","y","z"}; Randomr=newRandom(); Stringresult=""; while(result.length()<4){ inttemp=r.nextInt(36); result=result+a2[temp]; } label3.setText(result); System.out.println(label3.getText()); label4_1.setBackground(SWTResourceManager.getColor(255,255,255));//獲取label的背景色 if(text_1.getText().trim()!=""){ label4_1.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG")); }else{ label4_1.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG")); } label4_1.setBounds(342,235,23,17); label3.setBackground(SWTResourceManager.getColor(255,255,255)); label3.setBounds(386,271,72,27); } }); text_2.setBounds(220,271,116,20); finalButtonbutton=newButton(this,SWT.NONE); finalLabellabel4_2=newLabel(this,SWT.NONE); button.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ System.out.println(text_2.getText()); if(text_1.getText().trim()!=""&&text_2.getText().equals(label3.getText())){ label4_2.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4.PNG")); }else{ label4_2.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/3.PNG")); } label4_2.setBounds(342,274,23,17); label4_2.setText(""); Stringname=text.getText(); Stringpassword=text_1.getText(); Stringsql="select*fromuserswherename='"+name+"'"; DBHelperdb=newDBHelper(); ResultSetrs=db.query(sql); try{ if(rs.next()){ StringpasswordQ=rs.getString("password"); if(passwordQ.equals(password)&&text_2.getText().equals(label3.getText())){ ApplicationWorkbenchAdvisor.tag=true; Property.NAME=rs.getString("name"); Property.PASSWORD=rs.getString("password"); Property.ID=rs.getString("uid"); MessageDialog.openInformation(LoginShell.this,"登錄成功","登錄成功"); LoginShell.this.dispose(); }else{ MessageDialog.openError(LoginShell.this,"登錄失敗","登錄失敗,密碼或者驗(yàn)證碼錯(cuò)誤!"); } }else{ MessageDialog.openError(LoginShell.this,"登錄失敗","登錄失敗,不存在該用戶!"); } }catch(SQLExceptione1){ e1.printStackTrace(); } db.close(); } }); button.setBackground(SWTResourceManager.getColor(255,255,255)); button.setText("登陸"); button.setBounds(272,325,64,27);} @Override protectedvoidcheckSubclass(){ //DisablethecheckthatpreventssubclassingofSWTcomponents }}3.2用戶注冊(cè)publicclassZhuceextendsEditorPart{ publicstaticfinalStringID="editors.Zhuce";//$NON-NLS-1$ privateTexttext2; privateTexttext1; privateTexttext3; protectedstaticfinalShellShell=null; @Override publicvoidcreatePartControl(Compositeparent){ Compositecontainer=newComposite(parent,SWT.NONE); container.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); container.setBackground(SWTResourceManager.getColor(255,255,255)); finalLabellabel=newLabel(container,SWT.WRAP); label.setBackground(SWTResourceManager.getColor(255,255,255)); label.setText("姓名:"); label.setBounds(350,150,64,17);finalLabellabel2=newLabel(container,SWT.NONE);label2.setBackground(SWTResourceManager.getColor(255,255,255)); label2.setText("密碼:"); label2.setBounds(350,190,50,17); finalLabellabel3=newLabel(container,SWT.NONE); label3.setBackground(SWTResourceManager.getColor(255,255,255)); label3.setText("確認(rèn)密碼:"); label3.setBounds(350,230,50,17); text1=newText(container,SWT.BORDER); text1.setBounds(450,150,155,23); text2=newText(container,SWT.BORDER); text2.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text1.getText().trim()==""){ MessageDialog.openError(Shell,"提示!","姓名不能為空!"); } } }); text2.setBounds(450,190,155,23); text3=newText(container,SWT.BORDER); text3.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text2.getText().trim()==""){ MessageDialog.openWarning(Shell,"提示!","密碼不能為空!"); } } }); text3.setBounds(450,230,155,23); finalButtonbutton_2=newButton(container,SWT.NONE); button_2.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/emoticon_evilgrin.png")); button_2.addMouseMoveListener(newMouseMoveListener(){ publicvoidmouseMove(finalMouseEventarg0){ if(text3.getText().trim()==""){ MessageDialog.openWarning(Shell,"警告!","確認(rèn)不能為空!"); }elseif(!text3.getText().trim().equals(text2.getText().trim())){ MessageDialog.openWarning(Shell,"警告!","兩次密碼不同!"); } } }); button_2.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ DBHelperdb=newDBHelper(); Stringsql="insertintousers(name,password)"+ "values('"+text1.getText()+"','"+text2.getText()+"')"; System.out.println(sql); intm=db.update(sql); if(m>0){ MessageDialog.openInformation(Shell,"恭喜你","注冊(cè)成功"); }else{ MessageDialog.openError(Shell,"很遺憾","注冊(cè)失敗!"); } db.close(); } }); button_2.setBackground(SWTResourceManager.getColor(255,255,255)); button_2.setText("提交"); button_2.setBounds(501,279,104,23); } publicvoidinit(IEditorSitesite,IEditorInputinput) throwsPartInitException{ setSite(site);setInput(input); } @Override publicbooleanisDirty(){ returnfalse; } @Override publicbooleanisSaveAsAllowed(){ returnfalse; }}3.3增加信息publicclassAddzgextendsEditorPart{ publicstaticfinalStringID="editors.Addzg";//$NON-NLS-1$ privateTexttext2; privateTexttext1; privateTexttext3; protectedstaticfinalShellShell=null; publicvoidcreatePartControl(Compositeparent){ System.currentTimeMillis(); Compositecontainer=newComposite(parent,SWT.NONE); container.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); container.setBackground(SWTResourceManager.getColor(255,255,255)); finalLabellabel=newLabel(container,SWT.WRAP); label.setBackground(SWTResourceManager.getColor(255,255,255)); label.setText("姓名:"); label.setBounds(350,153,64,17); finalLabellabel1=newLabel(container,SWT.WRAP); label1.setBackground(SWTResourceManager.getColor(255,255,255)); label1.setText("性別:"); label1.setBounds(350,190,64,17); finalLabellabel2=newLabel(container,SWT.NONE); label2.setBackground(SWTResourceManager.getColor(255,255,255)); label2.setText("部門:"); label2.setBounds(350,230,50,17); finalLabellabel3=newLabel(container,SWT.NONE); label3.setBackground(SWTResourceManager.getColor(255,255,255)); label3.setText("手機(jī):"); label3.setBounds(350,270,50,17); text1=newText(container,SWT.BORDER); text1.setBounds(450,150,155,23); finalButtonbutton=newButton(container,SWT.RADIO); button.setBackground(SWTResourceManager.getColor(255,255,255)); button.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text1.getText().trim()==""){ MessageDialog.openError(Shell,"提示!","姓名不能為空!"); } } }); button.setText("男"); button.setBounds(450,190,33,17); finalButtonbutton_1=newButton(container,SWT.RADIO); button_1.setBackground(SWTResourceManager.getColor(255,255,255)); button_1.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text1.getText().trim()==""){ MessageDialog.openWarning(Shell,"提示!","姓名不能為空!"); } } }); button_1.setBounds(572,190,33,17); button_1.setText("女"); text2=newText(container,SWT.BORDER); text2.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(!(button.getSelection())&&!(button_1.getSelection())){ MessageDialog.openWarning(Shell,"提示!","請(qǐng)選擇性別!"); } } }); text2.setBounds(450,227,155,23); text3=newText(container,SWT.BORDER); text3.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text2.getText().trim()==""){ MessageDialog.openWarning(Shell,"提示!","部門信息不能為空!"); } } }); text3.setBounds(450,267,155,23); finalButtonbutton_2=newButton(container,SWT.NONE); button_2.addMouseMoveListener(newMouseMoveListener(){ publicvoidmouseMove(finalMouseEventarg0){ if(text3.getText().trim()==""){ MessageDialog.openWarning(Shell,"警告!","手機(jī)號(hào)不能為空!"); } } }); button_2.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ Stringsex1=""; if(button.getSelection()){ sex1=button.getText(); }elseif(button_1.getSelection()){ sex1=button_1.getText(); } intchushi=0; DBHelperdb=newDBHelper(); Stringsql="insertintoatten(name,sex,bumen,phone,absence,bleave,nbleave,travel,late)"+ "values('"+text1.getText()+"','"+sex1+"','"+text2.getText()+"','"+text3.getText()+"',"+chushi+","+chushi+","+chushi+","+chushi+","+chushi+")"; System.out.println(sql); intm=db.update(sql); if(m>0){ MessageDialog.openInformation(Shell,"恭喜你","注冊(cè)成功"); }else{ MessageDialog.openError(Shell,"很遺憾","注冊(cè)失敗!"); } db.close(); } }); button_2.setBackground(SWTResourceManager.getColor(255,255,255)); button_2.setText("提交"); button_2.setBounds(501,300,104,23); } publicvoidinit(IEditorSitesite,IEditorInputinput) throwsPartInitException{ setSite(site);setInput(input); } publicbooleanisDirty(){ returnfalse; } publicbooleanisSaveAsAllowed(){ returnfalse; }}3.5刪除信息publicclassDelzgextendsEditorPart{ publicstaticfinalStringID="editors.Delzg";//$NON-NLS-1$ privateTexttext_1; privateTexttext; protectedstaticfinalShellShell=null; publicvoidcreatePartControl(Compositeparent){ System.currentTimeMillis(); Compositecontainer=newComposite(parent,SWT.NONE); container.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); container.setBackground(SWTResourceManager.getColor(255,255,255)); finalTabletable=newTable(container,SWT.BORDER); table.setLinesVisible(true); table.setHeaderVisible(true); table.setBounds(252,223,640,115); finalTableColumnnewColumnTableColumn_6=newTableColumn(table,SWT.NONE); newColumnTableColumn_6.setWidth(74); newColumnTableColumn_6.setText("職工編號(hào)"); finalTableColumnnewColumnTableColumn=newTableColumn(table,SWT.NONE); newColumnTableColumn.setAlignment(SWT.CENTER); newColumnTableColumn.setWidth(86); newColumnTableColumn.setText("職工姓名"); finalTableColumnnewColumnTableColumn_1=newTableColumn(table,SWT.NONE); newColumnTableColumn_1.setAlignment(SWT.CENTER); newColumnTableColumn_1.setWidth(79); newColumnTableColumn_1.setText("所在部門"); finalTableColumnnewColumnTableColumn_2=newTableColumn(table,SWT.NONE); newColumnTableColumn_2.setAlignment(SWT.CENTER); newColumnTableColumn_2.setWidth(110); newColumnTableColumn_2.setText("性別"); finalTableColumnnewColumnTableColumn_8=newTableColumn(table,SWT.NONE); newColumnTableColumn_8.setWidth(100); newColumnTableColumn_8.setText("缺勤次數(shù)"); finalTableColumnnewColumnTableColumn_3=newTableColumn(table,SWT.NONE); newColumnTableColumn_3.setAlignment(SWT.CENTER); newColumnTableColumn_3.setWidth(106); newColumnTableColumn_3.setText("請(qǐng)假次數(shù)"); finalTableColumnnewColumnTableColumn_9=newTableColumn(table,SWT.NONE); newColumnTableColumn_9.setAlignment(SWT.CENTER); newColumnTableColumn_9.setWidth(106); newColumnTableColumn_9.setText("未請(qǐng)假次數(shù)"); finalTableColumnnewColumnTableColumn_4=newTableColumn(table,SWT.NONE); newColumnTableColumn_4.setAlignment(SWT.CENTER); newColumnTableColumn_4.setWidth(82); newColumnTableColumn_4.setText("出差次數(shù)"); finalTableColumnnewColumnTableColumn_5=newTableColumn(table,SWT.NONE); newColumnTableColumn_5.setAlignment(SWT.CENTER); newColumnTableColumn_5.setWidth(82); newColumnTableColumn_5.setText("遲到次數(shù)"); finalTableColumnnewColumnTableColumn_7=newTableColumn(table,SWT.NONE); newColumnTableColumn_7.setAlignment(SWT.CENTER); newColumnTableColumn_7.setWidth(82); newColumnTableColumn_7.setText("聯(lián)系方式"); text=newText(container,SWT.BORDER); text.setBounds(681,191,135,27); finalButtonbutton=newButton(container,SWT.NONE); button.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ table.removeAll(); Stringname=text.getText(); Stringsql="select*fromattenwherename='"+name+"'"; DBHelperdb=newDBHelper(); ResultSetrs=db.query(sql); intm=0; try{ while(rs.next()){ TableItemtableitem=newTableItem(table,SWT.NONE); tableitem.setText(newString[]{rs.getString("id"),rs.getString("name"),rs.getString("bumen"),rs.getString("sex"), rs.getString("absence"),rs.getString("bleave"),rs.getString("nbleave"),rs.getString("travel"),rs.getString("travel"),rs.getString("late"),rs.getString("phone")}); m++; } if(m==0){ MessageDialog.openError(Shell,"提示!","沒有你要找的信息!"); } }catch(SQLExceptione1){ e1.printStackTrace(); } db.close(); } }); button.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/search.ico")); button.setText("查找"); button.setBounds(832,189,60,27); finalLabellabel_1=newLabel(container,SWT.NONE); label_1.setText("姓名:"); label_1.setBounds(616,194,31,17); text_1=newText(container,SWT.BORDER); text_1.setBounds(484,393,108,25); finalLabellabel_2=newLabel(container,SWT.NONE); label_2.setBackground(SWTResourceManager.getColor(255,255,255)); label_2.setAlignment(SWT.CENTER); label_2.setText("選擇職工編號(hào)并注銷"); label_2.setBounds(498,350,204,17); finalButtonbutton_1=newButton(container,SWT.NONE); button_1.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/43.png")); button_1.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ Stringsign=text_1.getText(); Stringsql="deletestaffwheresid="+sign; DBHelperdb=newDBHelper(); intm=db.update(sql); db.close(); if(m!=0){ MessageDialog.openInformation(Shell,"恭喜你","注銷成功"); }else{ MessageDialog.openError(Shell,"很遺憾","注銷失敗!"); } table.removeAll(); text.setText(""); text_1.setText(""); Stringsql2="select*fromatten";DBHelperdb2=newDBHelper(); ResultSetrs2=db2.query(sql2); try{ while(rs2.next()){ TableItemtableitem=newTableItem(table,SWT.NONE); tableitem.setText(newString[]{rs2.getString("id"),rs2.getString("name"),rs2.getString("bumen"),rs2.getString("sex"), rs2.getString("absence"),rs2.getString("bleave"),rs2.getString("nbleave"),rs2.getString("travel"),rs2.getString("travel"),rs2.getString("late"),rs2.getString("phone")}); } }catch(SQLExceptione1){ e1.printStackTrace(); } db2.close(); } }); button_1.setText("注銷"); button_1.setBounds(638,391,74,27); } publicvoidsetFocus(){ //Setthefocus } publicvoiddoSave(IProgressMonitormonitor){ //DotheSaveoperation } publicvoiddoSaveAs(){ //DotheSaveAsoperation } publicvoidinit(IEditorSitesite,IEditorInputinput) throwsPartInitException{ setSite(site);setInput(input); } publicbooleanisDirty(){ returnfalse; } @Override publicbooleanisSaveAsAllowed(){ returnfalse; }}3.6修改出勤情況publicvoidcreatePartControl(Compositeparent){ System.currentTimeMillis(); Compositecontainer=newComposite(parent,SWT.NONE); container.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/4ddfc6b8b82a188.jpg")); container.setBackground(SWTResourceManager.getColor(255,255,255)); finalTabletable=newTable(container,SWT.BORDER); table.setLinesVisible(true); table.setHeaderVisible(true); table.setBounds(208,205,677,164); finalTableColumnnewColumnTableColumn_6=newTableColumn(table,SWT.NONE); newColumnTableColumn_6.setWidth(74); newColumnTableColumn_6.setText("職工編號(hào)"); finalTableColumnnewColumnTableColumn=newTableColumn(table,SWT.NONE); newColumnTableColumn.setAlignment(SWT.CENTER); newColumnTableColumn.setWidth(86); newColumnTableColumn.setText("職工姓名"); finalTableColumnnewColumnTableColumn_1=newTableColumn(table,SWT.NONE); newColumnTableColumn_1.setAlignment(SWT.CENTER); newColumnTableColumn_1.setWidth(79); newColumnTableColumn_1.setText("所在部門"); finalTableColumnnewColumnTableColumn_2=newTableColumn(table,SWT.NONE); newColumnTableColumn_2.setAlignment(SWT.CENTER); newColumnTableColumn_2.setWidth(110); newColumnTableColumn_2.setText("性別"); finalTableColumnnewColumnTableColumn_8=newTableColumn(table,SWT.NONE); newColumnTableColumn_8.setWidth(100); newColumnTableColumn_8.setText("缺勤次數(shù)"); finalTableColumnnewColumnTableColumn_3=newTableColumn(table,SWT.NONE); newColumnTableColumn_3.setAlignment(SWT.CENTER); newColumnTableColumn_3.setWidth(106); newColumnTableColumn_3.setText("請(qǐng)假次數(shù)"); finalTableColumnnewColumnTableColumn_9=newTableColumn(table,SWT.NONE); newColumnTableColumn_9.setAlignment(SWT.CENTER); newColumnTableColumn_9.setWidth(106); newColumnTableColumn_9.setText("未請(qǐng)假次數(shù)");finalTableColumnnewColumnTableColumn_4=newTableColumn(table,SWT.NONE); newColumnTableColumn_4.setAlignment(SWT.CENTER); newColumnTableColumn_4.setWidth(118); newColumnTableColumn_4.setText("出差次數(shù)"); finalTableColumnnewColumnTableColumn_5=newTableColumn(table,SWT.NONE); newColumnTableColumn_5.setAlignment(SWT.CENTER); newColumnTableColumn_5.setWidth(82); newColumnTableColumn_5.setText("遲到次數(shù)"); finalTableColumnnewColumnTableColumn_7=newTableColumn(table,SWT.NONE); newColumnTableColumn_7.setAlignment(SWT.CENTER); newColumnTableColumn_7.setWidth(82); newColumnTableColumn_7.setText("聯(lián)系方式"); text=newText(container,SWT.BORDER); text.setBounds(666,173,135,27);finalButtonbutton=newButton(container,SWT.NONE); button.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ table.removeAll(); Stringname=text.getText(); Stringsql="select*fromattenwherename='"+name+"'"; DBHelperdb=newDBHelper(); ResultSetrs=db.query(sql); intm=0; try{ while(rs.next()){ TableItemtableitem=newTableItem(table,SWT.NONE); tableitem.setText(newString[]{rs.getString("id"),rs.getString("name"),rs.getString("bumen"),rs.getString("sex"), rs.getString("absence"),rs.getString("bleave"),rs.getString("nbleave"),rs.getString("travel"),rs.getString("late"),rs.getString("phone")}); m++; } if(m==0){ MessageDialog.openError(Shell,"提示!","沒有你要找的信息!"); } }catch(SQLExceptione1){ e1.printStackTrace(); } db.close(); } }); button.setImage(ResourceManager.getPluginImage(Activator.getDefault(),"image/search.ico")); button.setText("查找"); button.setBounds(825,171,60,27); finalLabellabel_1=newLabel(container,SWT.NONE); label_1.setBackground(SWTResourceManager.getColor(255,255,255)); label_1.setText("姓名:"); label_1.setBounds(611,176,31,17); text1=newText(container,SWT.BORDER); text1.setBounds(310,387,188,25); finalLabellabel_2=newLabel(container,SWT.NONE); label_2.setBackground(SWTResourceManager.getColor(255,255,255)); label_2.setText("選擇編號(hào):"); label_2.setBounds(207,390,60,17); text2=newText(container,SWT.BORDER); text2.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text1.getText().trim().equals("")){ MessageDialog.openError(Shell,"提示!","請(qǐng)?zhí)顚慽d號(hào)!"); } } }); text2.setBounds(310,443,188,25); finalLabellabel_3=newLabel(container,SWT.NONE); label_3.setBackground(SWTResourceManager.getColor(255,255,255)); label_3.setText("選擇表名:"); label_3.setBounds(208,446,62,17); text3=newText(container,SWT.BORDER); text3.addMouseListener(newMouseAdapter(){ publicvoidmouseDown(finalMouseEvente){ if(text2.getText().trim().equals("職工編號(hào)")||text2.getText().trim().equals("職工姓名")||text2.getText().trim().equals("所在部門")||text2.getText().trim().equals("性別")||text2.getText().trim().equals("缺勤次數(shù)")){ MessageDialog.openError(Shell,"提示!",text2.getText()+"不能修改"); text2.setText(""); } elseif(text2.getText().trim().equals("")){ MessageDialog.openError(Shell,"提示!","請(qǐng)選擇表名!"); } elseif(!text2.getText().equals("職工編號(hào)")&&!text2.getText().equals("職工姓名")&&!text2.getText().equals("所在部門") &&!text2.getText().equals("性別")&&!text2.getText().equals("缺勤次數(shù)")&&!text2.getText().equals("請(qǐng)假次數(shù)") &&!text2.getText().equals("出差次數(shù)")&&!text2.getText().equals("未請(qǐng)假次數(shù)")&&!text2.getText().equals("聯(lián)系方式")&&!text2.getText().equals("遲到次數(shù)")){ MessageDialog.openError(Shell,"錯(cuò)誤!",text2.getText()+"不是表名!"); text2.setText(""); } } }); text3.setBounds(310,493,188,25); finalLabellabel_4=newLabel(container,SWT.NONE); label_4.setBackground(SWTResourceManager.getColor(255,255,255)); label_4.setText("修改值:"); label_4.setBounds(208,496,51,17); finalButtonbutton_1=newButton(container,SWT.NONE); button_1.addSelectionListener(newSelect

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論