public async Task <IActionResult> Edit(int id, [Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] WSubType wSubType) { if (id != wSubType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wSubType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WSubTypeExists(wSubType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(wSubType)); }
public async Task <ActionResult> DeleteConfirmed(int id) { WSubType wSubType = await db.WSubTypes.FindAsync(id); db.WSubTypes.Remove(wSubType); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Code,Description")] WSubType wSubType) { if (ModelState.IsValid) { db.Entry(wSubType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(wSubType)); }
public async Task <IActionResult> Create([Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] WSubType wSubType) { if (ModelState.IsValid) { _context.Add(wSubType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(wSubType)); }
public async Task <ActionResult> Create([Bind(Include = "Id,Code,Description")] WSubType wSubType) { if (ModelState.IsValid) { db.WSubTypes.Add(wSubType); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(wSubType)); }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WSubType wSubType = await db.WSubTypes.FindAsync(id); if (wSubType == null) { return(HttpNotFound()); } return(View(wSubType)); }