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