Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Level,Order,Question")] QMaster qMaster)
        {
            if (id != qMaster.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(qMaster);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!QMasterExists(qMaster.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(qMaster));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Level,Order,Question")] QMaster qMaster)
        {
            if (ModelState.IsValid)
            {
                _context.Add(qMaster);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(qMaster));
        }
Beispiel #3
0
 public void Update(QMaster newQuestion)
 {
     throw new NotImplementedException();
 }
Beispiel #4
0
 public void Add(QMaster newQuestion)
 {
     _context.Add(newQuestion);
     _context.SaveChanges();
 }