Пример #1
0
        //
        // GET: /Territory/Delete/5

        public ActionResult Delete(int id)
        {
            IRepository <Models.Territory> repo = new TerritoryRepository();

            repo.Delete(repo.GetById(id));
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         IRepository <Models.Territory> repo = new TerritoryRepository();
         repo.Delete(repo.GetById(id));
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }