Example #1
0
        public string UpdateVersion(int NoteId, string JsonContent)
        {
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員

            //查詢指定筆記內容
            CNote myNote = CNoteFactory.fn私人筆記全部查詢()
                           .FirstOrDefault(n => n.fNoteId == NoteId);

            myNote.fJsonContent  = JsonContent;
            myNote.fEditDateTime = DateTime.UtcNow.AddHours(08);
            CNoteFactory.fn私人筆記更新(myNote);
            return("筆記更新成功");
        }
Example #2
0
        public string UpdateNoteLevel(int FolderId, int NoteId, int Level)
        {
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員

            CNote myNote = CNoteFactory.fn私人筆記全部查詢()
                           .FirstOrDefault(n => n.fNoteId == NoteId);

            //if(myNote.fFolderId == FolderId && myNote.fNoteId == NoteId && myNote.fNoteListLevel == Level)
            //    return myNote.fNoteListName + " 筆記順序更新成功!";
            myNote.fFolderId      = FolderId;
            myNote.fNoteListLevel = Level;
            CNoteFactory.fn私人筆記更新(myNote);
            return(myNote.fNoteListName + " 筆記順序更新成功!");
        }
Example #3
0
        public string NoteRename(int FolderId, int NoteId, string NoteName)
        {
            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);

            myNote.fNoteListName = NoteName;
            myNote.fEditDateTime = DateTime.UtcNow.AddHours(08);
            CNoteFactory.fn私人筆記更新(myNote);
            return("筆記已重新命名!");
        }
Example #4
0
        public string Update(int FolderId, int NoteId, string JsonContent)
        {
            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);

            myNote.fJsonContent  = JsonContent;
            myNote.fEditDateTime = DateTime.UtcNow.AddHours(08);
            CNoteFactory.fn私人筆記更新(myNote);
            return("筆記更新成功");
        }
Example #5
0
        public string MoveOutTrash(int FolderId, int NoteId)
        {
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員

            CNoteFolder m原筆記資料夾 = CNoteFolderFactory.fn筆記資料夾查詢(member)
                                  .FirstOrDefault(f => f.fFolderId == FolderId);

            CNote myNote = CNoteFactory.fn私人筆記查詢(m原筆記資料夾)
                           .FirstOrDefault(n => n.fNoteId == NoteId);

            myNote.fIsTrash = false;

            CNoteFactory.fn私人筆記更新(myNote);

            return("筆記還原!");
        }
Example #6
0
        public string UpdateFavor(int FolderId, int NoteId, bool IsFavor)
        {
            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);

            myNote.fIsMyFavourite = IsFavor;
            myNote.fEditDateTime  = DateTime.UtcNow.AddHours(08);
            CNoteFactory.fn私人筆記更新(myNote);

            return("我的最愛筆記已更新!");
        }
Example #7
0
        public ActionResult MoveToTrash(int FolderId, int NoteId)
        {
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];//會員

            CNoteFolder m原筆記資料夾 = CNoteFolderFactory.fn筆記資料夾查詢(member)
                                  .FirstOrDefault(f => f.fFolderId == FolderId);
            CNoteFolder m未分類筆記 = CNoteFolderFactory.fn筆記資料夾查詢(member)
                                 .FirstOrDefault(f => f.fFolderName == "未分類筆記");

            CNote myNote = CNoteFactory.fn私人筆記查詢(m原筆記資料夾)
                           .FirstOrDefault(n => n.fNoteId == NoteId);

            myNote.fIsTrash  = true;
            myNote.fFolderId = m未分類筆記.fFolderId;

            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 "筆記移到垃圾桶!";
        }