Beispiel #1
0
        public IActionResult UpdatePlane(long hangerID, int planeID)
        {
            AmsHangar planeAllot = ams_report.AmsHangar.Where(p => p.HangarId == hangerID).FirstOrDefault();

            planeAllot.PlaneAlloted = planeID;
            AmsPlane plane = ams_report.AmsPlane.Where(p => p.PlaneId == planeID).FirstOrDefault(); plane.HangerStatus = "Allotted";

            ams_report.SaveChanges();
            return(Ok("Updated"));
        }
        public ActionResult PutHangar(int hangarId, [FromBody] AmsHangar hangar)
        {
            AmsHangar ams_hangar = AMS1.AmsHangar.Where(p => p.HangarId == hangarId).FirstOrDefault();

            ams_hangar.ManagerId           = hangar.ManagerId;
            ams_hangar.ManagerAddressLine1 = hangar.ManagerAddressLine1;
            ams_hangar.ManagerAddressLine2 = hangar.ManagerAddressLine2;
            ams_hangar.City         = hangar.City;
            ams_hangar.State        = hangar.State;
            ams_hangar.ZipCode      = hangar.ZipCode;
            ams_hangar.Availability = hangar.Availability;

            AMS1.SaveChanges();
            return(Ok("Updated"));
        }
        public IActionResult PostHangar([FromBody] AmsHangar hangarId)
        {
            AmsHangar ams_hangar = new AmsHangar();

            ams_hangar.HangarId            = hangarId.HangarId;
            ams_hangar.ManagerId           = hangarId.ManagerId;
            ams_hangar.ManagerAddressLine1 = hangarId.ManagerAddressLine1;
            ams_hangar.ManagerAddressLine2 = hangarId.ManagerAddressLine2;
            ams_hangar.City         = hangarId.City;
            ams_hangar.State        = hangarId.State;
            ams_hangar.ZipCode      = hangarId.ZipCode;
            ams_hangar.Availability = hangarId.Availability;
            AMS1.AmsHangar.Add(ams_hangar);
            AMS1.SaveChanges();
            return(Ok("Hanger added"));
        }