Exemple #1
0
        public async Task <JsonResult> Insert(Apps model)
        {
            var result = new BaseResult();
            var list   = await _appService.GetList();

            var nameList = list.Where(s => s.Name.Trim() == model.Name);

            if (nameList != null && nameList.Count() > 0)
            {
                result.IsSuccess = false;
                result.ErrorMsg  = "该App名称已经存在";
            }
            else
            {
                await _appService.Insert(model);

                result.IsSuccess = await _permissionService.BatchInsert(model.Name);
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }