public void RemoveAttachment(OCL.User AccessingUser,OCL.Attachment FileAttachment) { OCL.Functions F = new OCL.Functions(); //OCL.Recording R = F.GetRecording(this.RecordingID); OCL.Note CNote = F.GetNote(mvarID); // if(R.OwnerID == AccessingUser.ID) // { if(CNote.HasAttachment) { try { F.RemoveNoteAttachment(mvarID,FileAttachment.ID); } catch(Exception Err) { throw new Exception(Err.Message); } } // } }
/// <summary> /// This will add a file to a given Note. /// attachment. /// </summary> /// <param name="AccessingUser"></param> /// <param name="sFile"></param> public OCL.Attachments AddAttachments(OCL.User AccessingUser, string[] sFile,ref OCL.FTPTransfer FTP) { OCL.Functions F = new OCL.Functions(); //OCL.Recording R = F.GetRecording(this.RecordingID); OCL.Note CNote = F.GetNote(mvarID); ///Possible To Do: Add a Security Check to see if Accessing User has privilege /// to download attachment. As of today. Anyone with the ability to view /// a Note can get download its attachments. /// The reasong to have OCL.User AccessingUser is so that if this feature gets /// implemented the function will keep working just the same in legacy code. /// /// if(R.OwnerID == AccessingUser.ID) /// { /// } try { //OCL.Attachment A = F.SetNoteAttachment(mvarID, sFile, ShowProgress); OCL.Attachments A = F.SetNoteAttachments(mvarID, sFile, ref FTP); return A; } catch(Exception Err) { throw new Exception(Err.Message); } }