public List <AgencyCommunicationRequest> GetAgencyCommunicationRequests() { Tender tender = new TenderDefault().GetGeneralTender(); List <AgencyCommunicationRequest> generalAgencyCommunicationRequests = new List <AgencyCommunicationRequest>(); var communicationRequest = new AgencyCommunicationRequest(agencyRequestId, tenderId, agencyRequestTypeId, statusId, requestedByRoleName); communicationRequest.AddTender(tender); communicationRequest.UpdatePlaintAgencyCommunicationRequest(1, "no"); communicationRequest.UpdateAgencyCommunicationRequestStatus(1, ""); communicationRequest.UpdateAgencyCommunicationPlaintRequestStatus(1, 1, null, "", ""); AgencyCommunicationPlaintStatus PlaintAcceptanceStatus = new AgencyCommunicationPlaintStatus(); typeof(AgencyCommunicationPlaintStatus).GetProperty(nameof(AgencyCommunicationPlaintStatus.Name)).SetValue(PlaintAcceptanceStatus, "name"); typeof(AgencyCommunicationRequest).GetProperty(nameof(AgencyCommunicationRequest.PlaintAcceptanceStatus)).SetValue(communicationRequest, PlaintAcceptanceStatus); communicationRequest.Negotiations = new List <Negotiation>(); generalAgencyCommunicationRequests.Add(communicationRequest); var communicationRequest2 = new AgencyCommunicationRequest(2, 2, agencyRequestTypeId, statusId, requestedByRoleName); communicationRequest2.AddTender(tender); communicationRequest2.Negotiations = new List <Negotiation>(); generalAgencyCommunicationRequests.Add(communicationRequest2); return(generalAgencyCommunicationRequests); }
public void Should_UpdateAgencyCommunicationRequestStatus() { AgencyCommunicationRequest communicationRequest = new AgencyCommunicationRequest(); communicationRequest.UpdateAgencyCommunicationRequestStatus((int)Enums.AgencyCommunicationRequestStatus.Approved); communicationRequest.ShouldNotBeNull(); communicationRequest.StatusId.ShouldBe((int)Enums.AgencyCommunicationRequestStatus.Approved); }
private async Task SendNotificationAfterApproveReply(EnquiryReply enquiryReply) { var tender = enquiryReply.Enquiry.Tender; List <string> crs = (tender.TenderTypeId == (int)Enums.TenderType.PreQualification || tender.TenderTypeId == (int)Enums.TenderType.PostQualification) ? await _iDMAppService.QualificationToSendInvitation(tender.TenderId) : await _iDMAppService.GetAllSupplierOnTender(tender.TenderId); NotificationArguments NotificationArgument = new NotificationArguments(); if (tender.TenderTypeId == (int)Enums.TenderType.PreQualification || tender.TenderTypeId == (int)Enums.TenderType.PostQualification) { NotificationArgument.BodyEmailArgs = new object[] { "", tender.TenderName, tender.ReferenceNumber, tender?.LastEnqueriesDate, tender?.LastOfferPresentationDate }; } else { NotificationArgument.BodyEmailArgs = new object[] { "", tender.TenderName, tender.ReferenceNumber, tender.Purpose, tender?.LastEnqueriesDate, tender?.LastOfferPresentationDate, tender.OffersOpeningDate, tender?.OffersOpeningDate?.Hour }; } NotificationArgument.SubjectEmailArgs = new object[] { }; NotificationArgument.PanelArgs = new object[] { tender.ReferenceNumber }; NotificationArgument.SMSArgs = new object[] { tender.ReferenceNumber }; MainNotificationTemplateModel mainNotificationTemplateModel = new MainNotificationTemplateModel(NotificationArgument, $"Enquiry/SupplierEnquiriesOnTender?id={Util.Encrypt(tender.TenderId)}", NotificationEntityType.Tender, tender.TenderId.ToString(), 0, tender.TechnicalOrganizationId); if (tender.TenderTypeId == (int)Enums.TenderType.PreQualification || tender.TenderTypeId == (int)Enums.TenderType.PostQualification) { await _notificationAppService.SendNotificationForSuppliers(NotificationOperations.Supplier.InquiriesAboutTender.publishfaqanswerforQualification, crs, mainNotificationTemplateModel); await _notificationAppService.SendNotificationForCommitteeUsers(NotificationOperations.TechnicalCommitteeSecretary.InquiriesAboutTender.PublishfaqanswerforQualification, tender.TechnicalOrganizationId, mainNotificationTemplateModel); } else { await _notificationAppService.SendNotificationForSuppliers(NotificationOperations.Supplier.InquiriesAboutTender.publishfaqanswer, crs, mainNotificationTemplateModel); await _notificationAppService.SendNotificationForCommitteeUsers(NotificationOperations.TechnicalCommitteeSecretary.InquiriesAboutTender.publishfaqanswerbackend, tender.TechnicalOrganizationId, mainNotificationTemplateModel); } enquiryReply.Enquiry.Tender.AddActionHistory(tender.TenderStatusId, TenderActions.ApproveFAQ, "", _httpContextAccessor.HttpContext.User.UserId()); var comunicationRequest = await _enquiryQueries.GetEnquiryReplyWithCommunicationRequest(enquiryReply.EnquiryReplyId); AgencyCommunicationRequest agencyCommunicationRequest = await _enquiryDomain.GetEnquiryCommunicationRequestByRequestId(comunicationRequest.Enquiry.AgencyCommunicationRequest.AgencyRequestId); if (agencyCommunicationRequest.StatusId == (int)Enums.AgencyCommunicationRequestStatus.PendingEnquiryForReply && enquiryReply.EnquiryReplyStatusId == (int)Enums.EnquiryReplyStatus.Approved) { agencyCommunicationRequest.UpdateAgencyCommunicationRequestStatus((int)Enums.AgencyCommunicationRequestStatus.ReplyOnEnquiry); await _enquiryDomain.UpdateCommunicationRequest(agencyCommunicationRequest); } }