public ActionResult EditGV(int id, FormCollection collection)
         {
              Storage m = new Storage();
                     GradeValue grade = m.getGradeValueById(id);
             int rid = m.getRegistrations().Find(r=>r.RegistrationID == grade.RegistrationID).StudentID;
             //int rid = m.getGradeValues().Find(o => o.R)
             try
             {
                 string name = Convert.ToString(collection["Value"]);


                 if (string.IsNullOrEmpty(name))
                     ModelState.AddModelError("nazwa", "Musisz podać nazwę oceny!");


                 if (ModelState.IsValid)
                 {
                    
                     m.updateGV(id, name, DateTime.Today.ToString("dd-MM-yyyy"), grade.RegistrationID, grade.GradeID, grade.TimeStamp);
                 }
                 else
                 {
                     return View(grade);
                 }


             }
             catch (EresDataContextException e)
             {
                 handleException(e);
             }
             catch
             {
             }

             return RedirectToAction("OcenyStudenta", new {id = rid });
         }
  public ActionResult EditGV(int id)
 {
     Storage m = new Storage();
     GradeValue g = m.getGradeValueById(id);
     return View(g);
 }