Exemplo n.º 1
0
        public void EditPage(StaticPage staticPage)
        {
            using (SqlConnection cn = new SqlConnection(Settings.ConnectionString))
            {
                var p = new DynamicParameters();

                try
                {
                    p.Add("StaticPageID", staticPage.StaticPageID);
                    p.Add("ButtonName", staticPage.ButtonName);
                    p.Add("UserID", staticPage.UserID);
                    p.Add("Body", staticPage.Body);

                    cn.Execute("EditPage", p, commandType: CommandType.StoredProcedure);

                }
                //catch (Exception e)
                //{
                //    // Write failure to database
                //    var ep = new DynamicParameters();

                //    ep.Add("ExceptionType", e.GetType());
                //    ep.Add("ExceptionMessage", e.Message);
                //    cn.Execute("AddError", ep, commandType: CommandType.StoredProcedure);
                //}
                finally
                {
                    cn.Close();
                }
            }
        }
Exemplo n.º 2
0
        public ActionResult EditPage(StaticPage page)
        {
            var update = new FITlosophiOperations();

            update.EditPage(page);

            return View("ManagePages");
        }
Exemplo n.º 3
0
        public void AddStaticPage()
        {
            StaticPage newpage = new StaticPage();

            newpage.ButtonName = "Koshin Test Page";
            newpage.UserID = "b75da91b-e39a-42ce-b2f0-4834eda139e1";
            newpage.Body = "Test page body";

            var result = Createrepo.AddStaticPage(newpage);
            var pages = Readrepo.GetAllPageSummaries();
            var page = pages.FirstOrDefault(p => p.StaticPageID == result);

            Assert.AreEqual(page.StaticPageID, result);
        }
Exemplo n.º 4
0
        public void EditPage()
        {
            StaticPage newpage = new StaticPage();

            newpage.StaticPageID = 1;
            newpage.ButtonName = "Koshin";
            newpage.UserID = "b75da91b-e39a-42ce-b2f0-4834eda139e1";
            newpage.Body = "days today";

            Updaterepo.EditPage(newpage);

            var newbody = Readrepo.GetPageByID(1);

            Assert.AreEqual("days today", newbody.Body);
        }
Exemplo n.º 5
0
        public void EditPage(StaticPage StaticPage)
        {
            var update = new FITlosophiOperations();

               update.EditPage(StaticPage);
        }
Exemplo n.º 6
0
        public ActionResult PostPage(StaticPage page)
        {
            var create = new FITlosophiOperations();

            create.AddStaticPage(page);

            if (User.IsInRole("Admin"))
            {
                return View("ManagePages");
            }

            return RedirectToAction("Index", "Home");
        }
        public void EditPage(StaticPage staticPage)
        {
            var update = new Update();

            update.EditPage(staticPage);
        }
 public void AddStaticPage(StaticPage staticPage)
 {
     var create = new Create();
     create.AddStaticPage(staticPage);
 }