public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,QueueNumber")] SuperCategory superCategory) { if (id != superCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(superCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SuperCategoryExists(superCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(superCategory)); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,QueueNumber")] SuperCategory superCategory) { if (ModelState.IsValid) { _context.Add(superCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(superCategory)); }
public void update(SuperCategory sc) { }
public void save(SuperCategory sc) { superCategories.Add(sc); SaveChanges(); }
public void delete(SuperCategory sc) { superCategories.Remove(sc); SaveChanges(); }
public async Task <IActionResult> Put([FromBody] SuperCategory super) { await _repo.UpdateItem(super); return(Ok()); }
public async Task <IActionResult> Post([FromBody] SuperCategory super) { var create = await _repo.AddItem(super); return(Ok(create)); }