예제 #1
0
    /// <summary>
    /// Gets callback result.
    /// </summary>
    public string GetCallbackResult()
    {
        mParameters = new Hashtable();
        string queryString = null;

        mParameters["returnlocation"] = URLHelper.CurrentURL;
        mParameters["contactid"]      = ContactID;

        // ...for mass action
        if (CallbackArgument.StartsWith("massaction;", StringComparison.InvariantCultureIgnoreCase))
        {
            // Get values of callback argument
            string[] selection = CallbackArgument.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            if (selection.Length != 3)
            {
                return(null);
            }

            Action action = (Action)ValidationHelper.GetInteger(selection[2], 0);
            switch (action)
            {
            case Action.Delete:
                mParameters["where"]         = GetWhereCondition(selection[1]);
                mParameters["issitemanager"] = ContactHelper.IsSiteManager;
                break;

            default:
                return(null);
            }

            mParameters["siteid"] = SiteID;

            WindowHelper.Add(Identifier, mParameters);
            queryString = "?params=" + Identifier;
            queryString = URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString));

            return(queryString);
        }
        else
        {
            mParameters["where"] = gridElem.WhereCondition;
            string sortDirection = gridElem.SortDirect;
            if (String.IsNullOrEmpty(sortDirection))
            {
                sortDirection = gridElem.OrderBy;
            }
            mParameters["orderby"]  = sortDirection;
            mParameters["ismerged"] = IsMergedContact;
            mParameters["isglobal"] = IsGlobalContact;

            WindowHelper.Add(Identifier, mParameters);

            queryString = "?params=" + Identifier;
            queryString = URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString));
            queryString = URLHelper.AddParameterToUrl(queryString, "activityid", ActivityID.ToString());

            return(queryString);
        }
    }
예제 #2
0
    /// <summary>
    /// Gets callback result.
    /// </summary>
    public string GetCallbackResult()
    {
        string queryString = null;

        if (!string.IsNullOrEmpty(CallbackArgument))
        {
            // Prepare parameters...
            mParameters = new Hashtable();

            // ...for mass action
            if (CallbackArgument.StartsWith("massaction;", StringComparison.OrdinalIgnoreCase))
            {
                // Get values of callback argument
                string[] selection = CallbackArgument.Split(new[]
                {
                    ";"
                }, StringSplitOptions.RemoveEmptyEntries);
                if (selection.Length != 3)
                {
                    return(null);
                }

                // Get selected actions from DD-list
                Action action = (Action)ValidationHelper.GetInteger(selection[2], 0);
                switch (action)
                {
                case Action.ChangeStatus:
                    mParameters["allownone"] = true;
                    mParameters["clientid"]  = ClientID;
                    break;

                case Action.StartNewProcess:
                    mParameters["SelectionMode"]     = SelectionModeEnum.SingleButton;
                    mParameters["ObjectType"]        = WorkflowInfo.OBJECT_TYPE_AUTOMATION;
                    mParameters["WhereCondition"]    = "WorkflowEnabled = 1";
                    mParameters["DialogInfoMessage"] = GetString("ma.automationprocess.startprocessinfo");
                    break;

                default:
                    return(null);
                }
            }
            // ...for unigrid action
            else
            {
                mParameters["where"] = SqlHelper.GetWhereCondition <int>("ContactID", new[]
                {
                    CallbackArgument
                }, false);
            }

            WindowHelper.Add(Identifier.ToString(), mParameters);

            queryString = "?params=" + Identifier;
            queryString = URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString));
        }

        return(queryString);
    }
예제 #3
0
    /// <summary>
    /// Gets callback result.
    /// </summary>
    public string GetCallbackResult()
    {
        string queryString = string.Empty;

        if (!string.IsNullOrEmpty(CallbackArgument))
        {
            // Prepare parameters...
            Hashtable mParameters = new Hashtable();
            // ...for mass action
            if (CallbackArgument.StartsWith("massaction;", StringComparison.InvariantCultureIgnoreCase))
            {
                // Get values of callback argument
                string[] selection = CallbackArgument.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                if (selection.Length != 3)
                {
                    return(null);
                }

                // Get selected actions from DD-list
                Action action = (Action)ValidationHelper.GetInteger(selection[2], 0);
                switch (action)
                {
                case Action.ChangeStatus:
                    mParameters["allownone"] = true;
                    mParameters["clientid"]  = ClientID;
                    break;

                case Action.AddToGroup:
                    break;

                default:
                    return(null);
                }
            }

            mParameters["clientid"] = ClientID;
            mParameters["siteid"]   = SiteId;
            WindowHelper.Add(Identifier, mParameters);

            queryString = "?params=" + Identifier;
            queryString = URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString));
        }

        return(queryString);
    }