/// <summary> /// The tlbPath callback event handler. /// </summary> protected void tlbPath_CallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "AddFav" && PXSiteMap.CurrentNode != null) { Guid nodeID = PXSiteMap.CurrentNode.NodeID; if (!IsInFavorites(nodeID)) { AddFavorite(screenTitle, nodeID); } else { PXDatabase.Delete <Favorite>( new PXDataFieldRestrict("UserID", PXAccess.GetUserID()), new PXDataFieldRestrict("SiteMapID", nodeID) ); } PXContext.Session.FavoritesExists["FavoritesExists"] = null; PXSiteMap.FavoritesProvider.Clear(); // check if favorites exists using (PXDataRecord exist = PXDatabase.SelectSingle <Favorite>( new PXDataField("UserID"), new PXDataFieldValue("UserID", PXAccess.GetUserID()))) { e.Result = (exist == null) ? "0" : "1"; } } }
//private static void AppendVariable(StringBuilder script, Control c) //{ // StringBuilder n = new StringBuilder(c.ID + "Id"); // n[0] = char.ToLower(n[0]); // script.AppendFormat("var {0}='{1}';", n, c.ClientID); //} protected void ResizeHanler_CallBack(object sender, PXCallBackEventArgs e) { //string[] pair = e.Argument.Split('>'); //string cmd = pair[0]; //string props = pair[1]; //WebsiteEntryPoints.ParseCallback(cmd, props); }
/// <summary> /// The tlbPath callback event handler. /// </summary> protected void tlbPath_CallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "AddFav" && PXSiteMap.CurrentNode != null) { var currentNode = PXSiteMap.CurrentNode; var entryScreenId = GetEntryNodeId(currentNode.ScreenID); if (!IsInFavoritesLegacy(entryScreenId)) { screenRepository.SetFavoriteForScreen(entryScreenId, true); } else { screenRepository.SetFavoriteForScreen(entryScreenId, false); } PXContext.Session.FavoritesExists["FavoritesExists"] = null; PXSiteMap.FavoritesProvider.Clear(); // check if favorites exists using (PXDataRecord exist = PXDatabase.SelectSingle <Favorite>( new PXDataField("UserID"), new PXDataFieldValue("UserID", PXAccess.GetUserID()))) { e.Result = (exist == null) ? "0" : "1"; } } }
protected void edValue_InternalFieldsNeeded(object sender, PXCallBackEventArgs e) { List <string> res = new List <string>(); SYExportMaint graph = (SYExportMaint)this.ds.DataGraph; if (graph.Mappings.Current == null || string.IsNullOrEmpty(graph.Mappings.Current.ScreenID)) { return; } PXSiteMap.ScreenInfo info = ScreenUtils.GetScreenInfo(graph.Mappings.Current.ScreenID); Dictionary <string, bool> addedViews = new Dictionary <string, bool>(); foreach (string viewname in info.Containers.Keys) { int index = viewname.IndexOf(": "); if (index != -1 && addedViews.ContainsKey(viewname.Substring(0, index))) { continue; } addedViews.Add(viewname, true); foreach (PX.Data.Description.FieldInfo field in info.Containers[viewname].Fields) { res.Add("[" + viewname + "." + field.FieldName + "]"); } } e.Result = string.Join(";", res.ToArray()); }
protected void grid_CallBack(object sender, PXCallBackEventArgs e) { var tree = sp1.FindControl("tree") as PXTreeView; var grid = sp1.FindControl("grid") as PXGrid; string moveGridCursor = ""; PX.SM.WikiPageMapMaintenance graph = this.ds.DataGraph as PX.SM.WikiPageMapMaintenance; if (graph == null) { return; } if (e.Command.Name == "RowDown") { MoveRow(graph, true); moveGridCursor = "|" + grid.ClientID + "|down"; } else if (e.Command.Name == "RowUp") { MoveRow(graph, false); moveGridCursor = "|" + grid.ClientID + "|up"; } e.Result = tree.ClientID + "|" + tree.SelectedValue + moveGridCursor; PXSiteMap.WikiProvider.Clear(); }
protected void CustomizationContextMenu_CallBack(object sender, PXCallBackEventArgs e) { //string item = e.Argument; //if (item.StartsWith("Add")) //{ // string controlType = item.Remove(0, "Add".Length); // WebsiteEntryPoints.AddContainer(controlType); //} }
protected void edField_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { GenericInquiryDesigner graph = this.ds.DataGraph as GenericInquiryDesigner; if (graph != null) { e.Result = string.Join(";", graph.GetAllFields()); } }
protected void edValue_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { AUWorkflowFormsMaint graph = this.ds.DataGraph as AUWorkflowFormsMaint; if (graph != null) { var fields = graph.GetFields(); e.Result = string.Join(";", fields); } }
protected void edValue_SubstitutionKeysNeeded(object sender, PXCallBackEventArgs e) { var res = new List <string>(); foreach (SYSubstitution substitution in PXSelect <SYSubstitution> .Select(this.ds.DataGraph)) { res.Add("'" + substitution.SubstitutionID + "'"); } e.Result = string.Join(";", res); }
protected void GlobalSearchCaption_Change(object sender, PXCallBackEventArgs e) { if (!string.IsNullOrEmpty(Request.RawUrl)) { string path = PXUrl.SiteUrlWithPath(); var url = ""; switch (GlobalSearchCaption.SelectedIndex) { case 0: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=1" + "&globalsearchcaption=" + GlobalSearchCaption.SelectedIndex.ToString(); throw new Exception("Redirect0:" + url); case 1: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Entity.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + GlobalSearchCaption.SelectedIndex.ToString(); throw new Exception("Redirect0:" + url); case 2: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/File.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + GlobalSearchCaption.SelectedIndex.ToString(); throw new Exception("Redirect0:" + url); case 3: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Note.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + GlobalSearchCaption.SelectedIndex.ToString(); throw new Exception("Redirect0:" + url); case 4: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/FormsTitle.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + GlobalSearchCaption.SelectedIndex.ToString(); throw new Exception("Redirect0:" + url); } } }
protected void edValue_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { GenericInquiryDesigner graph = this.ds.DataGraph as GenericInquiryDesigner; if (graph != null) { String[] fields = graph.GetAllFields(); String[] parameters = graph.GetAllParameters(); e.Result = string.Join(";", parameters.Concat(fields)); } }
protected void edOns_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { GenericInquiryDesigner graph = this.ds.DataGraph as GenericInquiryDesigner; if (graph != null) { String[] fields = graph.GetVisibleFields(); String[] parameters = graph.GetAllParameters(); e.Result = string.Join(";", parameters.Concat(fields)); } }
protected void edValue_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { AUWorkflowMaint graph = this.ds.DataGraph as AUWorkflowMaint; if (graph != null) { var formulaEdit = sender as PXFormulaCombo; var fields = graph.GetFieldsAndParams(formulaEdit != null && formulaEdit.Parameters.Contains("UseParentAction")); e.Result = string.Join(";", fields); } }
private void navigate_CallBack_Files(object sender, PXCallBackEventArgs e) { PXButton btn = (PXButton)sender; if (string.IsNullOrEmpty(btn.CommandName)) { return; } NavHandlerFiles(btn.CommandName); }
protected void OrderCaption_OrderChange(object sender, PXCallBackEventArgs e) { if (!string.IsNullOrEmpty(Request.RawUrl)) { string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/WikiSP.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderCaption.Value; throw new Exception("Redirect0:" + url); } }
protected void edValue_ExternalFieldsNeeded(object sender, PXCallBackEventArgs e) { List<string> res = new List<string>(); foreach (SYProviderField field in PXSelect<SYProviderField, Where<SYProviderField.providerID, Equal<Current<SYMapping.providerID>>, And<SYProviderField.objectName, Equal<Current<SYMapping.providerObject>>, And<SYProviderField.isActive, Equal<True>>>>, OrderBy<Asc<SYProviderField.displayName>>>.Select(this.ds.DataGraph)) { res.Add("[" + field.Name + "]"); } e.Result = string.Join(";", res.ToArray()); }
protected void edValue_ExternalFieldsNeeded(object sender, PXCallBackEventArgs e) { List <string> res = new List <string>(); foreach (SYProviderField field in PXSelect <SYProviderField, Where <SYProviderField.providerID, Equal <Current <SYMapping.providerID> >, And <SYProviderField.objectName, Equal <Current <SYMapping.providerObject> >, And <SYProviderField.isActive, Equal <True> > > >, OrderBy <Asc <SYProviderField.displayName> > > .Select(this.ds.DataGraph)) { res.Add("[" + field.Name + "]"); } e.Result = string.Join(";", res.ToArray()); }
protected void edValue_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { var graph = this.ds.DataGraph as AUScreenConditionMaint; if (graph != null) { var fields = graph.GetFields(); if (fields == null) { return; } e.Result = string.Join(";", fields.Select(it => it.Item1).Union(graph.GetParameters())); } }
protected void PXToolBar1_CallBack(object sender, PXCallBackEventArgs e) { var tree = sp1.FindControl("tree") as PXTreeView; string nodeToPopulate = ""; tree.DataBind(); if (e.Command.Name == "left") nodeToPopulate = NodeLeft(); else if (e.Command.Name == "right") nodeToPopulate = NodeRight(); else if (e.Command.Name == "paste") nodeToPopulate = PasteArticles(); e.Result = tree.ClientID + "|" + nodeToPopulate; PXSiteMap.WikiProvider.Clear(); }
protected void edValue_InternalFieldsNeeded(object sender, PXCallBackEventArgs e) { var graph = (SYImportMaint)this.ds.DataGraph; if (graph.Mappings.Current == null || string.IsNullOrEmpty(graph.Mappings.Current.ScreenID)) { return; } var info = ScreenUtils.GetScreenInfo(graph.Mappings.Current.ScreenID); var res = info.Containers.Select( c => new { container = c, viewName = c.Key.Split(new[] { ": " }, StringSplitOptions.None)[0] }) .SelectMany(t => info.Containers[t.container.Key].Fields, (t, field) => "[" + t.viewName + "." + field.FieldName + "]").Distinct(); e.Result = string.Join(";", res.ToArray()); }
protected void cmdCheckMailSettings_CallBack(object sender, PXCallBackEventArgs e) { try { ((SMAccessPersonalMaint)ds.DataGraph).getCalendarSyncUrl( new PXAdapter(ds.DataGraph.Views[ds.PrimaryView])); } catch (PXDialogRequiredException ex) { if (_getSyncUrlMethod != null) { ex.SetMessage((string)_getSyncUrlMethod.Invoke(null, new object[] { Page.Request.Url.Scheme, Page.Request.Url.Host, Page.Request.ApplicationPath, ex.Message })); ex.DataSourceID = ds.ID; } throw ex; } }
/// <summary> /// The data source toolbar callback event handler. /// </summary> void toolBar_CallBack(object sender, PXCallBackEventArgs e) { var grid = sp1.FindControl("grid") as PXGrid; if (e.Command.Name == "Save") { PX.SM.FavoritesMaintenance fv = ds.DataGraph as PX.SM.FavoritesMaintenance; PXAdapter adapter = new PXAdapter(fv.Views[ds.PrimaryView]); adapter.SortColumns = null; adapter.Descendings = null; adapter.Searches = null; adapter.Filters = null; adapter.StartRow = 0; adapter.MaximumRows = grid.PageSize; adapter.TotalRequired = true; foreach (object r in fv.SaveFavorites.Press(adapter)) { break; } PXSiteMap.FavoritesProvider.Clear(); e.Result = PXSiteMap.FavoritesProvider.FavoritesExists() ? "1" : "0"; PXContext.Session.FavoritesExists["FavoritesExists"] = null; } }
protected void edValue_InternalFieldsNeeded(object sender, PXCallBackEventArgs e) { List<string> res = new List<string>(); SYExportMaint graph = (SYExportMaint)this.ds.DataGraph; if (graph.Mappings.Current == null || string.IsNullOrEmpty(graph.Mappings.Current.ScreenID)) return; PXSiteMap.ScreenInfo info = PXSiteMap.ScreenDescriptors[graph.Mappings.Current.ScreenID]; Dictionary<string, bool> addedViews = new Dictionary<string, bool>(); foreach (string viewname in info.Containers.Keys) { int index = viewname.IndexOf(": "); if (index != -1 && addedViews.ContainsKey(viewname.Substring(0, index))) continue; addedViews.Add(viewname, true); foreach (PX.Data.Description.FieldInfo field in info.Containers[viewname].Fields) res.Add("[" + viewname + "." + field.FieldName + "]"); } e.Result = string.Join(";", res.ToArray()); }
/// <summary> /// The tlbPath callback event handler. /// </summary> protected void tlbPath_CallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "AddFav" && PXSiteMap.CurrentNode != null) { Guid nodeID = PXSiteMap.CurrentNode.NodeID; if (!IsInFavorites(nodeID)) { AddFavorite(screenTitle, nodeID); } else { PXDatabase.Delete <Favorite>( new PXDataFieldRestrict("UserID", PXAccess.GetUserID()), new PXDataFieldRestrict("SiteMapID", nodeID) ); } PXContext.Session.FavoritesExists["FavoritesExists"] = null; PXSiteMap.FavoritesProvider.Clear(); // check if favorites exists using (PXDataRecord exist = PXDatabase.SelectSingle <Favorite>( new PXDataField("UserID"), new PXDataFieldValue("UserID", PXAccess.GetUserID()))) { e.Result = (exist == null) ? "0" : "1"; } } else if (e.Command.Name == "ClearFilter") { var ds = PXPage.GetDefaultDataSource(this.Page); if (ds != null) { var action = ds.DataGraph.Actions[clearFilterCommand]; if (action != null) { action.Press(); } } PXCallbackManager.RegisterJavaScript( "if (window['__px_alls'] && __px_alls(this) && __px_alls(this)['tlbPath'])__px_alls(this)['tlbPath'].items['clearFilter'].setVisible(false);"); } }
//--------------------------------------------------------------------------- protected void tlbTools_CallBack(object sender, PXCallBackEventArgs e) { if (e.Argument == "refresh") { if (!PXSiteMap.IsPortal || !Page.Request.Path.ToLower().Contains("reportlauncher")) { Session.Remove(VirtualPathUtility.ToAbsolute(Page.Request.Path)); RefreshByRedirect(); } } if (e.Argument == "help") { throw new Exception("Redirect:" + HelpUrl); } if (e.Command.Name == "auditHistory") { btnAuditDetails_CallBack(sender, e); } }
/// <summary> /// The tlbPath callback event handler. /// </summary> protected void tlbPath_CallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "AddFav" && PXSiteMap.CurrentNode != null) { var currentNode = PXSiteMap.CurrentNode; var entryScreenId = GetEntryNodeId(currentNode.ScreenID); if (!IsInFavorites(entryScreenId)) { screenRepository.SetFavoriteForScreen(entryScreenId, true); } else { screenRepository.SetFavoriteForScreen(entryScreenId, false); } PXContext.Session.FavoritesExists["FavoritesExists"] = null; // check if favorites exists e.Result = IsInFavorites(entryScreenId) ? "0" : "1"; } }
protected void PXToolBar1_CallBack(object sender, PXCallBackEventArgs e) { var tree = sp1.FindControl("tree") as PXTreeView; string nodeToPopulate = ""; tree.DataBind(); if (e.Command.Name == "left") { nodeToPopulate = NodeLeft(); } else if (e.Command.Name == "right") { nodeToPopulate = NodeRight(); } else if (e.Command.Name == "paste") { nodeToPopulate = PasteArticles(); } e.Result = tree.ClientID + "|" + nodeToPopulate; PXSiteMap.WikiProvider.Clear(); }
protected void btnAuditDetails_CallBack(object sender, PXCallBackEventArgs e) { if (this.Page is PXPage) { PXDataSource datasource = ((PXPage)this.Page).DefaultDataSource; if (datasource != null) { String key = PX.Data.Process.PXAuditHelper.CollectAudit(datasource.DataGraph, datasource.PrimaryView); String message = null; if (key != null) { message = String.Concat("Redirect4:", ResolveUrl("~/frames/audit.aspx"), "?key=", key, "&preserveSession=true"); } else { message = PX.Data.ErrorMessages.AuditNotAvailable; } throw new Exception(message); } } }
//--------------------------------------------------------------------------- protected void tlbTools_CallBack(object sender, PXCallBackEventArgs e) { if (e.Argument == "refresh") { if (!PXSiteMap.IsPortal || !Page.Request.Path.ToLower().Contains("reportlauncher")) { Session.Remove(VirtualPathUtility.ToAbsolute(Page.Request.Path)); RefreshByRedirect(); } } if (e.Argument == "help") { throw new Exception("Redirect:" + HelpUrl); } if (e.Command.Name == "updateFileMenu") { PXToolBarButton btn = this.GetAttachedFiles(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < btn.MenuItems.Count - 3; i++) { sb.Append(btn.MenuItems[i].Text); sb.Append("\t"); sb.Append(btn.MenuItems[i].NavigateUrl); sb.Append("\t"); sb.Append(btn.MenuItems[i].Target); sb.Append("\t"); sb.Append(btn.MenuItems[i].Value); sb.Append(";"); } e.Result = sb.ToString(); } if (e.Command.Name == "auditHistory") { btnAuditDetails_CallBack(sender, e); } }
protected void grid_CallBack(object sender, PXCallBackEventArgs e) { var tree = sp1.FindControl("tree") as PXTreeView; var grid = sp1.FindControl("grid") as PXGrid; string moveGridCursor = ""; PX.SM.WikiPageMapMaintenance graph = this.ds.DataGraph as PX.SM.WikiPageMapMaintenance; if (graph == null) return; if (e.Command.Name == "RowDown") { MoveRow(graph, true); moveGridCursor = "|" + grid.ClientID + "|down"; } else if (e.Command.Name == "RowUp") { MoveRow(graph, false); moveGridCursor = "|" + grid.ClientID + "|up"; } e.Result = tree.ClientID + "|" + tree.SelectedValue + moveGridCursor; PXSiteMap.WikiProvider.Clear(); }
//protected void userNames_OnLoad(object sender, EventArgs e) //{ // var graph = PXGraph.CreateInstance<ChatMaint>(); // var users = graph.Users.SelectMain(); // foreach (var user in users) // { // userNames.Items.Add(new ListItem(user.Username)); // } //} //protected void conversation_OnUnload(object sender, EventArgs e) // { // } //protected void userNames_OnTextChanged(object sender, EventArgs e) //{ // var refUser = userNames.Text; // var currentUser = PXAccess.GetUserName(); // var graph = PXGraph.CreateInstance<ChatMaint>(); // var conversation = graph.Conversation.SelectMain() // .FirstOrDefault(con => con.UserName == currentUser && con.SecondUserName == refUser); // if (conversation != null) // { // graph.Conversation.Current = conversation; // var messages = graph.Messages.SelectMain(); // var a = messages.Select(x => x + " "); // foreach (var c in a) // { // this.conversation.Text += a; // } // } //} //protected void userNames_OnSelectedIndexChanged(object sender, EventArgs e) //{ // var refUser = userNames.SelectedItem.Value; // var currentUser = PXAccess.GetUserName(); // var graph = PXGraph.CreateInstance<ChatMaint>(); // var conversation = graph.Conversation.SelectMain() // .FirstOrDefault(con => con.UserName == currentUser && con.SecondUserName == refUser); // if (conversation != null) // { // graph.Conversation.Current = conversation; // var messages = graph.Messages.SelectMain(); // var a = messages.Select(x => x + " "); // foreach (var c in a) // { // this.conversation.Text += a; // } // } //} protected void OnCallBack(object sender, PXCallBackEventArgs e) { throw new NotImplementedException(); }
protected void btnAuditDetails_CallBack(object sender, PXCallBackEventArgs e) { if (this.Page is PXPage) { PXDataSource datasource = ((PXPage)this.Page).DefaultDataSource; if (datasource != null) { String key = PX.Data.Process.PXAuditHelper.CollectAudit(datasource.DataGraph, datasource.PrimaryView); String message = null; if (key != null) message = String.Concat("Redirect4:", ResolveUrl("~/frames/audit.aspx"), "?key=", key, "&preserveSession=true"); else message = PX.Data.ErrorMessages.AuditNotAvailable; throw new Exception(message); } } }
protected void ddRate_PageRate(object sender, PXCallBackEventArgs e) { //Filltables(); }
/// <summary> /// The tlbPath callback event handler. /// </summary> protected void tlbPath_CallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "AddFav" && PXSiteMap.CurrentNode != null) { Guid nodeID = PXSiteMap.CurrentNode.NodeID; if (!IsInFavorites(nodeID)) AddFavorite(screenTitle, nodeID); else { PXDatabase.Delete<Favorite>( new PXDataFieldRestrict("UserID", PXAccess.GetUserID()), new PXDataFieldRestrict("SiteMapID", nodeID) ); } PXContext.Session.FavoritesExists["FavoritesExists"] = null; PXSiteMap.FavoritesProvider.Clear(); // check if favorites exists using (PXDataRecord exist = PXDatabase.SelectSingle<Favorite>( new PXDataField("UserID"), new PXDataFieldValue("UserID", PXAccess.GetUserID()))) { e.Result = (exist == null) ? "0" : "1"; } } }
protected void ddRate_PageRate(object sender, PXCallBackEventArgs e) { Filltables(); }
/// <summary> /// The create new control event handler. /// </summary> protected void OnCreateControl(object sender, PXCallBackEventArgs arg) { string[] ar = arg.Argument.Split('|'); string parent = ar[0], before = (ar.Length > 1) ? ar[1] : null, after = (ar.Length > 2) ? ar[2] : null; string controlType = ((PXButton)sender).Key; switch (controlType) { case "Row": LayoutEditor.CreateControl("<PXLayoutRule StartRow='True' />", parent, before, after); break; case "Column": LayoutEditor.CreateControl("<PXLayoutRule StartColumn='True' />", parent, before, after); break; case "Group": LayoutEditor.CreateControl("<PXLayoutRule StartGroup='True' />", parent, before, after); break; case "Merge": LayoutEditor.CreateControl("<PXLayoutRule Merge='True' />", parent, before, after); break; case "Grid": LayoutEditor.CreateControl("<PXGrid><Levels><PXGridLevel></PXGridLevel></Levels></PXGrid>", parent, before, after); break; case "Tab": LayoutEditor.CreateControl("<PXTab><Items><PXTabItem Text='TabItem1'></PXTabItem></Items></PXTab>", parent, before, after); break; case "Button": if (!string.IsNullOrEmpty(before)) { var type = LayoutEditor.GetPageNodeTypeByUID(before); if (typeof(PXToolBarItem).IsAssignableFrom(type)) { controlType = "PXToolBarButton"; } if (typeof(PXDSCallbackCommand).IsAssignableFrom(type)) { controlType = "PXDSCallbackCommand"; } } else if (!string.IsNullOrEmpty(parent)) { var type = parent.Contains(_customItemsName) ? typeof(PXToolBar) : LayoutEditor.GetPageNodeTypeByUID(parent); if (typeof(PXDataSource).IsAssignableFrom(type)) { controlType = "PXDSCallbackCommand"; } if (typeof(PXToolBar).IsAssignableFrom(type) || typeof(PXGrid).IsAssignableFrom(type)) { controlType = "PXToolBarButton"; } } if (controlType == "PXDSCallbackCommand") { break; } if (controlType != "Button") { LayoutEditor.CreateControl(string.Format("<{0}></{0}>", controlType), parent, before, after); } else { LayoutEditor.CreateControl(controlType, parent, before, after); } break; default: LayoutEditor.CreateControl(controlType, parent, before, after); break; } }
protected void PXToolBar1_CallBack(object sender, PXCallBackEventArgs e) { // WebsiteEntryPoints.ProcessMenuCommand(e.Argument, Page); //throw new Exception("Redirect:" + ResolveUrl/**/(this.Page.AppRelativeVirtualPath)); }
//--------------------------------------------------------------------------- protected void tlbTools_CallBack(object sender, PXCallBackEventArgs e) { if (e.Argument == "refresh") { if (!PXSiteMap.IsPortal || !Page.Request.Path.ToLower().Contains("reportlauncher")) { Session.Remove(VirtualPathUtility.ToAbsolute(Page.Request.Path)); RefreshByRedirect(); } } if (e.Argument == "help") { throw new Exception("Redirect:" + HelpUrl); } if (e.Command.Name == "updateFileMenu") { PXToolBarButton btn = this.GetAttachedFiles(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < btn.MenuItems.Count - 3; i++) { sb.Append(btn.MenuItems[i].Text); sb.Append("\t"); sb.Append(btn.MenuItems[i].NavigateUrl); sb.Append("\t"); sb.Append(btn.MenuItems[i].Target); sb.Append("\t"); sb.Append(btn.MenuItems[i].Value); sb.Append(";"); } e.Result = sb.ToString(); } if (e.Command.Name == "auditHistory") btnAuditDetails_CallBack(sender, e); }
protected void SearchCaption_WikiChange(object sender, PXCallBackEventArgs e) { if (!string.IsNullOrEmpty(Request.RawUrl)) { string path = PXUrl.SiteUrlWithPath(); var url = ""; path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + SearchCaption.Value + "&wikinumber=" + SearchCaption.SelectedIndex.ToString() + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=1" + "&globalsearchcaption=" + Globalsearchcaption; throw new Exception("Redirect0:" + url); } }
protected void tlbMain_CallBack(object sender, PXCallBackEventArgs e) { ds.DataGraph.Persist(); ds.DataGraph.Caches[typeof(PX.SM.SiteMap)].IsDirty = false; }
//--------------------------------------------------------------------------- /// <summary> /// The set business callback event handler. /// </summary> protected void onSetDate_CallBack(object sender, PXCallBackEventArgs e) { object date = ((PXDateTimeEdit)pnlDate.FindControl("edEffDate")).Value; if (date != null) { PXContext.SetBusinessDate((DateTime)date); PXDateTimeEdit.SetDefaultDate((DateTime)date); } }
protected void edField_RootFieldsNeeded(object sender, PXCallBackEventArgs e) { GenericInquiryDesigner graph = this.ds.DataGraph as GenericInquiryDesigner; if (graph != null) e.Result = string.Join(";", graph.GetAllFields()); }
/// <summary> /// The set business callback event handler. /// </summary> protected void toolsBar_OnCallBack(object sender, PXCallBackEventArgs e) { if (e.Command.Name == "EventsCount") { PXTasksAndEventsNavPanel pnl = this.pnlTasksAndEvents; if (pnl != null) { e.Result = string.Format("{0}({1})|{2}|{3}", pnl.TodayTasksCount + pnl.TodayEventsCount, pnl.NewTasksCount + pnl.NewEventsCount, pnl.TasksLabelText, pnl.EventsLabelText); } } }