예제 #1
0
        public FlightSchedule Get(string id1)
        {
            FlightSchedule flights = null;

            try
            {
                var flightFound = db.FlightSchedules.Where(f => (f.FlightId == id1)).SingleOrDefault();
                if (flightFound != null)
                {
                    flights = flightFound;
                }
                else
                {
                    flights = null;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(flights);
        }
예제 #2
0
 public void Update(FlightSchedule fs)
 {
     db.Entry(fs).State = EntityState.Modified;
     db.SaveChanges();
 }
예제 #3
0
 public void Add(FlightSchedule newFlightSchedule)
 {
     db.FlightSchedules.Add(newFlightSchedule);
     db.SaveChanges();
 }