public ActionResult AddNews(string News, string ExpiryDate, string Status) { Domain.Socioboard.Domain.News objNews = new Domain.Socioboard.Domain.News(); objNews.NewsDetail = News; objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate); objNews.Status = bool.Parse(Status); objNews.Id = Guid.NewGuid(); string ObjPackage = (new JavaScriptSerializer().Serialize(objNews)); Api.AdminNews.AdminNews objApiNews = new Api.AdminNews.AdminNews(); string NewsAddedMessage = (string)(new JavaScriptSerializer().Deserialize(objApiNews.AddNews(ObjPackage,News), typeof(string))); return Content(NewsAddedMessage); }
public ActionResult AddNews(string News, string ExpiryDate, string Status) { Domain.Socioboard.Domain.News objNews = new Domain.Socioboard.Domain.News(); objNews.NewsDetail = News; objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate); objNews.Status = bool.Parse(Status); objNews.Id = Guid.NewGuid(); string ObjPackage = (new JavaScriptSerializer().Serialize(objNews)); Api.AdminNews.AdminNews objApiNews = new Api.AdminNews.AdminNews(); string NewsAddedMessage = (string)(new JavaScriptSerializer().Deserialize(objApiNews.AddNews(ObjPackage, News), typeof(string))); return(Content(NewsAddedMessage)); }
public ActionResult AddNews(string News, string ExpiryDate, string Status) { if (Session["User"] != null) { Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"]; if (_User.UserType != "SuperAdmin") { return(RedirectToAction("Index", "Index")); } } else { return(RedirectToAction("Index", "Index")); } Domain.Socioboard.Domain.News objNews = new Domain.Socioboard.Domain.News(); objNews.NewsDetail = News; objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate); objNews.Status = bool.Parse(Status); objNews.Id = Guid.NewGuid(); string ObjPackage = (new JavaScriptSerializer().Serialize(objNews)); Api.AdminNews.AdminNews objApiNews = new Api.AdminNews.AdminNews(); string NewsAddedMessage = (string)(new JavaScriptSerializer().Deserialize(objApiNews.AddNews(ObjPackage, News), typeof(string))); return(Content(NewsAddedMessage)); }
public ActionResult AddNews(string News, string ExpiryDate, string Status) { if (Session["User"] != null) { Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"]; if (_User.UserType != "SuperAdmin") { return RedirectToAction("Index", "Index"); } } else { return RedirectToAction("Index", "Index"); } Domain.Socioboard.Domain.News objNews = new Domain.Socioboard.Domain.News(); objNews.NewsDetail = News; objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate); objNews.Status = bool.Parse(Status); objNews.Id = Guid.NewGuid(); string ObjPackage = (new JavaScriptSerializer().Serialize(objNews)); Api.AdminNews.AdminNews objApiNews = new Api.AdminNews.AdminNews(); string NewsAddedMessage = (string)(new JavaScriptSerializer().Deserialize(objApiNews.AddNews(ObjPackage,News), typeof(string))); return Content(NewsAddedMessage); }