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 | {
|
---|
10 | public class ProblemModel
|
---|
11 | {
|
---|
12 | /// <summary>
|
---|
13 | /// Get all Problems.
|
---|
14 | /// </summary>
|
---|
15 | public List<Problem> Problems
|
---|
16 | {
|
---|
17 | get
|
---|
18 | {
|
---|
19 | AdministrationServiceClient adminClient = Admin.GetClientFactory("okbtester", "okbtester");
|
---|
20 | IList<Problem> problemList = new List<Problem>();
|
---|
21 | Problem[] problems = adminClient.GetProblems();
|
---|
22 | return problems.ToList<Problem>();
|
---|
23 | }
|
---|
24 | }
|
---|
25 |
|
---|
26 | public List<ProblemClass> ProblemClasses {
|
---|
27 | get {
|
---|
28 | AdministrationServiceClient adminClient = Admin.GetClientFactory("okbtester", "okbtester");
|
---|
29 | IList<ProblemClass> problemClassList = new List<ProblemClass>();
|
---|
30 | ProblemClass[] problemClass = adminClient.GetProblemClasses();
|
---|
31 | return problemClass.ToList<ProblemClass>();
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | public List<Platform> Plattforms {
|
---|
36 | get {
|
---|
37 | AdministrationServiceClient adminClient = Admin.GetClientFactory("okbtester", "okbtester");
|
---|
38 | IList<Platform> plattformList = new List<Platform>();
|
---|
39 | Platform[] plattforms = adminClient.GetPlatforms();
|
---|
40 | return plattforms.ToList<Platform>();
|
---|
41 | }
|
---|
42 | }
|
---|
43 |
|
---|
44 | /// <summary>
|
---|
45 | /// Curretn Problem (for Detail)
|
---|
46 | /// </summary>
|
---|
47 | public Problem Problem { get; set; }
|
---|
48 |
|
---|
49 | public void SaveProblem(Problem problem) {
|
---|
50 | AdministrationServiceClient adminClient = Admin.GetClientFactory("okbtester", "okbtester");
|
---|
51 | adminClient.UpdateProblem(problem);
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void CreateProblem(Problem problem) {
|
---|
55 | AdministrationServiceClient adminClient = Admin.GetClientFactory("okbtester", "okbtester");
|
---|
56 | adminClient.AddProblem(problem);
|
---|
57 | }
|
---|
58 |
|
---|
59 | }
|
---|
60 | } |
---|