public IHttpActionResult Put_object(int id, _object _object) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != _object.id) { return(BadRequest()); } db.Entry(_object).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!_objectExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { _object _object = db.objects.Find(id); db.objects.Remove(_object); db.SaveChanges(); return(RedirectToAction("Index")); }
//_protocol = 0 = UDP, _protocol = 1 = TCP public void SetServerOptions(string _ip = "127.0.0.1", string _port = "15937", int _protocol = 0) { //Sets up a local UDP server as default IpAddress.Value = _ip; ServerPort.Value = _port; //Sets UDP as default internet protocol InternetProtocols.SelectedIndex = _protocol;//sets the list on UDP XProtocol = ComboBoxProtocols.SelectedItem; }
public ActionResult Edit([Bind(Include = "id,name")] _object _object) { if (ModelState.IsValid) { db.Entry(_object).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(_object)); }
public IHttpActionResult Get_object(int id) { _object _object = db.objects.Find(id); if (_object == null) { return(NotFound()); } return(Ok(_object)); }
public ActionResult Create([Bind(Include = "id,name")] _object _object) { if (ModelState.IsValid) { db.objects.Add(_object); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(_object)); }
public IHttpActionResult Post_object(_object _object) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.objects.Add(_object); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = _object.id }, _object)); }
public IHttpActionResult Delete_object(int id) { _object _object = db.objects.Find(id); if (_object == null) { return(NotFound()); } db.objects.Remove(_object); db.SaveChanges(); return(Ok(_object)); }
// GET: _object/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } _object _object = db.objects.Find(id); if (_object == null) { return(HttpNotFound()); } return(View(_object)); }
set => SetProperty(ref _object, value);
/* * After the ObservableList is created we choose here at which index * should reference, or rather, which faction should be picked and * showed in the selection scene. This operation doesn't work in the * Initialize method (the overrided one) called above. * **/ private void Start() { FactionsList.SelectedIndex = 1; XFaction = ComboBoxFactions.SelectedItem; }