Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void unSeeGossip(int gossipId)
 {
     GossipService gossipService = new GossipService();
     gossipService.unSeeGossip(gossipId);
 }
Esempio n. 4
0
 public Gossip getNextGossipInLine()
 {
     GossipService gossipService = new GossipService();
     return gossipService.getNextGossipInLine();
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public ActionResult unseeGossip(Gossip gossip)
 {
     var gossipService = new GossipService();
     gossipService.unSeeGossip(gossip.Id);
     return Json(new { success = true });
 }