etudiants:2014:bertrand:scrumtool3

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
etudiants:2014:bertrand:scrumtool3 [2014/05/28 11:17] – [3 - Contrôleurs] jordietudiants:2014:bertrand:scrumtool3 [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1
Ligne 63: Ligne 63:
 </sxh> </sxh>
  
 +=== 3.2 Ccollaborators - Edit Collaborator ===
 +
 +{{ :etudiants:2014:bertrand:scrumtool_veditcollaborator.jpg |}}
 +
 +<sxh php;title:Ccollaborators/edit collaborator>
 +view.getBtnCollaborators().addSelectionListener(new SelectionListener() {
 +
 + @Override
 + public void widgetSelected(SelectionEvent arg0) {
 + if (view.getBtnCollaborators().getText() == "Add this collaborator") {
 +                 // Code add collaborator
 +                } else {
 + if (view.getTxtFirstnameCollaborators().getText() == "" || view.getTxtLastNameCollaborators().getText() == "" || view.getTxtEmailCollaborators().getText() == "" || view.getTxtPasswordCollaborators().getText() == "") {
 + Utils.MsgBox(view.getShell(), "Please, complete all fiels", "information");
 + } else {
 + Boolean email = false;
 + java.util.List<Collaborator> verifEmail = DAO.getCollaborators();
 + for (Collaborator emailV : verifEmail) {
 + if (view.getTxtEmailCollaborators().getText().equals(emailV.getEmail())) {
 + if (emailV.getEmail().equals(collaboratorActif.getEmail())) {
 + email = false;
 + } else {
 + email = true;
 + }
 + }
 + }
 +
 + if (email == true) {
 + Utils.MsgBox(view.getShell(), "Email already exist", "information");
 + } else {
 + if (!view.getTxtPasswordCollaborators().getText().equals(view.getTxtConfirmPasswordCollaborators().getText())) {
 + if (view.getTxtConfirmPasswordCollaborators().getText() == "") {
 + if (view.getTxtPasswordCollaborators().getText().equals(collaboratorActif.getPassword())) {
 + if(view.getCheckButtonCollaborator().getSelection()){
 + admin=true;
 + }else{
 + admin=false;
 + }
 + collaboratorActif.setAdministrator(admin);
 + collaboratorActif.setFirstname(view.getTxtFirstnameCollaborators().getText());
 + collaboratorActif.setLastname(view.getTxtLastNameCollaborators().getText());
 + collaboratorActif.setEmail(view.getTxtEmailCollaborators().getText());
 + collaboratorActif.setPassword(view.getTxtPasswordCollaborators().getText());
 + DAO.SQLCollaborator(collaboratorActif, "update");
 + view.getTableViewerCollaborators().refresh();
 + Utils.MsgBox(view.getShell(), "Collaborator is update", "information");
 + } else {
 + Utils.MsgBox(view.getShell(), "This is not your current password. \nPlease confirm your password.", "information");
 + }
 + } else {
 + Utils.MsgBox(view.getShell(), "Passwords are not the same", "information");
 + }
 + } else {
 + if(view.getCheckButtonCollaborator().getSelection()){
 + admin=true;
 + }else{
 + admin=false;
 + }
 + collaboratorActif.setAdministrator(admin);
 + collaboratorActif.setFirstname(view.getTxtFirstnameCollaborators().getText());
 + collaboratorActif.setLastname(view.getTxtLastNameCollaborators().getText());
 + collaboratorActif.setEmail(view.getTxtEmailCollaborators().getText());
 + collaboratorActif.setPassword(view.getTxtPasswordCollaborators().getText());
 + DAO.SQLCollaborator(collaboratorActif, "update");
 + view.getTableViewerCollaborators().refresh();
 + Utils.MsgBox(view.getShell(), "Collaborator is update", "information");
 + }
 + }
 + }
 + }
 + }
 +});
 +</sxh>
 +
 +=== 3.3 Ccollaborator - Delete Collaborator ===
 +
 +<sxh php;title:Ccollaborators/edit collaborator>
 +view.getTltmDelCollaborator().addSelectionListener(new SelectionListener() {
 +
 + @Override
 + public void widgetSelected(SelectionEvent arg0) {
 +
 + MessageBox messageBoxCollaborator = new MessageBox(view.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
 + messageBoxCollaborator.setText("SCRUMTOOL");
 + messageBoxCollaborator.setMessage("Do you really want to delete this collaborator ?");
 + int responseCollaborator = messageBoxCollaborator.open();
 + if (responseCollaborator == SWT.YES) {
 + DAO.SQLCollaborator(collaboratorActif, "delete");
 + view.getTableViewerCollaborators().remove(collaboratorActif);
 + view.getGrpCollaborators().setVisible(false);
 + }
 +
 + }
 +});
 +</sxh>
  • etudiants/2014/bertrand/scrumtool3.1401268641.txt.gz
  • Dernière modification : il y a 6 ans
  • (modification externe)