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