/// <summary> /// 根据实体进行软删除 /// </summary> /// <param name="t"></param> /// <returns></returns> public bool DeleteStatus(T t) { bool isSuccess = true; try { WriteDataBase.BeginTransaction(); isSuccess = WriteDataBase.DeleteStatus(t) > 0; WriteDataBase.CompleteTransaction(); } catch (Exception ex) { log.Info("Delete(T):" + ex); isSuccess = false; WriteDataBase.AbortTransaction(); WriteDataBase.CloseSharedConnection(); } finally { WriteDataBase.CloseSharedConnection(); } return(isSuccess); }
/// <summary> /// 保存该实体 /// </summary> /// <param name="t"></param> /// <returns></returns> public bool Save(T t) { bool isSuccess = true; try { WriteDataBase.BeginTransaction(); object obj = WriteDataBase.Insert(t); WriteDataBase.CompleteTransaction(); } catch (Exception ex) { log.Info("Save:" + ex); isSuccess = false; WriteDataBase.AbortTransaction(); WriteDataBase.CloseSharedConnection(); } finally { WriteDataBase.CloseSharedConnection(); } return(isSuccess); }