public void SetUp() { var log = new RejectWaybillLog(); _client = DataMother.CreateTestClientWithAddress(); log.ForClient = session.Get <ClientForReading>(_client.Id); log.LogTime = DateTime.Now; Save(log); Flush(); }
private List <DocumentReceiveLog> CheckDocs(List <DocumentReceiveLog> logs) { return(logs.Select(l => { try { SessionHelper.WithSession(s => l.Check(s)); l.SaveAndFlush(); l.CopyDocumentToClientDirectory(); return l; } catch (EMailSourceHandlerException e) { var errorTitle = string.Format("Не удалось разобрать накладную {0}", l.FileName); _infoLog.Info(errorTitle, e); Exceptions.Add(e); var rejectLog = new RejectWaybillLog(l); SessionHelper.WithSession(s => { s.Save(rejectLog); s.Flush(); }); return null; } }).Where(l => l != null).ToList()); }