Exemplo n.º 1
0
        private void MoveClientFiles(RegisterModel model)
        {
            FileRequestModel FileRequestModel = (FileRequestModel)Session["FileRequestModel"];
            int GID = FileRequestModel.GID;
            //CreateRootFolder
            FileSystemBL      fBL              = new FileSystemBL();
            string            RootFolderName   = AppConstants.ROOT_FOLDER_NAME;
            MessageBL         mBL              = new MessageBL();
            var               GetAttachmentLog = mBL.GetAttachmentLog(GID);
            ELTFileSystemItem RootFolderItem   = new ELTFileSystemItem()
            {
                Owner_Email = model.UserName, IsFolder = true, Name = RootFolderName, ParentID = -1
            };

            fBL.InsertFile(RootFolderItem);
            string            SenderEmailFolder     = GetAttachmentLog[0].SenderEmail;
            ELTFileSystemItem SenderEmailFolderItem = new ELTFileSystemItem()
            {
                Owner_Email = model.UserName, IsFolder = true, Name = SenderEmailFolder, ParentID = RootFolderItem.ID
            };

            fBL.InsertFile(SenderEmailFolderItem);
            string            DocFolder     = GetAttachmentLog[0].ReferenceNo;
            ELTFileSystemItem DocFolderItem = new ELTFileSystemItem()
            {
                Owner_Email = model.UserName, IsFolder = true, Name = DocFolder, ParentID = SenderEmailFolderItem.ID
            };

            fBL.InsertFile(DocFolderItem);

            //mBL.CopyAttachment(GID, model.UserName, DocFolderItem.ID);

            Session["FileFolderToBeSet"] = DocFolderItem.Name;
        }
Exemplo n.º 2
0
 public override void CreateFolder(FileManagerFolder parent, string name)
 {
     ELTFileBL.InsertFile(new ELTFileSystemItem
     {
         IsFolder      = true,
         LastWriteTime = DateTime.Now,
         Name          = name,
         Owner_Email   = HttpContext.Current.User.Identity.Name,
         ParentID      = FindELTFolderItem(parent).ID
     });
     RefreshFolderCache();
 }
Exemplo n.º 3
0
        protected void GeneratePDFFiles(EmailAttachment attachment, List<EmailAttachment> ListWithID)
        {

            FileSystemBL FSBL = new FileSystemBL();
            if (attachment.IsSelected)
            {
                var count = (from c in ListWithID where c.FileName == attachment.FileName select c).Count();
                if (count == 0)
                {
                    Stream receiveStream = null;
                    ELT.COMMON.Util.ReadFileStream(Url.Content(attachment.GeneratorPath), ref receiveStream);
                    if (receiveStream != null)
                    {
                        using (var memoryStream = new MemoryStream())
                        {
                            receiveStream.CopyTo(memoryStream);
                            Byte[] array = memoryStream.ToArray();
                            ELTFileSystemItem item = new ELTFileSystemItem() { Data = new Binary(array), Name = attachment.FileName + ".pdf", ParentID = -1, Owner_Email = "*****@*****.**" };

                            FSBL.InsertFile(item);
                            attachment.FileID = item.ID;
                            ListWithID.Add(attachment);
                        }
                    }
                }
            }
        }