public ActionResult GetGossip() { var gossipService = new GossipService(); var allGossip = gossipService.getAllGossip(); var allGossipJson = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(allGossip); return Json(allGossipJson, JsonRequestBehavior.AllowGet); }
public ActionResult DeclineGossip(FormCollection collection) { string gossipId = collection["gossipId"]; int gossipID = Int32.Parse(gossipId); var gossipService = new GossipService(); gossipService.DeclineGossipById(gossipID); return Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri); }
public void unSeeGossip(int gossipId) { GossipService gossipService = new GossipService(); gossipService.unSeeGossip(gossipId); }
public Gossip getNextGossipInLine() { GossipService gossipService = new GossipService(); return gossipService.getNextGossipInLine(); }
public ActionResult PostGossip(FormCollection collection) { string userId = collection["userId"]; string content = collection["content"]; string radio = collection["category"]; int category = 0; if (radio == "1") { category = 1; } else if (radio == "2") { category = 2; } else if (radio == "3") { category = 3; } var newGossip = new Gossip(); newGossip.category = category; newGossip.content = content; newGossip.dateCreated = DateTime.Now; newGossip.isAccepted = false; newGossip.isSeen = false; newGossip.isDeclined = false; var gossipService = new GossipService(); gossipService.AddNewGossipToQueue(newGossip); return Redirect(HttpContext.Request.UrlReferrer.AbsoluteUri); }
public ActionResult unseeGossip(Gossip gossip) { var gossipService = new GossipService(); gossipService.unSeeGossip(gossip.Id); return Json(new { success = true }); }