Changeset 6218 for branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models
- Timestamp:
- 05/17/11 11:34:35 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AdminModel.cs
r6161 r6218 15 15 public IList<AlgorithmClass> AlgorithmClassProp { get { return AlgorithmClassGetAll(); } set { ;} } 16 16 17 17 18 18 //***************************************Algorithm Class******************************************** 19 19 //get all algorithm classes … … 23 23 algorithmClassList = new List<AlgorithmClass>(); 24 24 25 if 25 if(adminClient != null) { 26 26 AlgorithmClass[] algorithmClasses = adminClient.GetAlgorithmClasses(); 27 foreach 27 foreach(AlgorithmClass ac in algorithmClasses) { 28 28 algorithmClassList.Add(ac); 29 29 … … 37 37 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 38 38 39 if 39 if(adminClient != null) { 40 40 return adminClient.AddAlgorithmClass(algorithmClass); 41 41 } … … 47 47 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 48 48 49 if (adminClient != null){49 if(adminClient != null) { 50 50 adminClient.DeleteAlgorithmClass(id); 51 51 } … … 55 55 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 56 56 57 if 58 if 57 if(adminClient != null) { 58 if(algorithmClass.Id == 0) { 59 59 return AddAlgorithmClass(algorithmClass); 60 } 61 else { 60 } else { 62 61 AlgorithmClass ac = adminClient.GetAlgorithmClass(algorithmClass.Id); 63 62 64 if 63 if(ac != null) { 65 64 adminClient.UpdateAlgorithmClass(algorithmClass); 66 65 return algorithmClass.Id; … … 79 78 IList<Algorithm> algorithmList = new List<Algorithm>(); 80 79 81 if 80 if(adminClient != null) { 82 81 Algorithm[] algorithm = adminClient.GetAlgorithms(); 83 foreach 82 foreach(Algorithm al in algorithm) { 84 83 algorithmList.Add(al); 85 84 … … 93 92 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 94 93 95 if 94 if(adminClient != null) { 96 95 return adminClient.AddAlgorithm(algorithm); 97 96 } … … 103 102 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 104 103 105 if 104 if(adminClient != null) { 106 105 adminClient.DeleteAlgorithm(id); 107 106 } … … 111 110 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 112 111 113 if 114 if 112 if(adminClient != null) { 113 if(algorithm.Id == 0) { 115 114 return AddAlgorithm(algorithm); 116 } 117 else { 115 } else { 118 116 Algorithm al = adminClient.GetAlgorithm(algorithm.Id); 119 117 120 if 118 if(al != null) { 121 119 adminClient.UpdateAlgorithm(algorithm); 122 120 return algorithm.Id; … … 134 132 IList<ProblemClass> problemClassList = new List<ProblemClass>(); 135 133 136 if 134 if(adminClient != null) { 137 135 ProblemClass[] problemClasses = adminClient.GetProblemClasses(); 138 foreach 136 foreach(ProblemClass pc in problemClasses) { 139 137 problemClassList.Add(pc); 140 138 } … … 147 145 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 148 146 149 if 147 if(adminClient != null) { 150 148 return adminClient.AddProblemClass(problemClass); 151 149 } … … 157 155 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 158 156 159 if 157 if(adminClient != null) { 160 158 adminClient.DeleteProblemClass(id); 161 159 } … … 165 163 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 166 164 167 if 168 if 165 if(adminClient != null) { 166 if(problemClass.Id == 0) { 169 167 return AddProblemClass(problemClass); 170 } 171 else { 168 } else { 172 169 ProblemClass pc = adminClient.GetProblemClass(problemClass.Id); 173 170 174 if 171 if(pc != null) { 175 172 adminClient.UpdateProblemClass(problemClass); 176 173 return problemClass.Id; … … 188 185 IList<Problem> problemList = new List<Problem>(); 189 186 190 if 187 if(adminClient != null) { 191 188 Problem[] problem = adminClient.GetProblems(); 192 foreach 189 foreach(Problem pr in problem) { 193 190 problemList.Add(pr); 194 191 … … 202 199 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 203 200 204 if 201 if(adminClient != null) { 205 202 return adminClient.AddProblem(problem); 206 203 } … … 212 209 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 213 210 214 if 211 if(adminClient != null) { 215 212 adminClient.DeleteProblem(id); 216 213 } … … 220 217 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 221 218 222 if 223 if 219 if(adminClient != null) { 220 if(problem.Id == 0) { 224 221 return AddProblem(problem); 225 } 226 else { 222 } else { 227 223 Problem pr = adminClient.GetProblem(problem.Id); 228 224 229 if 225 if(pr != null) { 230 226 adminClient.UpdateProblem(problem); 231 227 return problem.Id; 232 228 } 233 } 229 } 234 230 } 235 231
Note: See TracChangeset
for help on using the changeset viewer.