Exemple #1
0
        public ActionResult RemoveBatch(List <string> keyValues)
        {
            var resultModel = new RespResultCountViewModel();

            try
            {
                if (keyValues.Count() <= 0)
                {
                    resultModel.code = -1;
                    resultModel.msg  = "批量删除机构失败,缺少主键";
                    return(Ok(resultModel));
                }
                bool result = _organizeService.DeleteBatch(keyValues, User.GetCurrentUserId(), User.GetCurrentUserName());

                if (result)
                {
                    resultModel.code = 0;
                    resultModel.msg  = "批量删除机构成功";
                }
                else
                {
                    resultModel.code = -1;
                    resultModel.msg  = "批量删除机构失败";
                }
                return(Ok(resultModel));
            }
            catch (Exception ex)
            {
                resultModel.code = -1;
                resultModel.msg  = "操作失败:" + ex.ToString();
                resultModel.data = null;
                return(Ok(resultModel));
            }
        }