public bool AddVenue(Venue ven)
 {
     try
     {
         using (var context = new TSMTEntities())
         {
             context.Venues.Add(ven);
             context.SaveChanges();
             return true;
         }
     }
     catch (Exception ex)
     {
         return false;
     }
 }
 public void UpdateVenue(Venue venue, int venueId)
 {
     var oldVenue = db.Venues.Find(venueId);
     oldVenue.Address = venue.Address;
     oldVenue.District = venue.District;
     oldVenue.Name = venue.Name;
     oldVenue.UniExamID = venue.UniExamID;
     db.SaveChanges();
 }
 public void GetVenue(int venueId)
 {
     Venue = new Venue();
     Venue = db.Venues.Find(venueId);
 }
        public ActionResult AddVenue(FormCollection f)
        {
            Venue ve = new Venue();
            ve.UniExamID = int.Parse(f["ueId"]);
            ve.Longitude = f["Longitude"];
            ve.Latitude = f["Latitude"];
            ve.Address = f["Address"];
            db.Venues.Add(ve);

            UniversitiesExamination ue = db.UniversitiesExaminations.SingleOrDefault(r => r.UniExamID == ve.UniExamID);

            db.SaveChanges();

            return RedirectToAction("ManageVenue", new { id = ve.UniExamID });
        }