public FlightMapWindow(GravityTurner turner, int inWindowID, int width = 800, int height = 400) : base(turner, inWindowID) { windowPos = new Rect(Screen.width / 2 - width / 2, 100, width, height); flightMap = new FlightMap(turner, width, height); WindowTitle = "FlightMap"; }
public Task AddFlight(FlightBE flight, CancellationToken token) { _flightplanner_entities.Flight.Add(FlightMap.Map(flight)); _flightplanner_entities.SaveChanges(); return(null); //await Save(token); }
public FlightMapWindow(GravityTurner turner, int inWindowID, int width = 800, int height = 400) : base(turner, inWindowID) { windowPos = new Rect(Screen.width / 2 - width / 2, 100, width, height); flightMap = new FlightMap(turner, width, height); WindowTitle = "FlightMap"; }
public ActionResult Map([Bind(Prefix = "ID")] int FlightID = 0, int IsLive = 0) { if (!exLogic.User.hasAccess("FLIGHT.MAP")) { return(RedirectToAction("NoAccess", "Home")); } if (exLogic.User.hasAccess("DRONE.VIEWALL") || exLogic.User.hasAccess("DRONE.MANAGE")) { //no permission check } else { //Check the drone is in user account int DroneID = Util.toInt(ctx.DroneFlight.Where(x => x.ID == FlightID).Select(x => x.DroneID).FirstOrDefault()); int AccID = Util.getAccountID(); bool CheckValid = ctx.MSTR_Drone.Where(x => x.DroneId == DroneID && x.AccountID == AccID).Count() > 0 ? true : false; if (!CheckValid) { return(RedirectToAction("NoAccess", "Home")); } } var TheMap = new FlightMap(); TheMap.GetInformation(FlightID); if (!TheMap.IsLive) { if (!exLogic.User.hasAccess("FLIGHT.ARCHIVE")) { return(RedirectToAction("NoAccess", "Home")); } } return(View(TheMap)); }
public async Task EditFlight(FlightBE flight, CancellationToken token) { var existingFlight = await _flightplanner_entities.Flight.Where(x => x.Id == flight.Id).FirstOrDefaultAsync(); if (existingFlight != null) { FlightMap.Map(flight, existingFlight); await Save(token); } }
public JsonResult ChartSummaryData([Bind(Prefix = "ID")] int FlightID = 0) { if (!exLogic.User.hasAccess("FLIGHT.MAP")) { var oResult = new { Status = "Error", Message = "Do not have access" }; return(Json(oResult, JsonRequestBehavior.AllowGet)); } var TheMap = new FlightMap(); return(Json(TheMap.ChartSummaryData(FlightID), JsonRequestBehavior.AllowGet)); }
public async Task <FlightBE> GetFlightById(int idFlight) { var flight = await _flightplanner_entities.Flight.Where(x => x.Id == idFlight).FirstOrDefaultAsync(); return(FlightMap.Map(flight)); }
public async Task <List <FlightBE> > GetFlights() { var flights = await _flightplanner_entities.Flight.ToListAsync(); return(FlightMap.Map(flights)); }