Exemplo n.º 1
0
 public IActionResult DeleteMuti(string ids)
 {
     try
     {
         string[]    idArray = ids.Split(',');
         List <Guid> delIds  = new List <Guid>();
         foreach (string id in idArray)
         {
             delIds.Add(Guid.Parse(id));
         }
         _service.DeleteBatch(delIds);
         return(Json(new
         {
             Result = "Success"
         }));
     }
     catch (Exception ex)
     {
         return(Json(new
         {
             Result = "Faild",
             Message = ex.Message
         }));
     }
 }
Exemplo n.º 2
0
        public JsonResult Delete(string Ids)
        {
            string[] arr = Ids.Split(',').ToArray();
            if (arr.Length <= 0)
            {
                return(Json(new { ret = "-999", msg = "请选择要删除的记录!" }));
            }
            List <Guid> delIds = new List <Guid>();

            foreach (var item in arr)
            {
                delIds.Add(Guid.Parse(item));
            }
            bool IsSucceed = _RoleAppService.DeleteBatch(delIds);

            return(Json(new { ret = IsSucceed ? "0000" : "-999", msg = IsSucceed ? "删除成功!" : "删除失败,请先删除外键关联记录!" }));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> DeleteMuti(string ids)
        {
            try
            {
                var idsArray    = ids.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                var idsGuidList = new List <Guid>();
                foreach (var item in idsArray)
                {
                    idsGuidList.Add(Guid.Parse(item));
                }
                await _roleAppService.DeleteBatch(idsGuidList);

                return(Json(new { result = "Success", message = "删除数据成功" }));
            }
            catch (Exception ex)
            {
                return(Json(new { result = "Error", message = ex.Message }));
            }
        }
Exemplo n.º 4
0
 public IActionResult DeleteMuti(string ids)
 {
     try
     {
         List <Guid> delIds = GetList(ids, ',');
         _service.DeleteBatch(delIds);
         return(Ok(new
         {
             Result = "Success"
         }));
     }
     catch (Exception ex)
     {
         return(Ok(new
         {
             Result = "Faild",
             Message = ex.Message
         }));
     }
 }
Exemplo n.º 5
0
        public IActionResult DeleteMuti(string ids)
        {
            var Res = new ServiceResult();

            try
            {
                Res.IsSuccess();
                string[]    idArray = ids.Split(',');
                List <Guid> delIds  = new List <Guid>();
                foreach (string id in idArray)
                {
                    delIds.Add(Guid.Parse(id));
                }
                _service.DeleteBatch(delIds);
                return(Ok(Res));
            }
            catch (Exception ex)
            {
                Res.IsFailed();
                return(Ok(Res));
            }
        }