public IActionResult CurrentGPX(int id) { UsersGPX gpx = db.Gpx.FirstOrDefault(x => x.Id == id); CurrentUser.path = gpx.filepath; return(View("Index")); }
public IActionResult Delete(int id) { UsersGPX gpx = db.Gpx.FirstOrDefault(x => x.Id == id); if (gpx == null) { return(NotFound()); } db.Gpx.Remove(gpx); db.SaveChanges(); ViewBag.Collections = GetGPX(); return(View("Room")); }
public async Task <IActionResult> Insert(AllViewModel model) { if (ModelState.IsValid) { if (model.gpx != null) { var gpx = new UsersGPX { Id_user = CurrentUser.currentuser.Id, name = model.gpx.name, filepath = "C:\\GPX files\\" + model.gpx.filepath, filename = model.gpx.filepath }; db.Gpx.Add(gpx); await db.SaveChangesAsync(); return(RedirectToAction("Room", "Home")); } } ViewBag.Collections = GetGPX(); return(View("Room", model)); }