public ServerResponse <NewsDeleteResponse> Delete(NewsModel request) { ServerResponse <NewsDeleteResponse> response = new ServerResponse <NewsDeleteResponse>(); try { var num = dal.Delete(request); response.Data = new NewsDeleteResponse { Id = request.Id, Num = num }; if (num == 1) { response.Code = ServerResponseType.成功; } else { response.Code = ServerResponseType.空数据; } } catch (Exception ex) { response.Code = ServerResponseType.调用异常; response.ErrorMsg = ex.ToString(); Log.LogHelper.WriteErrorLog(GetType(), ex); } return(response); }
/// <summary> /// 删除单条数据 /// </summary> /// <param name="obj"></param> /// <returns></returns> public int Delete(News obj) { return(dal.Delete(obj)); }