コード例 #1
0
ファイル: NewsController.cs プロジェクト: netun0/socioboard
 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));
 }
コード例 #2
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);
 }
コード例 #3
0
ファイル: NewsController.cs プロジェクト: netun0/socioboard
        public ActionResult LoadNews()
        {
            Api.AdminNews.AdminNews apiobjNews = new Api.AdminNews.AdminNews();
            List <Domain.Socioboard.Domain.News> lstPackage = (List <Domain.Socioboard.Domain.News>)(new JavaScriptSerializer().Deserialize(apiobjNews.GetAllNews(), typeof(List <Domain.Socioboard.Domain.News>)));

            return(View("_ManageNewsPartial", lstPackage));
        }
コード例 #4
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));
        }
コード例 #5
0
        public ActionResult LoadNews()
        {
            Api.AdminNews.AdminNews apiobjNews = new Api.AdminNews.AdminNews();
            List<Domain.Socioboard.Domain.News> lstPackage = (List<Domain.Socioboard.Domain.News>)(new JavaScriptSerializer().Deserialize(apiobjNews.GetAllNews(), typeof(List<Domain.Socioboard.Domain.News>)));

            return View("_ManageNewsPartial", lstPackage);
        }
コード例 #6
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);
 }
コード例 #7
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);
 }
コード例 #8
0
ファイル: NewsController.cs プロジェクト: netun0/socioboard
        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));
        }
コード例 #9
0
ファイル: NewsController.cs プロジェクト: netun0/socioboard
        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));
        }
コード例 #10
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));
        }
コード例 #11
0
        public ActionResult LoadNews()
        {
            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();
            List <Domain.Socioboard.Domain.News> lstPackage = (List <Domain.Socioboard.Domain.News>)(new JavaScriptSerializer().Deserialize(apiobjNews.GetAllNews(), typeof(List <Domain.Socioboard.Domain.News>)));

            return(View("_ManageNewsPartial", lstPackage));
        }
コード例 #12
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);
        }
コード例 #13
0
        public ActionResult LoadNews()
        {
            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();
            List<Domain.Socioboard.Domain.News> lstPackage = (List<Domain.Socioboard.Domain.News>)(new JavaScriptSerializer().Deserialize(apiobjNews.GetAllNews(), typeof(List<Domain.Socioboard.Domain.News>)));

            return View("_ManageNewsPartial", lstPackage);
        }
コード例 #14
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);
        }