Exemplo n.º 1
0
        public IActionResult DeleteBloodTest(int id)
        {
            context = HttpContext.RequestServices.GetService(typeof(BCare.data.BcareContext)) as BcareContext;
            String cookie = Request.Cookies["Session"];

            if (Int32.Parse(cookie.Substring(10)) == context.GetUserIdByBloodTest(id))
            {
                context.DeleteBloodTest(id);
                return(RedirectToAction("BloodTest", "Account"));
            }
            ViewBag.Error = "אל תנסה אתה לא תצליח!";
            return(View());
        }