1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using System.Web.Mvc;
|
---|
6 | using System.Diagnostics;
|
---|
7 | using System.ServiceModel.Security;
|
---|
8 | using System.Web.Security;
|
---|
9 |
|
---|
10 | namespace HLWebPluginHost.Controllers
|
---|
11 | {
|
---|
12 | public class ServicePrototypeController : Controller
|
---|
13 | {
|
---|
14 |
|
---|
15 | //
|
---|
16 | // GET: /ServicePrototype/
|
---|
17 |
|
---|
18 | public ActionResult Index()
|
---|
19 | {
|
---|
20 |
|
---|
21 | OKBService.OKBServiceClient sc = new OKBService.OKBServiceClient();
|
---|
22 | //sc.ClientCredentials.UserName.UserName = Membership.GetUser().UserName;
|
---|
23 | //sc.ClientCredentials.UserName.Password = Membership.GetUser().GetPassword();
|
---|
24 | sc.ClientCredentials.UserName.UserName = "Gerhard";
|
---|
25 | sc.ClientCredentials.UserName.Password = "Gerhard";
|
---|
26 | sc.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
|
---|
27 |
|
---|
28 | //read algorithm class entries
|
---|
29 | Debug.WriteLine("algorithm class entries");
|
---|
30 | OKBService.AlgorithmClass[] ac = sc.GetAlgorithmClasses();
|
---|
31 | foreach (OKBService.AlgorithmClass i in ac) {
|
---|
32 | Debug.WriteLine(i.Name);
|
---|
33 | }
|
---|
34 |
|
---|
35 |
|
---|
36 | //read problem class entries
|
---|
37 | Debug.WriteLine("problem class entries");
|
---|
38 | OKBService.ProblemClass[] pc = sc.GetProblemClasses();
|
---|
39 | foreach (OKBService.ProblemClass i in pc) {
|
---|
40 | Debug.WriteLine(i.Name);
|
---|
41 | }
|
---|
42 | sc.Close();
|
---|
43 | return View();
|
---|
44 | }
|
---|
45 |
|
---|
46 | //
|
---|
47 | // GET: /ServicePrototype/Details/5
|
---|
48 |
|
---|
49 | public ActionResult Details(int id)
|
---|
50 | {
|
---|
51 | return View();
|
---|
52 | }
|
---|
53 |
|
---|
54 | //
|
---|
55 | // GET: /ServicePrototype/Create
|
---|
56 |
|
---|
57 | public ActionResult Create()
|
---|
58 | {
|
---|
59 | return View();
|
---|
60 | }
|
---|
61 |
|
---|
62 | //
|
---|
63 | // POST: /ServicePrototype/Create
|
---|
64 |
|
---|
65 | [HttpPost]
|
---|
66 | public ActionResult Create(FormCollection collection)
|
---|
67 | {
|
---|
68 | try
|
---|
69 | {
|
---|
70 | // TODO: Add insert logic here
|
---|
71 |
|
---|
72 | return RedirectToAction("Index");
|
---|
73 | }
|
---|
74 | catch
|
---|
75 | {
|
---|
76 | return View();
|
---|
77 | }
|
---|
78 | }
|
---|
79 |
|
---|
80 | //
|
---|
81 | // GET: /ServicePrototype/Edit/5
|
---|
82 |
|
---|
83 | public ActionResult Edit(int id)
|
---|
84 | {
|
---|
85 | return View();
|
---|
86 | }
|
---|
87 |
|
---|
88 | //
|
---|
89 | // POST: /ServicePrototype/Edit/5
|
---|
90 |
|
---|
91 | [HttpPost]
|
---|
92 | public ActionResult Edit(int id, FormCollection collection)
|
---|
93 | {
|
---|
94 | try
|
---|
95 | {
|
---|
96 | // TODO: Add update logic here
|
---|
97 |
|
---|
98 | return RedirectToAction("Index");
|
---|
99 | }
|
---|
100 | catch
|
---|
101 | {
|
---|
102 | return View();
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | //
|
---|
107 | // GET: /ServicePrototype/Delete/5
|
---|
108 |
|
---|
109 | public ActionResult Delete(int id)
|
---|
110 | {
|
---|
111 | return View();
|
---|
112 | }
|
---|
113 |
|
---|
114 | //
|
---|
115 | // POST: /ServicePrototype/Delete/5
|
---|
116 |
|
---|
117 | [HttpPost]
|
---|
118 | public ActionResult Delete(int id, FormCollection collection)
|
---|
119 | {
|
---|
120 | try
|
---|
121 | {
|
---|
122 | // TODO: Add delete logic here
|
---|
123 |
|
---|
124 | return RedirectToAction("Index");
|
---|
125 | }
|
---|
126 | catch
|
---|
127 | {
|
---|
128 | return View();
|
---|
129 | }
|
---|
130 | }
|
---|
131 | }
|
---|
132 | }
|
---|