Exemple #1
0
        public static void UpdateNewsPost(NewsPostEditModel editModel)
        {
            var newsPost = NewsPostService.GetNewsPost(editModel.Id);

            editModel.PassToNewsPost(newsPost);
            NewsPostService.UpdateNewsPost(newsPost);
        }
Exemple #2
0
 public ActionResult EditNews(NewsPostEditModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.uploadFiles != null && model.uploadFiles[0] != null)
         {
             FileModelActions.RemoveFile(model.ImageId, Server);
             model.ImageId = FileModelActions.SaveFile(model.uploadFiles[0], Server);
         }
         if (model.Description == "<br>")
         {
             ModelState.AddModelError("Description", Language.Language.NoDescription);
             return(View(model));
         }
         NewsPostHelper.UpdateNewsPost(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Exemple #3
0
        public ActionResult EditNews(int id)
        {
            NewsPostEditModel newsPostAdminView = NewsPostHelper.GetNewsPostEditModel(id);

            return(View(newsPostAdminView));
        }