示例#1
0
 public ApplicationUserCommentModel(ApplicationUserComment model, bool isInOkRole = true)
 {
     ToId       = model.ToUserId;
     FromId     = model.FromUserId;
     Comment    = model.Comment;
     IsInOkRole = isInOkRole;
 }
示例#2
0
        public IActionResult KullaniciYorumEkle(Guid PeopleNewsId, string ApplicationComment)
        {
            var userId = User.Claims.FirstOrDefault(c => c.Type == "Id").Value;
            var model  = UnitOfWork.ApplicationUserDal.GetById(Guid.Parse(userId));

            if (UnitOfWork.ApplicationUserCommentDal.GetQueryable().FirstOrDefault(p => p.PeopleId == PeopleNewsId && p.ApplicationUserId == model.Id) == null)
            {
                var applicationUserComment = new ApplicationUserComment()
                {
                    Id                = model.Id,
                    Comment           = ApplicationComment,
                    PeopleId          = PeopleNewsId,
                    İsActive          = false,
                    ApplicationUser   = model,
                    ApplicationUserId = model.Id
                };
                UnitOfWork.ApplicationUserCommentDal.Add(applicationUserComment);
                UnitOfWork.Commit();
            }
            return(RedirectToAction("SinglePage", "Anasayfa", new { Id = PeopleNewsId }));
        }
示例#3
0
 public async Task <IActionResult> ChangeCommentAdmin([Bind("FromUserId,ToUserId,Comment")] ApplicationUserComment appComment)
 {
     return(await ChangeComment(new ApplicationUserCommentModel {
         FromId = appComment.FromUserId, ToId = appComment.ToUserId, Comment = appComment.Comment, IsInOkRole = true
     }));
 }