public ActionResult DeleteConfirmed(int id)
        {
            FlightBoard flightBoard = db.FlightBoard.Find(id);

            db.FlightBoard.Remove(flightBoard);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //private Joystick joystick;


        public MainViewModel()
        {
            this.model     = new MainWindowModel();
            this.isConnect = false;

            this.flightBoard = new FlightBoard();
            this.flightBoard.setVM(this);
        }
 public ActionResult Edit([Bind(Include = "flightBoardID,boardName,flightID")] FlightBoard flightBoard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(flightBoard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(flightBoard));
 }
        public ActionResult Create([Bind(Include = "flightBoardID,boardName,flightID")] FlightBoard flightBoard)
        {
            if (ModelState.IsValid)
            {
                db.FlightBoard.Add(flightBoard);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(flightBoard));
        }
Beispiel #5
0
        public void Run()
        {
            GameSpeed = 0;
            Time      = DateTime.Now;

            FlightBoard = new FlightBoard();
            Player      = new Player();
            Shop        = new Shop();

            _timer.Tick    += new EventHandler(OnTick);
            _timer.Interval = new TimeSpan(0, 0, 1);
            _timer.Start();
        }
 /// <summary>
 /// The MainWindowViewModel constructor gets as a parameter
 /// an IMainModel model of the Main Window.
 /// <param name="model">IMainModel model of the Main Window.</para>
 /// <param name="fb">FlightBoard fb which we change when Lan or Lat changes.</param>
 /// <param name="j">Joystick j to which we handle moving the knob.</param>
 /// </summary>
 public MainWindowViewModel(IMainModel model, FlightBoard fb, Joystick j)
 {
     this.model             = model;
     model.PropertyChanged += handlePropertyChanged;
     onServerConnected     += connectClientEventHandler;
     Aileron       = 0;
     Lat           = 0;
     AutoPilotText = "";
     AutoPilotTextBoxBackgroundColor = "White";
     fb.addPropertyChangedFunctionToINotifyPropertyChanged(this);
     j.KnobMouseMoveCapturedEvent += handleKnobMove;
     j.KnobMouseResetEvent        += handleKnobReset;
 }
        // GET: FlightBoards/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FlightBoard flightBoard = db.FlightBoard.Find(id);

            if (flightBoard == null)
            {
                return(HttpNotFound());
            }
            return(View(flightBoard));
        }