Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HeuristicLabWeb.PluginHost/HLWebPluginHost/Controllers/AlgorithmClassController.cs @ 4950

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

#1198 Added AlgorithmClassController, AlgorithmClassModel, AlgorithmClass/Index.aspx with ListBox

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using System.ServiceModel.Security;
7using HLWebPluginHost.Models;
8
9namespace HLWebPluginHost.Controllers
10{
11    public class AlgorithmClassController : Controller
12    {
13        //
14        // GET: /AlgorithmClass/
15
16        public ActionResult Index() {
17            //create list of algorithms
18            OKBService.OKBServiceClient sc = new OKBService.OKBServiceClient();
19            sc.ClientCredentials.UserName.UserName = "Gerhard";
20            sc.ClientCredentials.UserName.Password = "Gerhard";
21            sc.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
22
23            var agcList = new List<OKBService.AlgorithmClass>();
24            OKBService.AlgorithmClass[] ac = sc.GetAlgorithmClasses();
25            foreach (OKBService.AlgorithmClass a in ac) {
26                agcList.Add(a);
27            }//foreach
28
29            var viewModel = new AlgorithmClassModel {
30                NumOfClasses = agcList.Count(),
31                AlgorithmClassList = agcList
32            };
33
34            return View(viewModel);
35        }//index
36
37        //
38        // GET: /AlgorithmClass/Browse
39
40        public string Browse() {
41            string message = "AlgorithmClass.Browse, id = " + Server.HtmlEncode(Request.QueryString["id"]);
42            return Server.HtmlEncode(message);
43        }//index
44
45        //
46        // GET: /AlgorithmClass/Details/2
47
48        public string Details(int id) {
49            string message = "AlgorithmClass.Details, id = " + id;
50            return Server.HtmlEncode(message);
51        }//index
52
53    }
54}
Note: See TracBrowser for help on using the repository browser.