public ActionResult DeleteConfirmed(int id) { Proficiency proficiency = ProficiencyDAO.Get(id); ProficiencyDAO.Remove(proficiency); return(RedirectToAction("Index")); }
// GET: Proficiencies/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Proficiency proficiency = ProficiencyDAO.Get(id); if (proficiency == null) { return(HttpNotFound()); } return(View(proficiency)); }
public ActionResult Create([Bind(Include = "ProficiencyId,Name")] Proficiency proficiency) { if (ModelState.IsValid) { if (ProficiencyDAO.Save(proficiency)) { return(RedirectToAction("Index")); } ModelState.AddModelError("error", "A proficiencia já existe"); } return(View(proficiency)); }
public ActionResult Edit([Bind(Include = "ProficiencyId,Name")] Proficiency proficiency) { if (ModelState.IsValid) { Proficiency proficiencyInDataBase = ProficiencyDAO.Get(proficiency.ProficiencyId); proficiencyInDataBase.Name = proficiency.Name; if (ProficiencyDAO.Update(proficiencyInDataBase)) { return(RedirectToAction("Index")); } ModelState.AddModelError("error", "A proficiencia já existe"); } return(View(proficiency)); }
// GET: Proficiencies public ActionResult Index() { return(View(ProficiencyDAO.GetAll())); }
private List <AttributeInCharacter> CreateAttributesToAnCharacter() { return(ProficiencyDAO.GetAll().ConvertAll(x => new AttributeInCharacter(x))); }