예제 #1
0
 public bool AddVenue(Venue ven)
 {
     try
     {
         using (var context = new TSMTEntities())
         {
             context.Venues.Add(ven);
             context.SaveChanges();
             return true;
         }
     }
     catch (Exception ex)
     {
         return false;
     }
 }
예제 #2
0
 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();
 }
예제 #3
0
 public void GetVenue(int venueId)
 {
     Venue = new Venue();
     Venue = db.Venues.Find(venueId);
 }
예제 #4
0
        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 });
        }