コード例 #1
0
        public ActionResult EditNavbarItem(FormCollection fc)
        {
            if (!CheckLogin())
            {
                return(RedirectToAction("Index", "Home"));
            }
            int    ID     = Convert.ToInt32(fc["hiddenID"]);
            string Text   = fc["inputText"];
            string Action = fc["inputAction"];
            string Ctrl   = fc["inputController"];

            if (string.IsNullOrEmpty(Text) | string.IsNullOrEmpty(Action) | string.IsNullOrEmpty(Ctrl))
            {
                return(View());
            }
            NavbarItem ni = new NavbarItem
            {
                ID     = ID,
                Text   = Text,
                Action = Action,
                Route  = Ctrl
            };

            db.Entry(ni).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("NavbarSettings"));
        }
コード例 #2
0
 // Mudar Navbar Item
 private void nviPreescricoes_Click(object sender, EventArgs e)
 {
     SelectedNavbarItem.Active = false;
     SelectedNavbarItem        = nviPreescricoes;
     SelectedNavbarItem.Active = true;
     tabSidebar.SelectedTab    = tpPreescricoes;
     tabMain.SelectedTab       = tpLogo;
 }
コード例 #3
0
        //
        // Navbar Index: 5
        // GET: Admin/DeleteNavbarItem
        public ActionResult DeleteNavbarItem(int ID)
        {
            if (!CheckLogin())
            {
                return(RedirectToAction("Index", "Home"));
            }
            NavbarItem ni = db.NavbarItems.Find(ID);

            if (ni != null)
            {
                db.NavbarItems.Remove(ni);
                db.SaveChanges();
            }
            return(RedirectToAction("NavbarSettings"));
        }
コード例 #4
0
        private void navPenalidades_Click(object sender, EventArgs e)
        {
            /*
             * if (!GmpfManager.isSimulated)
             * {
             *  MessageBox.Show("Simule antes de prosseguir.");
             *  return;
             * }
             */

            SelectedNavbarItem.Active = false;
            SelectedNavbarItem        = nviPenalidades;
            SelectedNavbarItem.Active = true;
            tabSidebar.SelectedTab    = tpPenalidades;
            tabMain.SelectedTab       = tpLogo;
        }
コード例 #5
0
        //
        // Navbar Index: 5
        // GET: Admin/PreEditNavbarItem
        public ActionResult PreEditNavbarItem(int ID)
        {
            if (!CheckLogin())
            {
                return(RedirectToAction("Index", "Home"));
            }
            NavbarItem ni = db.NavbarItems.Find(ID);

            if (ni != null)
            {
                if (Request.IsAjaxRequest())
                {
                    return(PartialView("~/Views/Admin/_PartialNavbarItemEditor.cshtml", ni));
                }
            }
            return(RedirectToAction("NavbarSettings"));
        }
コード例 #6
0
 private void InitializeNavbar()
 {
     tabSidebar.SelectedTab    = tpPreescricoes;
     SelectedNavbarItem        = nviPreescricoes;
     SelectedNavbarItem.Active = true;
 }