Пример #1
0
 public void Update(Article article)
 {
     Article selectedArticle = _articles.Find(article.Id);
     selectedArticle.Body = article.Body;
     selectedArticle.Category = article.Category;
     selectedArticle.CommentStatus = article.CommentStatus;
     selectedArticle.Description = article.Description;
     selectedArticle.EditedByUser = article.EditedByUser;
     selectedArticle.Keyword = article.Keyword;
     selectedArticle.ModifiedDate = article.ModifiedDate;
     selectedArticle.Status = article.Status;
     selectedArticle.Title = article.Title;
 }
Пример #2
0
 public virtual ActionResult Edit(AddUpdateArticleModel model)
 {
     var selectedArticle = new Article
     {
         Body = model.Body.ToSafeHtml(),
         Category = _categoryService.Find(model.CategoryId),
         CommentStatus = model.CommentStatus,
         Description = model.Description,
         EditedByUser = _userService.Find(User.Identity.Name),
         Id = model.Id,
         Keyword = model.Keywords,
         ModifiedDate = DateAndTime.GetDateTime(),
         Status = model.ArticleStatus,
         Title = model.Title,
     };
     _articleService.Update(selectedArticle);
     _uow.SaveChanges();
     return PartialView(MVC.Admin.Shared.Views._Alert,
         new Alert { Message = "مطلب مورد نظر با موفقیت ویرایش شد", Mode = AlertMode.Success });
 }
Пример #3
0
 public void Add(Article article)
 {
     _articles.Add(article);
 }