コード例 #1
0
ファイル: Planerepository.cs プロジェクト: elielb/AirPortWcf
 public void AddPlaneToHistory(StationModel stationModel)
 {
     using (var db = new AirPortContext())
     {
         db.PlaneHistory.Add(stationModel);
     }
 }
コード例 #2
0
ファイル: Planerepository.cs プロジェクト: elielb/AirPortWcf
        public IEnumerable <Plane> AddPlaneToTakeOff(List <Plane> plane)
        {
            IEnumerable <Plane> listOfTakeOffPlanes = new List <Plane>();

            if (plane != null)
            {
                using (var db = new AirPortContext())
                {
                    listOfTakeOffPlanes = db.TackOffPlanes.AddRange((IEnumerable <PlaneTakeOff>)plane).Where(x => x.StatusFly == StatusFly.Fly);
                }
                return(listOfTakeOffPlanes);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
ファイル: Planerepository.cs プロジェクト: elielb/AirPortWcf
        public IEnumerable <Plane> AddPlaneToLanding(List <Plane> plane)
        {
            IEnumerable <Plane> listOfLandingPlanes = new List <Plane>();

            if (plane != null)
            {
                using (var db = new AirPortContext())
                {
                    listOfLandingPlanes = db.LandingPlanes.AddRange((IEnumerable <PlaneLanding>)plane).Where(x => x.StatusFly == StatusFly.Land);
                }
                return(listOfLandingPlanes);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
ファイル: Planerepository.cs プロジェクト: elielb/AirPortWcf
 public Planerepository()
 {
     planeContext = new AirPortContext();
 }