示例#1
0
 /// <summary>
 /// Deletes a single <see cref="NoteComment"/>
 /// </summary>
 /// <param name="id"></param>
 public void Delete(int id)
 {
     using (var repo = new NoteCommentRepository())
     {
         repo.Delete(id);
     }
 }
示例#2
0
 /// <summary>
 /// Saves a single <see cref="NoteComment"/>
 /// </summary>
 /// <param name="noteComment"></param>
 public void Save(NoteComment noteComment)
 {
     using (var repo = new NoteCommentRepository())
     {
         repo.AddOrUpdate(noteComment);
     }
 }
示例#3
0
 /// <summary>
 /// Get a list of <see cref="NoteComment"/> objects based on logtype
 /// </summary>
 /// <param name="logType"></param>
 /// <returns></returns>
 public IEnumerable <NoteComment> GetAll(string logType)
 {
     using (var repo = new NoteCommentRepository())
     {
         return(repo.GetAll(logType));
     }
 }
示例#4
0
 /// <summary>
 /// Get a list of <see cref="NoteComment"/> objects of a given note
 /// </summary>
 /// <param name="noteId"></param>
 /// <returns></returns>
 public IEnumerable <NoteComment> GetByNoteId(int noteId)
 {
     using (var repo = new NoteCommentRepository())
     {
         return(repo.GetAllByNote(noteId));
     }
 }
示例#5
0
 /// <summary>
 /// Deletes all <see cref="NoteComment"/> objects for a given note
 /// </summary>
 /// <param name="noteId"></param>
 public void DeleteByNoteId(int noteId)
 {
     using (var repo = new NoteCommentRepository())
     {
         repo.DeleteByNote(noteId);
     }
 }
示例#6
0
        protected void btnCommentDelete_Click(object sender, EventArgs e)
        {
            var repo = new NoteCommentRepository();

            if (repo.GetCountBy(BoardId, Id, txtPassword.Text.Replace("--", "")) > 0)
            {
                repo.DeleteComment(BoardId, Id, txtPassword.Text.Replace("--", ""));
                Response.Redirect($"BoardView.aspx?Id={BoardId}&ANum={Request["ANum"]}");
            }
            else
            {
                lblError.Text = "암호가 틀립니다. 다시 입력해주세요.";
            }
        }
示例#7
0
 /// <summary>
 /// Add a new <see cref="NoteComment"/>
 /// </summary>
 /// <param name="comment"></param>
 public void Add(int note, int userId, NoteCommentType type, string description)
 {
     using (var repo = new NoteCommentRepository())
     {
         repo.AddOrUpdate(new NoteComment()
         {
             LogType    = type.ToString(),
             LogComment = description,
             Datestamp  = DateTime.Now,
             NoteId     = note,
             UserId     = userId
         });
     }
 }
示例#8
0
 public BoardCommentControl()
 {
     _repository = new NoteCommentRepository();
 }