1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using HLWebOKBAdminPlugin.OKBAdministrationService;
|
---|
6 | using HLWebOKBAdminPlugin.Helpers;
|
---|
7 |
|
---|
8 | namespace HLWebOKBAdminPlugin.Models {
|
---|
9 | public class AdminModel {
|
---|
10 | //member var
|
---|
11 | private IList<AlgorithmClass> algorithmClassList;
|
---|
12 |
|
---|
13 | public String SelectedSubMenu { get; set; }
|
---|
14 | public IList<AlgorithmClass> AlgorithmClassProp { get { return algorithmClassList; } set { ;} }
|
---|
15 |
|
---|
16 | //get all algorithm classes
|
---|
17 | public IList<AlgorithmClass> AlgorithmClassGetAll() {
|
---|
18 | AdministrationServiceClient adminClient = Admin.GetClientFactory();
|
---|
19 |
|
---|
20 | algorithmClassList = new List<AlgorithmClass>();
|
---|
21 |
|
---|
22 | if (adminClient != null) {
|
---|
23 | AlgorithmClass[] algorithmClasses = adminClient.GetAlgorithmClasses();
|
---|
24 | foreach (AlgorithmClass ac in algorithmClasses) {
|
---|
25 | algorithmClassList.Add(ac);
|
---|
26 |
|
---|
27 | }
|
---|
28 | }//if (adminClient != null)
|
---|
29 |
|
---|
30 | return algorithmClassList;
|
---|
31 | }//AlgorithmClassGetAll
|
---|
32 |
|
---|
33 | //get all algorithms
|
---|
34 | public IList<Algorithm> AlgorithmsGetAll() {
|
---|
35 | AdministrationServiceClient adminClient = Admin.GetClientFactory();
|
---|
36 |
|
---|
37 | IList<Algorithm> algorithmList = new List<Algorithm>();
|
---|
38 |
|
---|
39 | if (adminClient != null) {
|
---|
40 | Algorithm[] algorithm = adminClient.GetAlgorithms();
|
---|
41 | foreach (Algorithm al in algorithm) {
|
---|
42 | algorithmList.Add(al);
|
---|
43 |
|
---|
44 | }
|
---|
45 | }//if (adminClient != null)
|
---|
46 |
|
---|
47 | return algorithmList;
|
---|
48 | }//AlgorithmsGetAll
|
---|
49 |
|
---|
50 | public IList<ProblemClass> ProblemClassGetAll() {
|
---|
51 | AdministrationServiceClient adminClient = Admin.GetClientFactory();
|
---|
52 |
|
---|
53 | IList<ProblemClass> problemClassList = new List<ProblemClass>();
|
---|
54 |
|
---|
55 | if (adminClient != null) {
|
---|
56 | ProblemClass[] problemClasses = adminClient.GetProblemClasses();
|
---|
57 | foreach (ProblemClass pc in problemClasses) {
|
---|
58 | problemClassList.Add(pc);
|
---|
59 | }
|
---|
60 | }//if (adminClient != null)
|
---|
61 |
|
---|
62 | return problemClassList;
|
---|
63 | }//ProblemClassGetAll
|
---|
64 |
|
---|
65 | public IList<Problem> ProblemsGetAll() {
|
---|
66 | AdministrationServiceClient adminClient = Admin.GetClientFactory();
|
---|
67 |
|
---|
68 | IList<Problem> problemList = new List<Problem>();
|
---|
69 |
|
---|
70 | if (adminClient != null) {
|
---|
71 | Problem[] problem = adminClient.GetProblems();
|
---|
72 | foreach (Problem pr in problem) {
|
---|
73 | problemList.Add(pr);
|
---|
74 |
|
---|
75 | }
|
---|
76 | }//if (adminClient != null)
|
---|
77 |
|
---|
78 | return problemList;
|
---|
79 | }//ProblemsGetAll
|
---|
80 | }
|
---|
81 | } |
---|