Example #1
0
	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));
		}
	}
Example #2
0
	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());
	}
Example #3
0
	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();
	}
Example #4
0
	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;
		}
	}
Example #5
0
	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());
	}
Example #6
0
	/// <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;
		}
	}
Example #7
0
	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();
	}
Example #8
0
	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);
		}
	}	
Example #9
0
	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);
		}
	}
Example #10
0
	//---------------------------------------------------------------------------
	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);
	}
Example #11
0
	protected void tlbMain_CallBack(object sender, PXCallBackEventArgs e)
	{
		ds.DataGraph.Persist();
		ds.DataGraph.Caches[typeof(PX.SM.SiteMap)].IsDirty = false;
	}
Example #12
0
	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);
			}
		}
	}
Example #13
0
	/// <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";
			}
		}
	}
Example #14
0
	protected void edField_RootFieldsNeeded(object sender, PXCallBackEventArgs e)
	{
		GenericInquiryDesigner graph = this.ds.DataGraph as GenericInquiryDesigner;
		if (graph != null)
			e.Result = string.Join(";", graph.GetAllFields());
	}
Example #15
0
	/// <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);
			}
		}
	}
Example #16
0
	//---------------------------------------------------------------------------
	/// <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);
		}
	}
Example #17
0
	protected void ddRate_PageRate(object sender, PXCallBackEventArgs e)
	{
		Filltables();		
	}