Ejemplo n.º 1
0
        public IActionResult CurrentGPX(int id)
        {
            UsersGPX gpx = db.Gpx.FirstOrDefault(x => x.Id == id);

            CurrentUser.path = gpx.filepath;
            return(View("Index"));
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
        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));
        }