public CommunicationInformation Add(Guid personId, CommunicationInformation model) { var person = personServiceInstance.Get(personId); if (person == null) { throw new EntryPointNotFoundException(); } model.PersonId = personId; model.Id = System.Guid.NewGuid(); model.CreatedDate = DateTime.UtcNow; db.CommunicationInformations.Add(model); db.SaveChanges(); return(model); }
public bool Validate(CommunicationInformation info) => ValidateAll(Valid(info != null, "CommunicationInformation"), Valid(_notice.Type != NoticeType.Contract || info?.ProcurementDocumentsAvailable != ProcurementDocumentAvailability.Undefined, "CommunicationInformation.ProcurementDocumentsAvailable"), Valid(info?.AdditionalInformation != AdditionalInformationAvailability.Undefined || _notice.Type == NoticeType.NationalAgricultureContract, "CommunicationInformation.AdditionalInformation"), Valid(info?.AdditionalInformation != AdditionalInformationAvailability.AddressAnother || Validate("CommunicationInformation.AdditionalInformationAddress", info.AdditionalInformationAddress), "CommunicationInformation.AdditionalInformation+AddressAnother"), Valid(info?.SendTendersOption != TenderSendOptions.AddressSendTenders || !string.IsNullOrWhiteSpace(info.ElectronicAddressToSendTenders), "CommunicationInformation.SendTendersOption+ElectronicAddressToSendTenders"), Valid(_notice.Type != NoticeType.Contract || info.SendTendersOption != TenderSendOptions.Undefined, "CommunicationInformation.SendTendersOption"), Valid(info != null && (!info.ElectronicCommunicationRequiresSpecialTools || !string.IsNullOrWhiteSpace(info.ElectronicCommunicationInfoUrl)), "CommunicationInformation: ElectronicCommunicationInfoUrl"));
/// <summary> /// Section I: Contracting authority /// </summary> /// <param name="project"></param> /// <param name="contactPerson">The contact person</param> /// <param name="communicationInformation">I.3 Communication</param> /// <returns>CONTRACTING_BODY XElement</returns> private XElement ContractingBody( ProcurementProjectContract project, ContactPerson contactPerson, CommunicationInformation communicationInformation ) { var organisation = project?.Organisation; if (organisation == null) { return(null); } return(TedHelpers.Element("CONTRACTING_BODY", TedHelpers.ADDRS1("ADDRESS_CONTRACTING_BODY", organisation, contactPerson), JointProcurement(project) )); }
/// <summary> /// Section I: Contracting authority /// </summary> /// <param name="organisation">The organisation</param> /// <param name="contactPerson">The contact person</param> /// <param name="communicationInformation">I.3 Communication</param> /// <returns>CONTRACTING_BODY XElement</returns> private XElement ContractingBody(OrganisationContract organisation, ContactPerson contactPerson, CommunicationInformation communicationInformation) { return(TedHelpers.Element("AUTH_ENTITY_ICAR", TedHelpers.Element("NAME_ADDRESSES_CONTACT_ICAR", TedHelpers.INC_01("CA_CE_CONCESSIONAIRE_PROFILE", organisation, contactPerson), TedHelpers.Element("INTERNET_ADDRESSES_ICAR", TedHelpers.Element("URL_GENERAL", _notice.Project.Organisation.Information.MainUrl), TedHelpers.Element("URL_INFORMATION", communicationInformation.ElectronicAccess))), // DIRECTIVE_2004_17 = CA // DIRECTIVE_2004_18 = CE TedHelpers.ElementWithAttribute("TYPE_OF_PURCHASING_BODY", "VALUE", "DIRECTIVE_2004_17"))); }
public CommunicationInformation Post(Guid personId, [FromBody] CommunicationInformation model) { return(_communicationInformationService.Add(personId, model)); }
/// <summary> /// Section I: Contracting authority /// </summary> /// <param name="organisation">The organisation</param> /// <param name="contactPerson">The contact person</param> /// <param name="communicationInformation">I.3 Communication</param> /// <returns>CONTRACTING_BODY XElement</returns> private XElement ContractingBody(OrganisationContract organisation, ContactPerson contactPerson, CommunicationInformation communicationInformation) { return(TedHelpers.Element("CONTRACTING_BODY", TedHelpers.ADDRS1("ADDRESS_CONTRACTING_BODY", organisation, contactPerson) )); }