Ejemplo n.º 1
0
    //Gets url to navigate for entering required data
    private string GetNextUrl(ref PXSetupNotEnteredException exception)
    {
        Type    graphType           = null;
        PXGraph gettingCache        = new PXGraph();
        bool    createInstanceError = true;

        //Get graph that user must use at first
        while (createInstanceError)
        {
            createInstanceError = false;
            PXPrimaryGraphBaseAttribute attr = PXPrimaryGraphAttribute.FindPrimaryGraph(gettingCache.Caches[exception.DAC], out graphType);

            if (graphType != null)
            {
                try
                {
                    PXGraph tmpGraph = PXGraph.CreateInstance(graphType) as PXGraph;
                }
                catch (PXSetupNotEnteredException ctrException)
                {
                    createInstanceError = true;
                    exception           = ctrException;
                }
            }
        }

        try
        {
            string link = graphType == null ? null : PXBaseDataSource.getMainForm(graphType);
            if (exception.KeyParams != null)
            {
                char pref = '?';
                foreach (var keyparam in exception.KeyParams)
                {
                    link += String.Format(pref + "{0}={1}", keyparam.Key.Name.ToString(), keyparam.Value.ToString());
                    pref  = '&';
                }
            }
            return(link);
        }
        //we cang get url if we don't have rights to the screen
        catch
        {
            return(null);
        }
    }
Ejemplo n.º 2
0
    //Gets url to navigate for entering required data
    private string GetNextUrl(ref PXSetupNotEnteredException exception)
    {
        Type    graphType           = null;
        PXGraph gettingCache        = new PXGraph();
        bool    createInstanceError = true;

        //Get graph that user must use at first
        while (createInstanceError)
        {
            createInstanceError = false;
            PXPrimaryGraphBaseAttribute attr = PXPrimaryGraphAttribute.FindPrimaryGraph(gettingCache.Caches[exception.DAC], out graphType);

            if (graphType != null)
            {
                try
                {
                    PXGraph tmpGraph = PXGraph.CreateInstance(graphType) as PXGraph;
                }
                catch (PXSetupNotEnteredException ctrException)
                {
                    createInstanceError = true;
                    exception           = ctrException;
                }
            }
        }

        try
        {
            return(graphType == null ? null : PXBaseDataSource.getMainForm(graphType));
        }
        //we cang get url if we don't have rights to the screen
        catch
        {
            return(null);
        }
    }