public async Task <IActionResult> Edit(int id, [Bind("Id,Password")] Bos bos) { if (id != bos.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BosExists(bos.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bos)); }
private static async Task MaakBosTxt(Bos output) { KnownFolder docs = new KnownFolder(KnownFolderType.Documents); int meesteSprongen = output.Apen.OrderByDescending(s => s.VorigeBomen.Count).First().VorigeBomen.Count; string path = docs.Path + @"\OefThread" + @"\Txts"; Console.WriteLine("begin bos {0} txt", output.ID); using (StreamWriter sw = new StreamWriter(path + @$ "\SprongenBos_{output.ID}.txt"))
public async Task <IActionResult> Create([Bind("Id,Password")] Bos bos) { if (ModelState.IsValid) { _context.Add(bos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bos)); }