예제 #1
0
        public string DeleteData(int id)
        {
            try
            {
                PetLogic _petLogic = new PetLogic();

                if (_petLogic.DeletePet(id) ) return "ok";
                else return "The Given Pet Not Found";
            }
            catch (Exception exp)
            {
                return exp.GetType().Equals(typeof(ArgumentNullException)) ? "The Given Pet Not Found" : exp.Message;
            }
        }
예제 #2
0
 public ActionResult DeleteConfirmed(int id)
 {
     _logic = new PetLogic();
     //Pet pet = _logic.GetPetById(id);
     _logic.DeletePet(id);
     //db.Pets.Remove(pet);
     //db.SaveChanges();
     return RedirectToAction("Index");
 }