Rev 1310 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1310 | Rev 1315 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | { |
25 | { |
26 | public List<String> warnings = new ArrayList<String>(); |
26 | public List<String> warnings = new ArrayList<String>(); |
27 | public 1.5.0/docs/api/java/lang/String.html">String messageResult = ""; |
27 | public 1.5.0/docs/api/java/lang/String.html">String messageResult = ""; |
28 | boolean canDelete = false; |
28 | boolean canDelete = false; |
29 | public CourseUnitView cuv; |
29 | public CourseUnitView cuv; |
- | 30 | boolean deleted = false; |
|
30 | 31 | ||
31 | public List<String> getWarnings() { |
32 | public List<String> getWarnings() { |
32 | return warnings; |
33 | return warnings; |
33 | } |
34 | } |
34 | 35 | ||
Line 182... | Line 183... | ||
182 | DaoFactory.getCourseUnitSummaryDaoImpl().delete(a); |
183 | DaoFactory.getCourseUnitSummaryDaoImpl().delete(a); |
183 | } |
184 | } |
184 | 185 | ||
185 | } |
186 | } |
186 | DaoFactory.getCourseUnitDaoImpl().delete(cu); |
187 | DaoFactory.getCourseUnitDaoImpl().delete(cu); |
- | 188 | result.deleted = true; |
|
187 | result.messageResult = "Unidade Apagada"; |
189 | result.messageResult = "Unidade Apagada"; |
188 | } |
190 | } |
189 | 191 | ||
190 | return result; |
192 | return result; |
191 | } |
193 | } |
Line 203... | Line 205... | ||
203 | CourseUnitContentsInfo cuInfo = checkDelete(id,session); |
205 | CourseUnitContentsInfo cuInfo = checkDelete(id,session); |
204 | courseUnitContentsInfos.add(cuInfo); |
206 | courseUnitContentsInfos.add(cuInfo); |
205 | } |
207 | } |
206 | return courseUnitContentsInfos; |
208 | return courseUnitContentsInfos; |
207 | } |
209 | } |
- | 210 | ||
- | 211 | ||
- | 212 | public 1.5.0/docs/api/java/lang/Integer.html">Integer deleteCandidatesNoWarn(1.5.0/docs/api/java/lang/String.html">String importYear,UserSession session) |
|
- | 213 | { |
|
- | 214 | int count = 0; |
|
- | 215 | List<CourseUnitContentsInfo> courseUnitContentsInfos = loadDeleteCandidates(importYear,session); |
|
- | 216 | for(CourseUnitContentsInfo info: courseUnitContentsInfos) |
|
- | 217 | { |
|
- | 218 | if(info.isCanDelete() && info.getWarnings().size() == 0) |
|
- | 219 | { |
|
- | 220 | CourseUnitContentsInfo result = tryDelete(info.getCuv().getId(),session); |
|
- | 221 | if(result.deleted) |
|
- | 222 | count++; |
|
- | 223 | } |
|
- | 224 | } |
|
- | 225 | return count; |
|
- | 226 | } |
|
- | 227 | ||
- | 228 | public 1.5.0/docs/api/java/lang/Integer.html">Integer deleteCandidatesAll(1.5.0/docs/api/java/lang/String.html">String importYear,UserSession session) |
|
- | 229 | { |
|
- | 230 | int count = 0; |
|
- | 231 | List<CourseUnitContentsInfo> courseUnitContentsInfos = loadDeleteCandidates(importYear,session); |
|
- | 232 | ||
- | 233 | for(CourseUnitContentsInfo info: courseUnitContentsInfos) |
|
- | 234 | { |
|
- | 235 | if(info.isCanDelete()) |
|
- | 236 | { |
|
- | 237 | CourseUnitContentsInfo result = tryDelete(info.getCuv().getId(),session); |
|
- | 238 | if(result.deleted) |
|
- | 239 | count++; |
|
- | 240 | } |
|
- | 241 | } |
|
- | 242 | return count; |
|
- | 243 | } |
|
- | 244 | ||
- | 245 | ||
208 | } |
246 | } |