public ActionResult DeleteNote(int FolderId, int NoteId) { CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員 //查詢筆記資料夾 CNoteFolder myFolder = CNoteFolderFactory.fn筆記資料夾查詢(member) .FirstOrDefault(f => f.fFolderId == FolderId); CNote myNote = CNoteFactory.fn私人筆記查詢(myFolder) .FirstOrDefault(n => n.fNoteId == NoteId); CNoteFactory.fn私人筆記刪除(myNote); //查詢所有的筆記資料夾 List <CNoteFolder> lsFolder = CNoteFolderFactory.fn筆記資料夾查詢(member) .ToList(); //筆記資料夾包含筆記的列表 List <CNoteFolderViewModel> lsNotefolderVM = new List <CNoteFolderViewModel>(); //讀取筆記資料夾內的筆記 foreach (var folder in lsFolder) { List <CNote> myLsNote = CNoteFactory.fn私人筆記查詢(folder) .ToList(); lsNotefolderVM.Add(new CNoteFolderViewModel() { fFolderId = folder.fFolderId, fFolderName = folder.fFolderName, fMemberId = folder.fMemberId, lsNote = myLsNote }); } return(PartialView("_TrashView", lsNotefolderVM)); //return "筆記永久刪除成功!"; }