Changeset 6213 for branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models
- Timestamp:
- 05/17/11 11:16:41 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmModel.cs ¶
r6161 r6213 6 6 using HLWebOKBAdminPlugin.Helpers; 7 7 8 namespace HLWebOKBAdminPlugin.Models { 8 namespace HLWebOKBAdminPlugin.Models 9 { 9 10 public class AlgorithmModel { 10 11 11 12 public String SelectedSubMenu { get; set; } 12 public IList<Algorithm> Algorithms { get { return AlgorithmsGetAll(); } } 13 public IList<Algorithm> Algorithms { get { return AlgorithmGetAll(); } set { ;} } 14 public IList<AlgorithmClass> AlgorithmClasses { get { return AlgorithmClassGetAll(); } } 15 public IList<Platform> Platforms { get { return PlatformsGetAll(); } } 13 16 14 17 public Algorithm Algorithm { get; set; } … … 18 21 }//AlgorithmModel 19 22 20 //***************************************Algorithms************************************************* 23 //***************************************Algorithms*************************************************** 21 24 private IList<Platform> PlatformsGetAll() { 22 25 AdministrationServiceClient adminClient = Admin.GetClientFactory(); … … 32 35 33 36 return platformList; 34 }// ProblemClassGetAll37 }//AlgorithmClassGetAll 35 38 36 private IList< ProblemClass> ProblemClassGetAll() {39 private IList<AlgorithmClass> AlgorithmClassGetAll() { 37 40 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 38 41 39 IList< ProblemClass> problemClassList = new List<ProblemClass>();42 IList<AlgorithmClass> algorithmClassList = new List<AlgorithmClass>(); 40 43 41 44 if (adminClient != null) { 42 ProblemClass[] problemClasses = adminClient.GetProblemClasses();43 foreach (ProblemClass pc in problemClasses) {44 problemClassList.Add(pc);45 AlgorithmClass[] algorithmClasses = adminClient.GetAlgorithmClasses(); 46 foreach(AlgorithmClass ac in algorithmClasses) { 47 algorithmClassList.Add(ac); 45 48 } 46 49 }//if (adminClient != null) 47 50 48 return problemClassList;49 }// ProblemClassGetAll51 return algorithmClassList; 52 }//AlgorithmClassGetAll 50 53 51 //get all algorithms 52 private IList<Algorithm> AlgorithmsGetAll() { 54 private IList<Algorithm> AlgorithmGetAll() { 53 55 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 54 56 … … 57 59 if (adminClient != null) { 58 60 Algorithm[] algorithm = adminClient.GetAlgorithms(); 59 foreach (Algorithm alin algorithm) {60 algorithmList.Add(al );61 foreach(Algorithm alg in algorithm) { 62 algorithmList.Add(alg); 61 63 62 64 } … … 64 66 65 67 return algorithmList; 66 }//Algorithm sGetAll68 }//AlgorithmGetAll 67 69 68 70 private long AddAlgorithm(Algorithm algorithm) { … … 92 94 } 93 95 else { 94 Algorithm al = adminClient.GetAlgorithm(algorithm.Id);96 Algorithm alg = adminClient.GetAlgorithm(algorithm.Id); 95 97 96 if (al != null) {98 if (alg != null) { 97 99 adminClient.UpdateAlgorithm(algorithm); 98 100 return algorithm.Id; … … 103 105 return 0; 104 106 }//SaveAlgorithm 105 106 107 } 107 108 } -
TabularUnified branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemModel.cs ¶
r6160 r6213 11 11 12 12 public String SelectedSubMenu { get; set; } 13 public IList<Problem> Problems { get { return ProblemsGetAll(); } set { ;} } 13 public IList<Problem> Problems { 14 get { return ProblemsGetAll(); } 15 set { ;} 16 } 14 17 public IList<ProblemClass> ProblemClasses { get { return ProblemClassGetAll(); } } 15 18 public IList<Platform> Platforms { get { return PlatformsGetAll(); } }
Note: See TracChangeset
for help on using the changeset viewer.