public ActionResult DeleteCompetence(int id, FormCollection collection) { Domain.Entity.Competence skill = cs.GetById(id); cs.Delete(skill); cs.Commit(); return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK)); }
public ActionResult EditCompetence(Competence c1, int id) { Domain.Entity.Competence skill = cs.GetById(id); skill.Label = c1.Label; skill.Dificulty = c1.Dificulty; cs.Update(skill); cs.Commit(); return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK)); }
public ActionResult Delete(int id, FormCollection collection) { try { Domain.Entity.Competence skill = cs.GetById(id); cs.Delete(skill); cs.Commit(); } catch (DataException /* dex */) { //Log the error (uncomment dex variable name and add a line here to write a log. return(RedirectToAction("Delete", new { id = id, saveChangesError = true })); } return(RedirectToAction("Index")); }
public ActionResult CreateCompetence(Competence skill) { Domain.Entity.Competence c = new Domain.Entity.Competence { idCompetence = skill.idCompetence, Label = skill.Label, Dificulty = skill.Dificulty, idRessource = skill.idRessource, }; cs.Add(c); cs.Commit(); //var path = Path.Combine(Server.MapPath("~/Content/Upload/"), Image.FileName); //Image.SaveAs(path); return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK)); }
public ActionResult Edit(int id, Competence c1) { try { Domain.Entity.Competence skill = cs.GetById(id); skill.Label = c1.Label; skill.Dificulty = c1.Dificulty; cs.Update(skill); cs.Commit(); } catch (DataException /* dex */) { //Log the error (uncomment dex variable name and add a line here to write a log. return(RedirectToAction("Edit", new { id = id, saveChangesError = true })); } return(RedirectToAction("index")); }
public ActionResult Create(Competence skills) { try { Domain.Entity.Competence c = new Domain.Entity.Competence(); c.Label = skills.Label; c.Dificulty = skills.Dificulty; c.idRessource = skills.idRessource; cs.Add(c); cs.Commit(); return(RedirectToAction("Index")); } catch { return(View()); } }