Exemplo n.º 1
0
        public IActionResult AddStatus(Status status)
        {
            var name = _db.GetStatuses().FindAll(a => a.Name == status.Name).Count();

            if (name == 0)
            {
                if (ModelState.IsValid)
                {
                    _db.AddStatus(status);

                    return(RedirectToAction(nameof(Status)));
                }
            }
            ViewBag.Message = "already exists";
            return(View());
        }