Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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"))
Ejemplo n.º 3
0
        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));
        }