Ejemplo n.º 1
0
 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 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"));
 }