예제 #1
0
        public ResponseMessage Edit(Article entity)
        {
            ResponseMessage response = new ResponseMessage();

            _repository.Edit(entity);

            return(response);
        }
예제 #2
0
        //public void Appraise(int articleId, AppraiseModel model)
        //{
        //    Article article = articleRepository.Find(articleId);
        //    article.Appraise = new Appraise
        //    {
        //        IsAgree = model.IsAgree,
        //        Voter = GetCurrentUser()
        //    };
        //    article.Agree(article.Appraise.Voter);
        //    articleRepository.Save(article);
        //}
        public void Edit(int id, EditModel model)
        {
            Article article = articleRepository.Find(id);

            mapper.Map <EditModel, Article>(model, article);

            articleRepository.Edit();
        }
예제 #3
0
파일: ArticleLogic.cs 프로젝트: rikp777/Fit
        /// <summary>
        ///
        ///     Update
        ///
        ///     Right    = Admin, Instructor
        ///
        ///     Exception     = validation
        ///
        /// </summary>
        public bool Edit(int userId, IArticle article)
        {
            if (!UserLogic.CheckRight(userId, Right.Admin) || UserLogic.CheckRight(userId, Right.Instructor))
            {
                return(false);
            }


            if (!validation(article))
            {
                return(false);
            }


            return(_articleRepository.Edit(article));
        }