Пример #1
0
        public ActionResult Delete(int id)
        {
            var result = true;

            var blTeam = new BLTeam();

            result = blTeam.DeleteTeam(id);

            string resultMessage = string.Empty;

            if (result == true)
            {
                resultMessage = new BaseViewModel()["Team Has been deleted successfuly."];
            }
            else
            {
                resultMessage = new BaseViewModel()["This team has members. You can't delete it..."];
            }

            var jsonResult = new
            {
                success = result,
                message = resultMessage,
                teamId  = id,
            };

            return(Json(jsonResult, JsonRequestBehavior.AllowGet));
        }