[4985] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Web;
|
---|
| 5 | using System.Web.Mvc;
|
---|
| 6 | using System.ServiceModel.Security;
|
---|
| 7 | using HLWebPluginHost.Models;
|
---|
| 8 |
|
---|
| 9 | namespace HLWebPluginHost.Controllers {
|
---|
| 10 | public class AlgorithmClassController : Controller {
|
---|
[5081] | 11 | //container for data
|
---|
| 12 | AlgorithmClassModel viewModel;
|
---|
[4985] | 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 |
|
---|
[5081] | 34 | viewModel = new AlgorithmClassModel {
|
---|
[4985] | 35 | NumOfClasses = 0,
|
---|
| 36 | AlgorithmClassList = null
|
---|
[5081] | 37 | };
|
---|
[4985] | 38 |
|
---|
| 39 | return View(viewModel);
|
---|
| 40 | }//index
|
---|
| 41 |
|
---|
| 42 | //
|
---|
| 43 | // GET: /AlgorithmClass/Browse
|
---|
| 44 |
|
---|
| 45 | public string Browse() {
|
---|
| 46 | string message = "AlgorithmClass.Browse, id = " + Server.HtmlEncode(Request.QueryString["id"]);
|
---|
| 47 | return Server.HtmlEncode(message);
|
---|
| 48 | }//index
|
---|
| 49 |
|
---|
| 50 | //
|
---|
| 51 | // GET: /AlgorithmClass/Details/2
|
---|
| 52 |
|
---|
| 53 | public string Details(int id) {
|
---|
| 54 | string message = "AlgorithmClass.Details, id = " + id;
|
---|
| 55 | return Server.HtmlEncode(message);
|
---|
| 56 | }//index
|
---|
| 57 |
|
---|
| 58 | //
|
---|
| 59 | // GET: /AlgotithmClass/5
|
---|
| 60 | public string DelAlgorithmClass(int id) {
|
---|
| 61 | string message = "DeleteAlgorithmClass, id = " + Server.HtmlEncode(Request.QueryString["id"]);
|
---|
| 62 | return Server.HtmlEncode(message);
|
---|
| 63 | }
|
---|
| 64 |
|
---|
[5081] | 65 | public bool AddAlgorithmClass(string name, String description) {
|
---|
| 66 | //var viewModel = new AlgorithmClassModel {
|
---|
| 67 | // NumOfClasses = 0,
|
---|
| 68 | // AlgorithmClassList = null
|
---|
| 69 | //};
|
---|
[4985] | 70 |
|
---|
[5081] | 71 | viewModel.AddAlgorithmClass("ccc", "na");
|
---|
[4985] | 72 |
|
---|
| 73 | return true;
|
---|
| 74 |
|
---|
| 75 | }//AddAlgorithmClass
|
---|
| 76 |
|
---|
| 77 | }
|
---|
| 78 | }
|
---|