[it计算机]软件项目开发总结报告模版内容摘要:

final TableColumn column14=new TableColumn(table,)。 (rwNum)。 (80)。 (true)。 (true)。 freshData()。 (800,200)。 Button add=new Button(tmshell,)。 (add trains)。 (new SelectionAdapter(){ public void widgetSelected(SelectionEvent e){ new AddTrain(tm)。 } })。 Button update=new Button(tmshell,)。 (modify)。 (new SelectionAdapter(){ public void widgetSelected(SelectionEvent e){ TableItem[] selection=()。 TableItem selectedRow=selection[0]。 Train train=new Train()。 (((0)))。 ((1))。 ((2))。 ((3))。 武汉理工大学《软件开发工具》论文报告 14 ((4))。 ((5))。 ((6))。 ((7))。 (((8)))。 ((9))。 (((10)))。 (((11)))。 (((12)))。 (((13)))。 new UpdateTrain(train,tm)。 } })。 Button delete=new Button(tmshell,)。 (cancel)。 (new SelectionAdapter(){ public void widgetSelected(SelectionEvent e){ MessageBox box=new MessageBox(tmshell,|)。 (Are you sure to cancel?)。 int num=()。 if(num==128) return。 TableItem[] selection=()。 TableItem selectedRow=selection[0]。 DAO dao=new DAO()。 String sql=delete from train where id=+(0)+。 int i=(sql)。 if(i0){ (succeed)。 ()。 (())。 }else{ (failure)。 ()。 } } })。 武汉理工大学《软件开发工具》论文报告 15 (1200,400)。 (train Management)。 ()。 while(!()){ if(!()) ()。 } ()。 } public void freshData(){ ()。 try{ DAO dao=new DAO()。 List list=()。 int number=()。 for(int i=0。 i()。 i++){ Train train=(Train)(i)。 final TableItem item[]=new TableItem[number]。 item[i]=new TableItem(table,)。 item[i].setText(new String[]{(()),(),trai(),(), (),(),ime(),(),(()),trai(),(()), (()),(wNum()),(())})。 } }catch(Exception e){ ()。 } } } 在该段代码中调用了 getAllTrain()方法来获得所有的车辆信息,然后以表格的形式显示出来。 getAllTrain()和 update()方法如下: public int update(String sql){ int i=0。 con=()。 try { pt=(sql)。 i=()。 } catch (SQLException e) { 武汉理工大学《软件开发工具》论文报告 16 ()。 }finally{ (pt)。 (con)。 }return i。 } public List getAllTrain(){ List list=new ArrayList()。 con=()。 try { pt=(select * from train)。 rs=()。 while(()){ Train train=new Train()。 ((1))。 ((2))。 ((3))。 ((4))。 ((5))。 ((6))。 ((7))。 ((8))。 ((9))。 ((10))。 ((11))。 ((12))。 ((13))。 ((14))。 (train)。 } } catch (SQLException e) { ()。 }finally{ (rs)。 (pt)。 (con)。 }return list。 } 其中的 update的功能是,首先连接数据库,然后用传递过来的 SQl语句在列表中删除某辆列车的信息。 getAllTrain()方法是显示所有的列车的信息。 图示如下: 武汉理工大学《软件开发工具》论文报告 17 在车次管理中的对于列车信息添加的功能是通过 来实现的。 代码如下: import。 import .*。 import .*。 import .*。 import。 public class AddTrain { Display display=()。 Shell tmshell=new Shell(display)。 TrainManage trainmanage=null。 public AddTrain(TrainManage tm){ trainmanage=tm。 GridLayout gridlayout=new GridLayout()。 (add trains information)。 =2。 =true。 (gridlayout)。 GridData gd = new GridData()。 Label l=new Label(tmshell,)。 (trainNum)。 (gd)。 gd = new GridData()。 final Text trainNum=new Text(tmshell,)。 (50,60)。 (gd)。 gd = new GridData()。 Label l1=new Label(tmshell,)。 (trainType)。 (gd)。 gd = new GridData()。 final Text trainType=new Text(tmshell,)。 武汉理工大学《软件开发工具》论文报告 18 (30,40)。 (gd)。 gd = new GridData()。 Label l2=new Label(tmshell,)。 (starting)。 (gd)。 gd = new GridData()。 final Text starting=new Text(tmshell,)。 (30,40)。 (gd)。 gd = new GridData()。 Label l3=new Label(tmshell,)。 (startingtime)。 (gd)。 gd = new GridData()。 final Text startingTime=new Text(tmshell,)。 (30,40)。 (gd)。 Label l4=new Label(tmshell,)。 (terminal)。 (gd)。 gd = new GridData()。 final Text terminal=new Text(tmshell,)。 (30,40)。 (gd)。 gd = new GridData()。 Label l5=new Label(tmshell,)。 (terminaltime)。 (gd)。 gd = new GridData()。 final Text terminalTime=new Text(tmshell,)。 (30,40)。 (gd)。 gd = new GridData()。 Label l6=new Label(tmshell,)。 (iskongtiao)。 (gd)。 gd = new GridData()。 final Text iskongTiao=new Text(tmshell,)。 武汉理工大学《软件开发工具》论文报告 19 (30,40)。 (gd)。 gd。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。