Beispiel #1
0
        public async Task <ActionResult> StockDelete(string ids)
        {
            var result = new JsonModel {
                statusCode = 300, message = "删除失败,记录不存在!", closeCurrent = false
            };

            if (string.IsNullOrEmpty(ids))
            {
                return(Json(result));
            }
            var list = await StockRepository.BatchDeleteAsync(ids);

            if (list == null)
            {
                return(Json(result));
            }
            var msg = string.Join(",", list.Select(m => m.Name).ToArray()).ToEllipsis(100);
            await LogRepository.Insert(TableSource.Stock, OperationType.Delete, string.Format("批量删除{0}等股票", msg), ids);

            result.statusCode = 200;
            result.message    = "删除成功!";
            return(Json(result));
        }