Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs @ 6246

Last change on this file since 6246 was 6246, checked in by wtollsch, 13 years ago

#1433 AlgorithmClass, Algorithm, ProblemClass, Problem create/update appropriate controller/models/views, File upload (Algorithm / Problem)

File size: 2.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using System.Web.Security;
7using System.ServiceModel.Security;
8using System.Diagnostics;
9using HLWebOKBAdminPlugin.OKBAdministrationService;
10using HLWebOKBAdminPlugin.Helpers;
11using HLWebOKBAdminPlugin.Models;
12
13namespace HLWebOKBAdminPlugin.Controllers {
14    public class AdminController : Controller {
15        private AdministrationServiceClient CertificateValidator() {
16            AdministrationServiceClient asc = new AdministrationServiceClient();
17
18            asc.ClientCredentials.UserName.UserName = HttpContext.Session["Username"].ToString();
19            asc.ClientCredentials.UserName.Password = HttpContext.Session["Password"].ToString();
20            asc.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
21
22            return asc;
23        }//CertificateValidator
24
25        public ActionResult Index() {
26            return View();
27        }// ActionResult Index
28
29        public ActionResult Menu() {
30            return View();
31        }//ActionResult Men
32
33        public ActionResult AlgorithmClass() {
34            AdministrationServiceClient adminCLient = Admin.GetClientFactory();
35
36            AdminModel am = new AdminModel();
37            Session["SelectedSubMenu"] = "AlgorithmClass";
38            var algorithmClasses = am.AlgorithmClassProp;
39
40            return View(algorithmClasses);
41        }//ActionResult AlgorithmClassC:\SYS\profiles\schwgh\Desktop\WebApplication\MVC2\HLWebOKBAdminPlugin\Views\Admin\Algorithm.aspx
42
43        public ActionResult Algorithm() {
44            AdministrationServiceClient adminCLient = Admin.GetClientFactory();
45
46            AdminModel am = new AdminModel();
47            Session["SelectedSubMenu"] = "Algorithm";
48            var algorithm = am.AlgorithmsGetAll();
49
50            return View(algorithm);
51        }//Algorithm
52
53        public ActionResult ProblemClass() {
54            AdministrationServiceClient adminCLient = Admin.GetClientFactory();
55
56            AdminModel am = new AdminModel();
57            Session["SelectedSubMenu"] = "ProblemClass";
58            var problemClasses = am.ProblemClassGetAll();
59
60            return View(problemClasses);
61        }//ProblemClass
62
63        public ActionResult Problem() {
64            AdministrationServiceClient adminCLient = Admin.GetClientFactory();
65
66            AdminModel am = new AdminModel();
67            Session["SelectedSubMenu"] = "Problem";
68            var problem = am.ProblemsGetAll();
69
70            return View(problem);
71        }//Problem
72
73        public ActionResult OKBNamedItemList_Test() {
74            return View();
75        }//Problem
76
77    }
78}
Note: See TracBrowser for help on using the repository browser.