/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public bool Update(BASE_MODULE entity) { //return dal.Update(entity) >= 0 ? true : false; #region 获取旧值 var oldEntity = this.GetEntity(AMS_SysLogBLL.Instance.GetKeyFieldValue<BASE_MODULE>(entity).ToString()); #endregion int IsOk = DbUtils.Update(entity, "MenuId"); #region 写日操作日志 if (IsOk > 0) { AMS_SysLogBLL.Instance.UpdateTaskLog<BASE_MODULE>(oldEntity, entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName); } #endregion return IsOk >= 0 ? true : false; }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public bool Insert(BASE_MODULE entity) { //return dal.Insert(entity) >= 0 ? true : false; int IsOk = DbUtils.Insert(entity); #region 写日操作日志 if (IsOk > 0) { AMS_SysLogBLL.Instance.AddTaskLog<BASE_MODULE>(entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName); } #endregion return IsOk >= 0 ? true : false; }