Ceci est une ancienne révision du document !
Scrumtool : Gestion de projet de type SCRUM
Gestion des projets
1- Fonctionnalités
2- Vues
3- Contrôleurs
3.1 Cproducts - Add Product
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
view.getBtnProducts().addSelectionListener( new SelectionListener() { @Override public void widgetSelected(SelectionEvent arg0) { if (view.getBtnProducts(). getText () == "Add this project" ) { if (view.getTxtNameProject(). getText ().equals( "" ) || view.getTxtDescriptionProduct(). getText ().equals( "" )) { Utils.MsgBox(view.getShell(), "Please complete all fields" , "information" ); } else { boolean nomUtilise = false; for (Product product : DAO.getProducts()) { if (product.getName().equals(view.getTxtNameProject(). getText ())) { nomUtilise = true; } } if (nomUtilise == true) { Utils.MsgBox(view.getShell(), "A project already has this name" , "information" ); } else { Product product = new Product(view.getTxtNameProject(). getText (), view.getTxtDescriptionProduct(). getText (), null, null, null); DAO.SQLProduct(product, "insert" ); view.getTableViewerProducts().add(product); Utils.MsgBox(view.getShell(), "Project is create" , "information" ); } } } else { // Code update product } } @Override public void widgetDefaultSelected(SelectionEvent arg0) { // TODO Auto-generated method stub } }); |