TransferEventLogServerFunctions.cs 844 Bytes
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using DirRX.Container.TransferEventLog;

namespace DirRX.Container.Server
{
  partial class TransferEventLogFunctions
  {
    /// <summary>
    /// Сбросить статус "Ошибка".
    /// </summary>
    [Remote, Public]
    public virtual void ResetErrorStatus()
    {
      if (_obj.CurrentState == CurrentState.Error)
      {
        _obj.CurrentState = null;
        _obj.FilePath = null;
        _obj.ContainerUid = null;
        _obj.TempGuid = null;
        
        var record = _obj.Protocol.AddNew();
        record.Time = Calendar.Now;
        record.Action = Resources.ActionResetError;
        record.Message = Resources.InfoResetErrorState;         
        
        _obj.Save();
      }
    }
  }
}