Beispiel #1
0
        public IHttpActionResult Puttblpassenger_table(string id, tblpassenger_table tblpassenger_table)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tblpassenger_table.PassengerID)
            {
                return(BadRequest());
            }

            db.Entry(tblpassenger_table).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tblpassenger_tableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult Posttblpassenger_table(tblpassenger_table tblpassenger_table)
        {
            db.sp_insertpassengers(tblpassenger_table.TicketID, tblpassenger_table.PName, tblpassenger_table.Gender, tblpassenger_table.SeatID, tblpassenger_table.Age);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            //db.tblpassenger_table.Add(tblpassenger_table);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tblpassenger_table.PassengerID }, tblpassenger_table));
        }
Beispiel #3
0
        public IHttpActionResult Deletetblpassenger_table(string id)
        {
            tblpassenger_table tblpassenger_table = db.tblpassenger_table.Find(id);

            if (tblpassenger_table == null)
            {
                return(NotFound());
            }

            db.tblpassenger_table.Remove(tblpassenger_table);
            db.SaveChanges();

            return(Ok(tblpassenger_table));
        }