public ActionResult PostDetail(GeneralDTO model)
        {
            if (model.Name != null && model.Email != null && model.Message != null)
            {
                if (postbll.AddComment(model))
                {
                    ViewData["CommentState"] = "Success";
                    ModelState.Clear();
                }
                else
                {
                    ViewData["CommentState"] = "Error";
                }
            }
            else
            {
                ViewData["CommentState"] = "Error";
            }
            HomeLayoutDTO layoutdto = new HomeLayoutDTO();

            layoutdto             = layoutbll.GetLayoutData();
            ViewData["LayoutDTO"] = layoutdto;
            GeneralDTO dto = new GeneralDTO();

            model = bll.GetPostDetailPageItemsWithID(model.PostID);
            return(View(model));
        }
コード例 #2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     _postBLL.AddComment(Text.Text, _postId);
     this.Close();
 }