Ejemplo n.º 1
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       = 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());
    }
Ejemplo n.º 2
0
        public static List <CacheEntityItem> TemplateEntity(PXGraph graph, string parent, PXSiteMap.ScreenInfo _info)
        {
            List <CacheEntityItem> ret = new List <CacheEntityItem>();

            if (parent == null)
            {
                int i = 0;
                if (_info.GraphName != null)
                {
                    foreach (Data.Description.PXViewDescription viewdescr in _info.Containers.Values)
                    {
                        CacheEntityItem item = new CacheEntityItem();
                        item.Key    = viewdescr.ViewName;
                        item.SubKey = viewdescr.ViewName;
                        item.Path   = null;
                        item.Name   = viewdescr.DisplayName;
                        item.Number = i++;
                        item.Icon   = Sprite.Main.GetFullUrl(Sprite.Main.Box);
                        ret.Add(item);
                    }
                }
            }
            else
            {
                string[] viewname = null;
                _info.Views.TryGetValue(parent, out viewname);
                if (viewname != null)
                {
                    int f         = 0;
                    var tempgraph = (PXGraph)PXGraph.CreateInstance(GraphHelper.GetType(_info.GraphName));
                    if (!tempgraph.Views.ContainsKey(parent))
                    {
                        return(null);
                    }

                    foreach (PXFieldState field in PXFieldState.GetFields(graph, tempgraph.Views[parent].BqlSelect.GetTables(), false))
                    {
                        CacheEntityItem item = new CacheEntityItem();
                        item.Key    = parent + "." + field.Name;
                        item.SubKey = field.Name;
                        item.Path   = "((" +
                                      (string.IsNullOrEmpty(parent)
                                                                                                        ? field.Name
                                                                                                        : parent + "." + field.Name) + "))";
                        item.Name   = field.DisplayName;
                        item.Number = f++;
                        item.Icon   = Sprite.Main.GetFullUrl(Sprite.Main.BoxIn);
                        ret.Add(item);
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 3
0
        public SOAmazonSetupMaint()
        {
            SOOrderEntry soGraph = PXGraph.CreateInstance <SOOrderEntry>();

            m_screenInfo = ScreenUtils.GetScreenInfo(SOConstants.ScreenID);
        }