Example #1
0
 public ActionResult Post(PostCommentModel postcomment)
 {
     Proj12.Views.Shared.JAOBEDataContext db = new Proj12.Views.Shared.JAOBEDataContext();
     int _Id =(from ID in db.Comments select ID.ID).Count()+1;
     db.SubmitChanges();
     return View();
 }
Example #2
0
 public ActionResult UserPost()
 {
     Proj12.Views.Shared.JAOBEDataContext db = new Proj12.Views.Shared.JAOBEDataContext();
     ViewData["Title"] = HttpUtility.HtmlDecode((from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Title).FirstOrDefault());
     ViewData["Time"] = HttpUtility.HtmlDecode(((from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Time).FirstOrDefault()).ToString());
     ViewData["Detail"] = HttpUtility.HtmlDecode((from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Detail).FirstOrDefault().ToString());
     return View();
 }
Example #3
0
 public ViewResult EditPost(PostModel _sendpost)
 {
     Proj12.Views.Shared.JAOBEDataContext db = new Proj12.Views.Shared.JAOBEDataContext();
     var Base = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID).Single();
     Base.Time = DateTime.Now;
     Base.Title = _sendpost.Title;
     Base.Announce = _sendpost.Announce;
     Base.Detail =   _sendpost.Detail;
     db.SubmitChanges();
     return View("../Home/Index");
 }
Example #4
0
 public ViewResult EditPost(GetModel _getpost)
 {
     Proj12.Views.Shared.JAOBEDataContext db = new Proj12.Views.Shared.JAOBEDataContext();
     _getpost.Id = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.ID).FirstOrDefault();
     _getpost._User = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.UserId).FirstOrDefault().ToString();
     _getpost.Time = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Time).FirstOrDefault().ToString();
     _getpost.Title = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Title).FirstOrDefault().ToString();
     _getpost.Announce = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Announce).FirstOrDefault().ToString();
     _getpost.Detail = (from ID in db.Posts where ID.ID == Convert.ToInt32(Request.QueryString["post"]) select ID.Detail).FirstOrDefault().ToString();
     return View(_getpost);
 }