/// <summary>
 /// 新增Post
 /// </summary>
 /// <param name="postVO">被新增的Post</param>
 /// <returns>新增後的Post</returns>
 public PostVO CreatePost(PostVO postVO)
 {
     postVO = PostDao.CreatePost(postVO);
     if (postVO.SortNo == 0)
     {
         postVO.SortNo = postVO.PostId;
         postVO        = PostDao.UpdatePost(postVO);
     }
     return(postVO);
 }
Exemple #2
0
        public ActionResult Create(BAIDANG bd)
        {
            if (ModelState.IsValid)
            {
                var DAO = new PostDao();
                bd.UrlRequire       = RewriteURL.RewriteUrl(bd.TenBaiDang);
                bd.TrangThaiBaiDang = "chờ duyệt";

                int idtk = int.Parse(Session["USER_ID"].ToString());
                bd.IDTaiKhoan = idtk;
                bd.NgayDang   = DateTime.Now;
                bd.IDBaiDang  = 0;
                long idpost = DAO.CreatePost(bd);
            }
            return(View("MyPost"));
        }
Exemple #3
0
 public ActionResult Create(BAIDANG bd)
 {
     if (ModelState.IsValid)
     {
         var DAO = new PostDao();
         bd.UrlRequire       = RewriteURL.RewriteUrl(bd.TenBaiDang);
         bd.TrangThaiBaiDang = "chờ duyệt";
         int idtk = int.Parse(Session["USER_ID"].ToString());
         bd.IDTaiKhoan = idtk;
         bd.NgayDang   = DateTime.Now;
         bd.IDBaiDang  = 0;
         long idpost = DAO.CreatePost(bd);
     }
     SetAlert("Soạn bài đăng thành công", "thanhcong");
     return(RedirectToAction("PostWaiting", "PostManager"));
 }