Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs	(revision 6218)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs	(revision 6246)
@@ -6,5 +6,4 @@
 using System.Web.Security;
 using System.ServiceModel.Security;
-//using HLWebPluginHost.OKBService;
 using System.Diagnostics;
 using HLWebOKBAdminPlugin.OKBAdministrationService;
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmClassController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmClassController.cs	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmClassController.cs	(revision 6246)
@@ -0,0 +1,104 @@
+﻿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
+{
+    public class AlgorithmClassController : Controller
+    {
+        //
+        // GET: /AlgorithmClass/
+
+        public ActionResult Index()
+        {
+            Session["SelectedSubMenu"] = "AlgorithmClass";
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+            return View(acm);
+        }//Index
+
+        public ActionResult Detail(long? id) {
+            Session["SelectedSubMenu"] = "AlgorithmClass";
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+
+            if (id == null)
+                acm.AlgorithmClass = new AlgorithmClass();
+            else
+                acm.AlgorithmClass = (AlgorithmClass)acm.AlgorithmClasses.Where(x => x.Id.Equals((long)id)).FirstOrDefault();
+            return View(acm);
+        }//Detail
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult Delete(long? id) {
+            Session["SelectedSubMenu"] = "AlgorithmClass";
+
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+            if (id != 0) {
+                acm.DeleteAlgorithmClass((long)id);
+            }
+            return View("Index", acm);
+        }//Delete
+
+        /// <summary>
+        /// Controller for Detail View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SaveChanges(FormCollection collection) {
+            long algorithmClassId = long.Parse(collection.Get("AlgorithmClassId"));
+            String algorithmClassName = collection.Get("AlgorithmClassName");
+            String algorithmClassDescription = collection.Get("AlgorithmClassDescription");
+
+            // Later, we will get the runs from the session ...
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+            if (algorithmClassId != 0)
+                acm.AlgorithmClass = (AlgorithmClass)acm.AlgorithmClasses.Where(x => x.Id.Equals(algorithmClassId)).FirstOrDefault();
+
+            acm.AlgorithmClass.Name = algorithmClassName;
+            acm.AlgorithmClass.Description = algorithmClassDescription;
+
+            acm.SaveAlgorithmClass(acm.AlgorithmClass);
+
+            return View("Index", acm);
+        }//SaveChanges
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortAsc() {
+            Session["SelectedSubMenu"] = "AlgorithmClass";
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+            acm.AlgorithmClasses = acm.AlgorithmClasses.OrderBy(x => x.Name).ToList<AlgorithmClass>();
+            return View("Index", acm);
+        }
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortDesc() {
+            Session["SelectedSubMenu"] = "AlgorithmClass";
+            AlgorithmClassModel acm = new AlgorithmClassModel();
+
+            IOrderedEnumerable<AlgorithmClass> acmOrderedList = acm.AlgorithmClasses.OrderByDescending(x => x.Name);
+            IList<AlgorithmClass> acmList = new List<AlgorithmClass>();
+            foreach (var item in acmOrderedList) {
+                acmList.Add(item);
+            }
+            acm.AlgorithmClasses = acmList;
+
+            // this should be the right code
+            //pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>();
+            return View("Index", acm);
+        }
+
+    }
+}
+
+    
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs	(revision 6218)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AlgorithmController.cs	(revision 6246)
@@ -6,4 +6,5 @@
 using HLWebOKBAdminPlugin.Models;
 using HLWebOKBAdminPlugin.OKBAdministrationService;
+using System.IO;
 
 namespace HLWebOKBAdminPlugin.Controllers
@@ -79,4 +80,38 @@
         }
 
+        public ActionResult UploadFile(FormCollection collection) {
+            Session["SelectedSubMenu"] = "Algorithm";
+
+            long algorithmId = long.Parse(collection.Get("AlgorithmId"));
+
+            AlgorithmModel pm = new AlgorithmModel();
+
+            foreach (string inputTagName in Request.Files) {
+                HttpPostedFileBase file = Request.Files[inputTagName];
+                if (file.ContentLength > 0) {
+                    // maybe for storage on server
+                    //string filePath = Path.Combine(HttpContext.Server.MapPath("../Uploads"), Path.GetFileName(file.FileName));
+                    if (file.InputStream.CanRead) {
+                        //file length
+                        int fileLength = file.ContentLength;
+
+                        //bytearray
+                        byte[] data = new byte[fileLength];
+
+                        //initialize input stream
+                        Stream dataStream = file.InputStream;
+
+                        //read file into byte array
+                        dataStream.Read(data, 0, fileLength);
+
+                        //save data
+                        pm.UpdateAlgorithmData(algorithmId, data);
+                    }//if
+                }
+            }//foreach
+
+            return View("Index", pm);
+        }//UploadFile
+
         /// <summary>
         /// Controller for Detail View
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemClassController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemClassController.cs	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemClassController.cs	(revision 6246)
@@ -0,0 +1,106 @@
+﻿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 ProblemClass Submenu
+    // </summary>
+    public class ProblemClassController : Controller
+    {
+        //
+        // GET: /ProblemClass/
+
+        public ActionResult Index()
+        {
+            Session["SelectedSubMenu"] = "ProblemClass";
+            ProblemClassModel pcm = new ProblemClassModel();
+            return View(pcm);
+        }//Index
+
+        public ActionResult Detail(long? id) {
+            Session["SelectedSubMenu"] = "ProblemClass";
+            ProblemClassModel pcm = new ProblemClassModel();
+
+            if (id == null)
+                pcm.ProblemClass = new ProblemClass();
+            else
+                pcm.ProblemClass = (ProblemClass)pcm.ProblemClasses.Where(x => x.Id.Equals((long)id)).FirstOrDefault();
+            return View(pcm);
+        }//Detail
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult Delete(long? id) {
+            Session["SelectedSubMenu"] = "ProblemClass";
+
+            ProblemClassModel pcm = new ProblemClassModel();
+            if (id != 0) {
+                pcm.DeleteProblemClass((long)id);
+            }
+            return View("Index", pcm);
+        }//Delete
+
+        /// <summary>
+        /// Controller for Detail View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SaveChanges(FormCollection collection) {
+            long problemClassId = long.Parse(collection.Get("ProblemClassId"));
+            String problemClassName = collection.Get("ProblemClassName");
+            String problemClassDescription = collection.Get("ProblemClassDescription");
+
+            // Later, we will get the runs from the session ...
+            ProblemClassModel pcm = new ProblemClassModel();
+            if (problemClassId != 0)
+                pcm.ProblemClass = (ProblemClass)pcm.ProblemClasses.Where(x => x.Id.Equals(problemClassId)).FirstOrDefault();
+
+            pcm.ProblemClass.Name = problemClassName;
+            pcm.ProblemClass.Description = problemClassDescription;
+
+            pcm.SaveProblemClass(pcm.ProblemClass);
+
+            return View("Index", pcm);
+        }//SaveChanges
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortAsc() {
+            Session["SelectedSubMenu"] = "ProblemClass";
+            ProblemClassModel pcm = new ProblemClassModel();
+            pcm.ProblemClasses = pcm.ProblemClasses.OrderBy(x => x.Name).ToList<ProblemClass>();
+            return View("Index", pcm);
+        }
+
+        /// <summary>
+        /// Controller for Index View
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult SortDesc() {
+            Session["SelectedSubMenu"] = "ProblemClass";
+            ProblemClassModel pcm = new ProblemClassModel();
+
+            IOrderedEnumerable<ProblemClass> pcmOrderedList = pcm.ProblemClasses.OrderByDescending(x => x.Name);
+            IList<ProblemClass> pcmList = new List<ProblemClass>();
+            foreach (var item in pcmOrderedList) {
+                pcmList.Add(item);
+            }
+            pcm.ProblemClasses = pcmList;
+
+            // this should be the right code
+            //pm.Problems = pm.Problems.OrderByDescending(x => x.Name).ToArray<Problem>();
+            return View("Index", pcm);
+        }
+
+    }
+}
Index: branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs	(revision 6218)
+++ branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/ProblemController.cs	(revision 6246)
@@ -6,4 +6,5 @@
 using HLWebOKBAdminPlugin.Models;
 using HLWebOKBAdminPlugin.OKBAdministrationService;
+using System.IO;
 
 namespace HLWebOKBAdminPlugin.Controllers
@@ -88,4 +89,38 @@
             return View("Index", pm);
         }
+        
+        public ActionResult UploadFile(FormCollection collection) {
+            Session["SelectedSubMenu"] = "Problem";
+
+            long problemId = long.Parse(collection.Get("ProblemId"));           
+
+            ProblemModel pm = new ProblemModel();
+
+            foreach (string inputTagName in Request.Files) {
+                HttpPostedFileBase file = Request.Files[inputTagName];
+                if (file.ContentLength > 0) {
+                    // maybe for storage on server
+                    //string filePath = Path.Combine(HttpContext.Server.MapPath("../Uploads"), Path.GetFileName(file.FileName));
+                    if (file.InputStream.CanRead) {
+                        //file length
+                        int fileLength = file.ContentLength;
+
+                        //bytearray
+                        byte[] data = new byte[fileLength];
+
+                        //initialize input stream
+                        Stream dataStream = file.InputStream;
+
+                        //read file into byte array
+                        dataStream.Read(data, 0, fileLength);
+
+                        //save data
+                        pm.UpdateProblemData(problemId, data);
+                    }//if
+                }
+            }//foreach
+
+            return View("Index", pm);
+        }//UploadFile
 
         /// <summary>
