public ActionResult DeleteTweet(int tweetid, string id, string username) { ViewBag.Message = "Delete My Tweets."; ViewBag.UserName = username; ViewBag.UserId = id; DemoEntities demo = new DemoEntities(); TblTweet tweet = demo.DisplaySelfTweetByTweetId(tweetid).FirstOrDefault(); return(View(tweet)); }
public ActionResult CreateTweet(TblTweet tweet) { ViewBag.Message = "My Tweets."; ViewBag.UserName = tweet.TweetUserName; ViewBag.UserId = tweet.TweetUserId; DemoEntities demo = new DemoEntities(); tweet.TweetModifiedDate = DateTime.Now; tweet.TweetDeleted = false; demo.TblTweets.Add(tweet); demo.SaveChanges(); return(MyTweets(tweet.TweetUserId.ToString(), tweet.TweetUserName)); }
public ActionResult UpdateTweet(TblTweet tweet) { ViewBag.Message = "My Tweets."; ViewBag.UserName = tweet.TweetUserName; ViewBag.UserId = tweet.TweetUserId; DemoEntities demo = new DemoEntities(); ObjectResult <TblTweet> list = demo.UpdateTweet(tweet.TweetText, tweet.TweetId, tweet.TweetUserId); Tweets tuser = TweetLists(tweet.TweetUserId.ToString(), tweet.TweetUserName, list); ViewBag.UserName = tweet.TweetUserName; ViewBag.UserId = tweet.TweetUserId; return(View("MyTweets", tuser)); }
public ActionResult CreateTweet(string id, string username) { ViewBag.Message = "Create My Tweets."; ViewBag.UserName = username; ViewBag.UserId = id; DemoEntities demo = new DemoEntities(); TblTweet tweet = new TblTweet(); tweet.TweetUserName = username; tweet.TweetUserId = Convert.ToInt32(id); tweet.TweetModifiedDate = DateTime.Now; tweet.TweetDeleted = false; demo.TblTweets.Add(tweet); return(View(tweet)); }