예제 #1
0
        public async Task <ActionResult> DeleteAnimals(string name)
        {
            db.deleteInfectedAnimals(name);
            int id = db.Diseases.Where(x => x.name == name).FirstOrDefault().id;

            return(RedirectToAction("Details", new { id = id }));
        }
예제 #2
0
        public async Task <ActionResult> DeleteInfectedAnimals(string name)
        {
            try
            {
                int result = db.deleteInfectedAnimals(name);
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", new { message = "Wystąpił błąd, spróbuj ponownie." }));
            };

            return(RedirectToAction("Index"));
        }