public ActionResult SetAmount(SetAmountModel model) { if (model.Name == null) { model.Name = "Default"; } var result = db.Query<Team>().FirstOrDefault(m=>m.Name == model.TeamName); if (result != null) { if (model.SetAmount < 1) { ViewBag.Message = "You can`t set below one!"; return View(model); } result.Amount = model.SetAmount; db.Update(result); } db.Save(); return RedirectToAction("Submit", new { team = result.Name, name = model.Name }); }
public ActionResult SetAmount(string team = "Default", string name = "") { var SetPeopleInTeam = db.Query<Team>().FirstOrDefault(m=>m.Name == team); var rmIndex = new SetAmountModel { TeamName = SetPeopleInTeam.Name, Name = name, SetAmount = SetPeopleInTeam.Amount }; return View(rmIndex); }