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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
package istia.st.struts.reclamation.controle;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import istia.st.struts.modele.MachineEnCours;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import DOA.AccesBDAffectationMat;
@SuppressWarnings("serial")
public class ReclamationForm extends ActionForm{
private String nom_depart;
private String id_personnel;
private String etat;
private String degre_u;
private Date date_e ;
private Date date_p ;
private Date date_a ;
private String code_machine;
private String num_machine;
private String num_bureau;
private String description ;
private String valeurs[];
private List<MachineEnCours> listCode = new ArrayList<MachineEnCours>();
public ReclamationForm() {
super();
// TODO Auto-generated constructor stub
}
public ReclamationForm(String nom_depart, String id_personnel, String etat, String degre_u, Date date_e,
Date date_p, Date date_a, String code_machine, String num_bureau,
String description) {
super();
this.nom_depart = nom_depart;
this.id_personnel = id_personnel;
this.etat = etat;
this.degre_u = degre_u;
this.date_e = date_e;
this.date_p = date_p;
this.date_a = date_a;
this.code_machine = code_machine;
this.num_bureau = num_bureau;
this.description = description;
}
// la méthode validate()
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors erreurs = new ActionErrors();
if (nom_depart == null || nom_depart.trim().equals("")) {
erreurs.add("serv_demandeur", new ActionMessage("reclamation.formulaire.serv_demandeur.vide"));
}
if (etat== null || etat.trim().equals("")) {
erreurs.add("etat", new ActionMessage("reclamation.formulaire.etat.vide"));
}
if (degre_u== null || degre_u.trim().equals("")) {
erreurs.add("degre_u", new ActionMessage("reclamation.formulaire.degre_u.vide"));
}
if (description== null || description.trim().equals("")) {
erreurs.add("description", new ActionMessage("reclamation.formulaire.description.vide"));
}
return erreurs;
}
public String getNom_depart() {
return nom_depart;
}
public void setNom_depart(String nom_depart) {
this.nom_depart = nom_depart;
}
public String getId_personnel() {
return id_personnel;
}
public void setId_personnel(String id_personnel) {
this.id_personnel = id_personnel;
}
public String getEtat() {
return etat;
}
public void setEtat(String etat) {
this.etat = etat;
}
public String getDegre_u() {
return degre_u;
}
public void setDegre_u(String degre_u) {
this.degre_u = degre_u;
}
public Date getDate_e() {
return date_e;
}
public void setDate_e(Date date_e) {
this.date_e = date_e;
}
public Date getDate_p() {
return date_p;
}
public void setDate_p(Date date_p) {
this.date_p = date_p;
}
public Date getDate_a() {
return date_a;
}
public void setDate_a(Date date_a) {
this.date_a = date_a;
}
public String getCode_machine() {
return code_machine;
}
public void setCode_machine(String code_machine) {
this.code_machine = code_machine;
}
public String getNum_bureau() {
return num_bureau;
}
public void setNum_bureau(String num_bureau) {
this.num_bureau = num_bureau;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String[] getValeurs() {
return valeurs;
}
public void setValeurs(String[] valeurs) {
this.valeurs = valeurs;
}
public List<MachineEnCours> getListCode() {
AccesBDAffectationMat accesmat = new AccesBDAffectationMat();
listCode= accesmat.listmachines();
return listCode;
}
public void setListCode(List<MachineEnCours> listCode) {
this.listCode = listCode;
}
public String getNum_machine() {
return num_machine;
}
public void setNum_machine(String num_machine) {
this.num_machine = num_machine;
}
} |
Partager