public ActionResult EventsCreate(Events events)
 {
     if (Session["currFile"] != null)
     {
         events.Eventlink = Session["currFile"].ToString();
     }
     events.DistKey = GlobalVariables.DistKey;
     db.Events.Add(events);
     db.SaveChanges();
     Session["currEventKey"] = events.pKey;
     return RedirectToAction("EventsEdit/" + Session["currEventKey"].ToString());
 }
 public ActionResult EventsEdit(Events events)
 {
     if (Session["currFile"] != null)
     {
         events.Eventlink = Session["currFile"].ToString();
     }
     events.DistKey = GlobalVariables.DistKey;
     if (ModelState.IsValid)
     {
         db.Entry(events).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("EventsIndex");
     }
     return View(events);
 }