Exemplo n.º 1
0
        public Topic UpdateTopic(Topic topic)
        {
            var exits = repository.GetByCondition(x => x.TopicId.Equals(topic.TopicId));

            if (exits != null)
            {
                exits.TopicName = topic.TopicName;
                repository.Update(exits);
            }
            return(null);
        }
Exemplo n.º 2
0
        public Account UpdateAccount(Account account)
        {
            var exits = repository.GetByCondition(x => x.UserId.Equals(account.UserId));

            if (exits != null)
            {
                exits.UserId      = account.UserId;
                exits.AccountName = account.AccountName;
                exits.Active      = account.Active;
                exits.Password    = account.Password;
                repository.Update(exits);
            }
            return(exits);
        }
Exemplo n.º 3
0
        public Feedback UpdateFeedback(Feedback feedback)
        {
            var exits = repository.GetByCondition(x => x.FeedbackId.Equals(feedback.FeedbackId));

            if (exits != null)
            {
                exits.Email       = feedback.Email;
                exits.Time        = feedback.Time;
                exits.Description = feedback.Description;
                exits.AccountId   = feedback.AccountId;
                repository.Update(exits);
            }
            return(null);
        }
Exemplo n.º 4
0
        public Newspaper UpdateNewspaper(Newspaper newspaper)
        {
            var exits = repository.GetByCondition(x => x.NewsId.Equals(newspaper.NewsId));

            if (exits != null)
            {
                exits.PublicationDate = newspaper.PublicationDate;
                exits.Journalist      = newspaper.Journalist;
                exits.Description     = newspaper.Description;
                exits.Active          = newspaper.Active;
                exits.Title           = newspaper.Title;
                repository.Update(exits);
            }
            return(null);
        }
Exemplo n.º 5
0
        public User UpdateUser(User user)
        {
            var exits = repository.GetByCondition(x => x.UserId.Equals(user.UserId));

            if (exits != null)
            {
                exits.UserName    = user.UserName;
                exits.Email       = user.Email;
                exits.DateOfBirth = user.DateOfBirth;
                exits.Gender      = user.Gender;
                exits.Role        = user.Role;
                exits.Phone       = user.Phone;
                repository.Update(exits);
            }
            return(null);
        }
Exemplo n.º 6
0
        public Comment UpdateComment(Comment comment)
        {
            var exits = repository.GetByCondition(x => x.CommentId.Equals(comment.CommentId));

            if (exits != null)
            {
                exits.Time        = comment.Time;
                exits.Role        = comment.Role;
                exits.NewsId      = comment.NewsId;
                exits.Image       = comment.Image;
                exits.Description = comment.Description;
                exits.AccountName = comment.AccountName;
                exits.Active      = comment.Active;
                repository.Update(exits);
            }
            return(null);
        }
Exemplo n.º 7
0
 public User GetUserById(int id)
 {
     return(repository.GetByCondition(x => x.UserId == id));
 }
 public Account GetAccountByJournalist(int user)
 {
     return(repository.GetByCondition(x => x.UserId == user));
 }