Esempio n. 1
0
 public ActionResult EditNews(string Id)
 {
     Api.AdminNews.AdminNews       apiobjNews = new Api.AdminNews.AdminNews();
     Domain.Socioboard.Domain.News ObjNews    = (Domain.Socioboard.Domain.News)(new JavaScriptSerializer().Deserialize(apiobjNews.GetNewsById(Id), typeof(Domain.Socioboard.Domain.News)));
     Session["NewsToUpdate"] = ObjNews;
     return(View(ObjNews));
 }
Esempio n. 2
0
        public ActionResult UpdateNews(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 = (Domain.Socioboard.Domain.News)Session["NewsToUpdate"];
            objNews.NewsDetail = News;
            objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate);
            objNews.Status     = bool.Parse(Status);
            string ObjPackage = (new JavaScriptSerializer().Serialize(objNews));

            Api.AdminNews.AdminNews apiobjNews = new Api.AdminNews.AdminNews();
            string NewsUpdateMessage           = (string)(new JavaScriptSerializer().Deserialize(apiobjNews.UpdateNews(ObjPackage), typeof(string)));

            return(Content(NewsUpdateMessage));
        }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        public ActionResult UpdateNews(string News, string ExpiryDate, string Status)
        {
            Domain.Socioboard.Domain.News objNews = (Domain.Socioboard.Domain.News)Session["NewsToUpdate"];
            objNews.NewsDetail = News;
            objNews.ExpiryDate = Convert.ToDateTime(ExpiryDate);
            objNews.Status     = bool.Parse(Status);
            string ObjPackage = (new JavaScriptSerializer().Serialize(objNews));

            Api.AdminNews.AdminNews apiobjNews = new Api.AdminNews.AdminNews();
            string NewsUpdateMessage           = (string)(new JavaScriptSerializer().Deserialize(apiobjNews.UpdateNews(ObjPackage), typeof(string)));

            return(Content(NewsUpdateMessage));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        public ActionResult EditNews(string Id)
        {
            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"));
            }

            Api.AdminNews.AdminNews       apiobjNews = new Api.AdminNews.AdminNews();
            Domain.Socioboard.Domain.News ObjNews    = (Domain.Socioboard.Domain.News)(new JavaScriptSerializer().Deserialize(apiobjNews.GetNewsById(Id), typeof(Domain.Socioboard.Domain.News)));
            Session["NewsToUpdate"] = ObjNews;
            return(View(ObjNews));
        }
        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);
        }