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