Пример #1
0
 /// <summary>
 /// 删除一个日志
 /// </summary>
 /// <param name="validationErrors">返回的错误信息</param>
 /// <param name="id">一日志的主键</param>
 /// <returns></returns>
 public bool Delete(ref ValidationErrors validationErrors, string id)
 {
     try
     {
         return(repository.Delete(id) == 1);
     }
     catch (Exception ex)
     {
         validationErrors.Add(ex.Message);
         ExceptionsHander.WriteExceptions(ex);
     }
     return(false);
 }
        public void Delete()
        {
            Random random = new Random();
            var    srcId  = random.Next(100);
            var    desc   = "插入数据 - " + srcId;
            var    id     = SysLogRepository.Insert(TableSource.None, OperationType.Insert, srcId);
            var    log    = SysLogRepository.Get(id);

            Assert.IsNotNull(log);

            SysLogRepository.Delete(log);
            log = SysLogRepository.Get(id);
            Assert.IsNull(log);
        }
Пример #3
0
        /// <summary>
        /// 删除一个SysLogModel实体
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool DeleteOneSysLogModel(SysLogModel entity)
        {
            var result = false;

            try
            {
                result = dal_SysLog.Delete(entity) > 0 ? true : false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }