コード例 #1
0
        public void Resume(int id)
        {
            var item = PointPolicyService.GetById(id);

            if (item != null && item.State == PointPolicyStates.Invalid)
            {
                if (PointPolicyService.Query().Any(x => x.IncludeLevel(item.PointPolicyId) && item.State == PointPolicyStates.Normal))
                {
                    AddError(Localize("resume.fail"), item.DisplayName, item.PointPolicyId);
                }
                else
                {
                    item.State = PointPolicyStates.Normal;
                    PointPolicyService.Update(item);
                    AddMessage("resume.success", item.DisplayName, item.PointPolicyId);
                    Logger.LogWithSerialNo(LogTypes.PointPolicyResume, SerialNoHelper.Create(), id, item.DisplayName, item.PointPolicyId);
                    CacheService.Refresh(CacheKeys.PointPolicyKey);
                }
            }
        }