예제 #1
0
파일: RFQ.aspx.cs 프로젝트: Capsonic/APQM
    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);
    }
예제 #2
0
파일: RFQ.aspx.cs 프로젝트: Capsonic/APQM
    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;
        }
    }