Пример #1
0
 public ActionResult Create(NewsFeed mess)
 {
     if (mess.Message != "" || mess.Message != null)
     {
         NewsFeed.CreateNews(mess);
         return RedirectToAction("Index");
     }
     else {
         return View();
     }
 }
Пример #2
0
 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));
 }