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; }
public ActionResult RejectOffer() { FileRequestModel FileRequestModel = (FileRequestModel)Session["FileRequestModel"]; int GID = FileRequestModel.GID; MessageBL BL = new MessageBL(); var logs = BL.GetAttachmentLog(GID); if (logs[0].RecipientEmail == FileRequestModel.UserEmail) { Response.Cookies["TempUser"]["ReadFileAllowedToken"] = FileRequestModel.Token; Session["FileRequestModel"] = null; return(Json(new { Status = "Sucess" }, JsonRequestBehavior.AllowGet)); } else { Session["FileRequestModel"] = null; return(Json(new { Status = "Fail", ErrorMsg = "The specified file does not belong to the user." }, JsonRequestBehavior.AllowGet)); //Return Error and let the View calls th error } //start Token }