public List <RFQAttachments> getAttachmentsFromSentFolder(string folderName) { List <RFQAttachments> rfqInboxAttachmentsList = new List <RFQAttachments>(); string baseInboxAttachmentsPath = ConfigurationManager.AppSettings["RFQAttachmentsSent"]; if (folderName != "" && Directory.Exists(baseInboxAttachmentsPath + folderName.Trim())) { DirectoryInfo directory = new DirectoryInfo(baseInboxAttachmentsPath + folderName); foreach (FileInfo file in directory.GetFiles()) { RFQAttachments rfqAttachment = new RFQAttachments(); rfqAttachment.FileName = file.Name; rfqAttachment.Directory = folderName; rfqInboxAttachmentsList.Add(rfqAttachment); } } return(rfqInboxAttachmentsList); }
public void updateAttachmentsToBuyer(ref RFQ rfq) { rfq.AttachmentsToBuyer = null; string baseInboxAttachmentsPath = ConfigurationManager.AppSettings["RFQAttachmentsInbox"]; if (rfq.InboxAttachmentsFolder.Trim() != "" && Directory.Exists(baseInboxAttachmentsPath + rfq.InboxAttachmentsFolder.Trim())) { List <RFQAttachments> rfqInboxAttachmentsList = new List <RFQAttachments>(); DirectoryInfo directory = new DirectoryInfo(baseInboxAttachmentsPath + rfq.InboxAttachmentsFolder); foreach (FileInfo file in directory.GetFiles()) { RFQAttachments rfqAttachment = new RFQAttachments(); rfqAttachment.FileName = file.Name; rfqAttachment.Directory = rfq.InboxAttachmentsFolder; rfqInboxAttachmentsList.Add(rfqAttachment); } rfq.AttachmentsToBuyer = rfqInboxAttachmentsList; } }