public ActionResult TaskSolutions(int TaskId)
 {
     TaskModel task = new TaskModel();
     CourseServices service = new CourseServices();
     task = service.GetTask(TaskId);
     List<SolutionModel> solutions = new List<SolutionModel>();
     solutions = service.GetSolutions(TaskId);
     return View(solutions);
 }
 public ActionResult TaskDelete(int TaskId)
 {
     CourseServices cs = new CourseServices();
     TaskModel model = new TaskModel();
     model = cs.GetTask(TaskId);
     return View(model);
 }
 public ActionResult TaskEdit(int TaskId)
 {
     CourseServices service = new CourseServices();
     TaskModel model = new TaskModel();
     model = service.GetTask(TaskId);
     return View(model);
 }
 public ActionResult SolutionEdit(SolutionModel model, HttpPostedFileBase upload)
 {
     CourseServices cs = new CourseServices();
     UserServices us = new UserServices();
     HttpCookie loggedStudent = Request.Cookies["LoggedUser"];
     model.Student = us.GetStudent(loggedStudent.Values.Get("Login"));
     model.StudentId = model.Student.IdUcznia;
     model.FileName = upload.FileName;
     using (var reader = new System.IO.BinaryReader(upload.InputStream))
     {
         model.Solution = reader.ReadBytes(upload.ContentLength);
     }
     cs.SolutionEdit(model);
     return RedirectToAction("TaskList", new { CourseId = cs.GetTask(model.TaskId).CourseId });
 }