// Check if party role corresponds to document PartyRole including "new" status for role private bool PartyCorespondsToDocumentPartyRole(Party party, ProductDocumentation document) { return((party.PartyRole.Equals(PartyRole.Customer) && document.PartyRole.Equals(ProductPartyRoleEnum.CustomerEnum)) || (party.PartyRole.Equals(PartyRole.Customer) && string.IsNullOrEmpty(party.CustomerNumber) && document.PartyRole.Equals(ProductPartyRoleEnum.NewCustomerEnum)) || (party.PartyRole.Equals(PartyRole.AuthorizedPerson) && document.PartyRole.Equals(ProductPartyRoleEnum.AuthorizedPersonEnum)) || (party.PartyRole.Equals(PartyRole.AuthorizedPerson) && string.IsNullOrEmpty(party.CustomerNumber) && document.PartyRole.Equals(ProductPartyRoleEnum.NewAuthorizedPersonEnum)) || (party.PartyRole.Equals(PartyRole.CoDebtor) && document.PartyRole.Equals(ProductPartyRoleEnum.CoDebtorEnum)) || (party.PartyRole.Equals(PartyRole.CoDebtor) && string.IsNullOrEmpty(party.CustomerNumber) && document.PartyRole.Equals(ProductPartyRoleEnum.NewCoDebtorEnum)) || (party.PartyRole.Equals(PartyRole.Guarantor) && document.PartyRole.Equals(ProductPartyRoleEnum.GuarantorEnum)) || (party.PartyRole.Equals(PartyRole.Guarantor) && string.IsNullOrEmpty(party.CustomerNumber) && document.PartyRole.Equals(ProductPartyRoleEnum.NewGuarantorEnum))); }
public static ApplicationDocument FromProductDocument(ProductDocumentation productDocumentation) { return(new ApplicationDocument { DocumentContextKind = productDocumentation.DocumentContextKind, DocumentKind = productDocumentation.DocumentType, DocumentName = productDocumentation.DocumentName, DocumentReviewPeriod = productDocumentation.DocumentReviewPeriod, IsComposedFromTemplate = productDocumentation.IsComposedFromTemplate, IsForPhysicalArchiving = productDocumentation.IsForPhysicalArchiving, IsForSigning = productDocumentation.IsForSigning, IsForUpload = productDocumentation.IsForUpload, IsInternal = productDocumentation.IsInternal, IsMandatory = productDocumentation.IsMandatory, TemplateUrl = productDocumentation.TemplateUrl, Origin = productDocumentation.Origin, Status = DocumentStatus.EmptyEnum, IsForProposal = productDocumentation.IsForProposal }); }