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")); }
// 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; }
// // 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")); }
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; }
// // 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")); }
private void InitializeNavbar() { tabSidebar.SelectedTab = tpPreescricoes; SelectedNavbarItem = nviPreescricoes; SelectedNavbarItem.Active = true; }