Exemple #1
0
        public IActionResult AddSort(SortManage model)
        {
            if (ModelState.IsValid)
            {
                //判断栏目名是否存在
                if (!_sort.IsSortExisted(model.AddName))
                {
                    _sort.AddSort(model.AddName);
                    ViewBag.AddSuccess = "Success";

                    return(View("ManageSort"));
                }
                else
                {
                    ViewBag.AddError = "Fail";

                    return(View("ManageSort"));
                }
            }

            return(View("ManageSort"));
        }