Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs	(revision 6213)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs	(revision 6213)
@@ -0,0 +1,110 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using HLWebOKBAdminPlugin.Models;
+using HLWebOKBAdminPlugin.OKBAdministrationService;
+
+namespace HLWebOKBAdminPlugin.Controllers
+{
+    /// <summary>
+    /// Controller for Algorithm Submenu
+    /// </summary>
+	public class AlgorithmController : Controller
+	{
+		/// <summary>
+		/// Controller for Index View
+		/// </summary>
+		/// <returns></returns>
+		public ActionResult Index()
+        {
+            Session["SelectedSubMenu"] = "Algorithm";
+            AlgorithmModel pm = new AlgorithmModel();
+			return View(pm);
+		}
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortAsc() {
+            Session["SelectedSubMenu"] = "Algorithm";
+            AlgorithmModel pm = new AlgorithmModel();
+            pm.Algorithms = pm.Algorithms.OrderBy(x => x.Name).ToList<Algorithm>();
+            return View("Index",pm);
+        }
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortDesc() {
+            Session["SelectedSubMenu"] = "Algorithm";
+            AlgorithmModel pm = new AlgorithmModel();
+            pm.Algorithms = pm.Algorithms.OrderByDescending(x => x.Name).ToArray<Algorithm>();
+            return View("Index",pm);
+        }
+        /// <summary>
+        /// Controller for Detail View
+        /// </summary>
+        /// <param name="p"></param>
+        /// <returns></returns>
+		public ActionResult Detail(long? id)
+        {
+            Session["SelectedSubMenu"] = "Algorithm";
+            // We use here the AlgorithmMode, but I think
+            // we can also use the Algorithm class. (?)
+            AlgorithmModel pm = new AlgorithmModel();
+            if(id == null)
+                pm.Algorithm = new Algorithm();
+            else
+                pm.Algorithm = (Algorithm)pm.Algorithms.Where(x => x.Id.Equals((long)id)).FirstOrDefault();
+			return View(pm);
+		}
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult Delete(long id) {
+            Session["SelectedSubMenu"] = "Algorithm";
+            // We use here the AlgorithmMode, but I think
+            // we can also use the Algorithm class. (?)
+            AlgorithmModel pm = new AlgorithmModel();
+            if(id != 0) {
+                pm.DeleteAlgorithm(id);
+            }
+            return View("Index", pm);
+        }
+
+        /// <summary>
+        /// Controller for Detail View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SaveChanges(FormCollection collection) {            
+            long algorithmId = long.Parse(collection.Get("AlgorithmId"));
+            String algorithmName = collection.Get("AlgorithmName");
+            String algorithmDescription = collection.Get("AlgorithmDescription");
+            String algorithmDataTypeName = collection.Get("AlgorithmDataTypeName");
+            long algorithmClassId = long.Parse(collection.Get("AlgorithmClassId"));
+            long platformId = long.Parse(collection.Get("PlatformId"));
+
+            // Later, we will get the runs from the session ...
+            AlgorithmModel pm = new AlgorithmModel();
+            if(algorithmId != 0)
+                pm.Algorithm = (Algorithm)pm.Algorithms.Where(x => x.Id.Equals(algorithmId)).FirstOrDefault();
+
+            pm.Algorithm.Name = algorithmName;
+            pm.Algorithm.Description = algorithmDescription;
+            pm.Algorithm.DataTypeName = algorithmDataTypeName;
+            pm.Algorithm.DataTypeTypeName = "";
+            pm.Algorithm.AlgorithmClassId = algorithmClassId;
+            pm.Algorithm.PlatformId = platformId;
+
+            pm.SaveAlgorithm(pm.Algorithm);
+
+            return View("Index",pm);
+        }
+	}
+}
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs	(revision 6162)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs	(revision 6213)
@@ -21,5 +21,5 @@
         {
             Session["SelectedSubMenu"] = "Problem";
-			ProblemModel pm = new ProblemModel();
+            ProblemModel pm = new ProblemModel();
 			return View(pm);
 		}
@@ -43,6 +43,16 @@
             Session["SelectedSubMenu"] = "Problem";
             ProblemModel pm = new ProblemModel();
-            pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>();
-            return View("Index",pm);
+
+            //this is code for testing sortorder
+            IOrderedEnumerable<Problem> test = pm.Problems.OrderByDescending(x => x.Name);
+            IList<Problem> test2 = new List<Problem>();
+            foreach(var item in test) {
+                test2.Add(item);
+            }
+            pm.Problems = test2;
+
+            // this should be the right code
+            //pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>();
+            return View("Index", pm);
         }
         /// <summary>
@@ -56,5 +66,5 @@
             // We use here the ProblemMode, but I think
             // we can also use the Problem class. (?)
-			ProblemModel pm = new ProblemModel();
+            ProblemModel pm = new ProblemModel();
             if(id == null)
                 pm.Problem = new Problem();
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmModel.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmModel.cs	(revision 6162)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AlgorithmModel.cs	(revision 6213)
@@ -6,9 +6,12 @@
 using HLWebOKBAdminPlugin.Helpers;
 
-namespace HLWebOKBAdminPlugin.Models {
+namespace HLWebOKBAdminPlugin.Models
+{
     public class AlgorithmModel {
-        
+
         public String SelectedSubMenu { get; set; }
-        public IList<Algorithm> Algorithms { get { return AlgorithmsGetAll(); } }
+        public IList<Algorithm> Algorithms { get { return AlgorithmGetAll(); } set { ;} }
+        public IList<AlgorithmClass> AlgorithmClasses { get { return AlgorithmClassGetAll(); } }
+        public IList<Platform> Platforms { get { return PlatformsGetAll(); } }
 
         public Algorithm Algorithm { get; set; }
@@ -18,5 +21,5 @@
         }//AlgorithmModel
 
-        //***************************************Algorithms*************************************************
+        //***************************************Algorithms***************************************************
         private IList<Platform> PlatformsGetAll() {
             AdministrationServiceClient adminClient = Admin.GetClientFactory();
@@ -32,23 +35,22 @@
 
             return platformList;
-        }//ProblemClassGetAll
+        }//AlgorithmClassGetAll
 
-        private IList<ProblemClass> ProblemClassGetAll() {
+        private IList<AlgorithmClass> AlgorithmClassGetAll() {
             AdministrationServiceClient adminClient = Admin.GetClientFactory();
 
-            IList<ProblemClass> problemClassList = new List<ProblemClass>();
+            IList<AlgorithmClass> algorithmClassList = new List<AlgorithmClass>();
 
             if (adminClient != null) {
-                ProblemClass[] problemClasses = adminClient.GetProblemClasses();
-                foreach (ProblemClass pc in problemClasses) {
-                    problemClassList.Add(pc);
+                AlgorithmClass[] algorithmClasses = adminClient.GetAlgorithmClasses();
+                foreach(AlgorithmClass ac in algorithmClasses) {
+                    algorithmClassList.Add(ac);
                 }
             }//if (adminClient != null)
 
-            return problemClassList;
-        }//ProblemClassGetAll
+            return algorithmClassList;
+        }//AlgorithmClassGetAll
 
-        //get all algorithms
-        private IList<Algorithm> AlgorithmsGetAll() {
+        private IList<Algorithm> AlgorithmGetAll() {
             AdministrationServiceClient adminClient = Admin.GetClientFactory();
 
@@ -57,6 +59,6 @@
             if (adminClient != null) {
                 Algorithm[] algorithm = adminClient.GetAlgorithms();
-                foreach (Algorithm al in algorithm) {
-                    algorithmList.Add(al);
+                foreach(Algorithm alg in algorithm) {
+                    algorithmList.Add(alg);
 
                 }
@@ -64,5 +66,5 @@
 
             return algorithmList;
-        }//AlgorithmsGetAll
+        }//AlgorithmGetAll
 
         private long AddAlgorithm(Algorithm algorithm) {
@@ -92,7 +94,7 @@
                 }
                 else {
-                    Algorithm al = adminClient.GetAlgorithm(algorithm.Id);
+                    Algorithm alg = adminClient.GetAlgorithm(algorithm.Id);
 
-                    if (al != null) {
+                    if (alg != null) {
                         adminClient.UpdateAlgorithm(algorithm);
                         return algorithm.Id;
@@ -103,5 +105,4 @@
             return 0;
         }//SaveAlgorithm
-        
     }
 }
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemModel.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemModel.cs	(revision 6162)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/ProblemModel.cs	(revision 6213)
@@ -11,5 +11,8 @@
 
         public String SelectedSubMenu { get; set; }
-        public IList<Problem> Problems { get { return ProblemsGetAll(); } set { ;} }
+        public IList<Problem> Problems {
+            get { return ProblemsGetAll(); }
+            set { ;}
+        }
         public IList<ProblemClass> ProblemClasses { get { return ProblemClassGetAll(); } }
         public IList<Platform> Platforms { get { return PlatformsGetAll(); } }
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Menu.ascx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Menu.ascx	(revision 6162)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Menu.ascx	(revision 6213)
@@ -6,5 +6,5 @@
 </li>
 <li <% if(Session["SelectedSubMenu"] == "Algorithm") {%> class="selected" <%}%>>
-    <%: Html.ActionLink("Algorithm", "Algorithm", "Admin") %>
+    <%: Html.ActionLink("Algorithm", "Index", "Algorithm")%>
 </li>
 <li <% if(Session["SelectedSubMenu"] == "ProblemClass") {%> class="selected" <%}%>>
