private void Page_Load(object sender, System.EventArgs e) { Utils.SetPageTitle(Page, L10n.Term("Administration.LBL_RENAME_TABS")); // 06/04/2006 Paul. Visibility is already controlled by the ASPX page, but it is probably a good idea to skip the load. this.Visible = SplendidCRM.Security.IS_ADMIN; if (!this.Visible) { return; } // 09/08/2005 Paul. An empty key is valid, so use a separate INSERT field. if (txtRENAME.Value == "1") { try { SqlProcs.spMODULES_TAB_Rename(Guid.Empty, txtKEY.Value, ctlSearch.LANGUAGE, txtVALUE.Value); SplendidCache.ClearList(ctlSearch.LANGUAGE, "moduleList"); // 01/17/2006 Paul. Also need to clear the TabMenu. SplendidCache.ClearTabMenu(); // 04/20/2006 Paul. Also clear the term for the list. L10N.SetTerm(ctlSearch.LANGUAGE, String.Empty, "moduleList", txtKEY.Value, txtVALUE.Value); txtRENAME.Value = ""; // 09/09/2005 Paul. Transfer so that viewstate will be reset completely. // 01/04/2005 Paul. Redirecting to default.aspx will loose the language setting. Just rebind. } catch (Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message); lblError.Text = ex.Message; } } // Must bind in order for LinkButton to get the argument. // ImageButton does not work no matter what I try. TERMINOLOGY_BindData(true); }
protected void Page_Command(object sender, CommandEventArgs e) { try { Guid gID = Sql.ToGuid(e.CommandArgument); if (e.CommandName == "ConfigureTabs.MoveUp") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_ORDER_MoveUp(gID); } else if (e.CommandName == "ConfigureTabs.MoveDown") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_ORDER_MoveDown(gID); } else if (e.CommandName == "ConfigureTabs.Hide") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_Hide(gID); } else if (e.CommandName == "ConfigureTabs.Show") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_Show(gID); } // 01/04/2005 Paul. If the list changes, reset the cached values. Cache.Remove("vwMODULES_TabMenu"); // 06/03/2006 Paul. The tab menu is now user-specific, but we will only clear the current user. SplendidCache.ClearTabMenu(); TERMINOLOGY_BindData(true); } catch (Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex.Message); lblError.Text = ex.Message; } }
protected void Page_Command(object sender, CommandEventArgs e) { try { Guid gID = Sql.ToGuid(e.CommandArgument); if (e.CommandName == "ConfigureTabs.MoveUp") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_ORDER_MoveUp(gID); } else if (e.CommandName == "ConfigureTabs.MoveDown") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_ORDER_MoveDown(gID); } else if (e.CommandName == "ConfigureTabs.Hide") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_Hide(gID); } else if (e.CommandName == "ConfigureTabs.Show") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_Show(gID); } else if (e.CommandName == "ConfigureTabs.HideMobile") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_HideMobile(gID); } else if (e.CommandName == "ConfigureTabs.ShowMobile") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_TAB_ShowMobile(gID); } else if (e.CommandName == "ConfigureTabs.Disable") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_Disable(gID); } else if (e.CommandName == "ConfigureTabs.Enable") { if (Sql.IsEmptyGuid(gID)) { throw(new Exception("Unspecified argument")); } SqlProcs.spMODULES_Enable(gID); } // 01/04/2005 Paul. If the list changes, reset the cached values. Cache.Remove("vwMODULES_TabMenu"); // 06/03/2006 Paul. The tab menu is now user-specific, but we will only clear the current user. SplendidCache.ClearTabMenu(); TERMINOLOGY_BindData(true); // 08/21/2007 Paul. The easiest way to rebuild the current menu is to refresh the page. // 10/02/2007 Paul. Use an AJAX UpdatePanel to reduce whole page repaints. //Response.Redirect("default.aspx"); } catch (Exception ex) { SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex); lblError.Text = ex.Message; } }