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