public ActionResult Create(NewsFeed mess) { if (mess.Message != "" || mess.Message != null) { NewsFeed.CreateNews(mess); return RedirectToAction("Index"); } else { return View(); } }
public static void CreateNews(NewsFeed mess) { Database.ModifyData("INSERT INTO tbl_news (News,EntryDate) VALUES (@news,@date)",Database.AddParameter("@news",mess.Message), Database.AddParameter("@date",DateTime.Now)); }