Sage.Integration.Northwind.Application.Entities.Email.Email.GetDocument C# (CSharp) Method

GetDocument() private method

private GetDocument ( Emails row, Token lastToken, NorthwindConfig config ) : Document
row Sage.Integration.Northwind.Application.Entities.Account.DataSets.Emails
lastToken Sage.Integration.Northwind.Application.API.Token
config NorthwindConfig
return Sage.Integration.Northwind.Application.Base.Document
        private Document GetDocument(Emails.CustomerEmailsRow row, Token lastToken, NorthwindConfig config)
        {
            EmailDocument doc;
            string id;

            id = row.ID.ToString();

            doc = new EmailDocument();
            doc.Id = id;

            if (lastToken.InitRequest)
                doc.LogState = LogState.Created;

            else if (row.IsCreateIDNull() || row.IsModifyIDNull()
                || row.IsCreateUserNull() || row.IsModifyUserNull())
                doc.LogState = LogState.Created;

            else if ((row.CreateID > lastToken.SequenceNumber)
                   && (row.CreateUser != config.CrmUser))
                doc.LogState = LogState.Created;

            else if ((row.CreateID == lastToken.SequenceNumber)
                && (row.CreateUser != config.CrmUser)
                && (id.CompareTo(lastToken.Id.Id) > 0))
                doc.LogState = LogState.Created;
            else if ((row.ModifyID >= lastToken.SequenceNumber) && (row.ModifyUser != config.CrmUser))
                doc.LogState = LogState.Updated;

            doc.emailaddress.Value = row.IsEmailNull() ? null : row.Email;

            doc.type.Value = Constants.DefaultValues.Email.Type;

            return doc;
        }

Same methods

Email::GetDocument ( Identity identity, Token lastToken, NorthwindConfig config ) : Document