Пример #1
0
        public IHttpActionResult UpdateVenue(Venue venue)
        {
            PenOCDataContext db = new PenOCDataContext();

            tblVenue venueRecord = db.tblVenues.Single(v => v.idVenue == venue.id);

            venueRecord.strName = venue.name;

            db.SubmitChanges();

            return Ok(venue);
        }
Пример #2
0
        public IHttpActionResult InsertVenue(Venue venue)
        {
            PenOCDataContext db = new PenOCDataContext();

            tblVenue venueRecord = new tblVenue
            {
                strName = venue.name,

            };

            db.tblVenues.InsertOnSubmit(venueRecord);
            db.SubmitChanges();

            venue.id = venueRecord.idVenue;

            return Ok(venue);
        }