示例#1
0
        /// <summary>
        /// Assigns the record to a User or Team
        /// </summary>
        /// <param name="to">The User or Team you want to assign the record to</param>
        /// <param name="value">The value of the User or Team you want to find and select</param>
        /// <param name="thinkTime">Used to simulate a wait time between human interactions. The Default is 2 seconds.</param>
        /// <example>xrmBrowser.Dialogs.Assign(XrmDialogPage.AssignTo.Me, "");</example>
        public BrowserCommandResult <bool> Assign(AssignTo to, string value, int thinkTime = Constants.DefaultThinkTime)
        {
            this.Browser.ThinkTime(thinkTime);

            return(this.Execute(GetOptions("Assign"), driver =>
            {
                driver.WaitUntilAvailable(By.XPath(Elements.Xpath[Reference.Dialogs.Header]),
                                          new TimeSpan(0, 0, 10),
                                          "The Assign dialog is not available.");

                switch (to)
                {
                case AssignTo.Me:
                    driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Dialogs.Assign.Ok]));

                    break;

                case AssignTo.User:
                    this.SetValue(new Lookup()
                    {
                        Name = Elements.ElementId[Reference.Dialogs.Assign.UserOrTeamLookupId], Value = value
                    });
                    break;

                case AssignTo.Team:
                    this.SetValue(new Lookup()
                    {
                        Name = Elements.ElementId[Reference.Dialogs.Assign.UserOrTeamLookupId]
                    });
                    break;
                }

                return true;
            }));
        }
        // TODO: return bool
        // This relates to the line that goes with '@'.
        internal void ChangeCurrentAssignee(string newAssignment)
        {
            switch (newAssignment)
            {
            case CriteriaConstants.HOLDER_COUNTRY:
            {
                currentAssignment = AssignTo.HolderCountry;
                break;
            }

            case CriteriaConstants.STOCK_TYPE:
            {
                currentAssignment = AssignTo.StockType;
                break;
            }

            case CriteriaConstants.DIRECTION:
            {
                currentAssignment = AssignTo.Direction;
                break;
            }

            default:
            {
                break;
            }
            }

            if (progress == PreAggProgress.HaveNothing)
            {
                progress = PreAggProgress.HaveName;
            }
        }
示例#3
0
        public static void BuildTask(Graph graph, Task newTask, string creator, string handler, string currentStep)
        {
            Edge newEdge;

            graph.AddNode(newTask);
            User cse = graph.GetNodeByName(creator) as User;

            newEdge = new Create();
            graph.AddEdge(cse, newTask, newEdge);
            newEdge = new CreateBy();
            graph.AddEdge(newTask, cse, newEdge);

            User inter = graph.GetNodeByName(handler) as User;

            newEdge = new Assigned();
            graph.AddEdge(inter, newTask, newEdge);
            newEdge = new AssignTo();
            graph.AddEdge(newTask, inter, newEdge);

            ProcedureStep curStep = graph.GetNodeByName(currentStep) as ProcedureStep;

            newEdge = new CurrentStep();
            graph.AddEdge(newTask, curStep, newEdge);
        }
 /// <summary>
 /// Assigns a record to a user or team
 /// </summary>
 /// <param name="to">Enum used to assign record to user or team</param>
 /// <param name="userOrTeamName">Name of the user or team to assign to</param>
 public void Assign(AssignTo to, string userOrTeamName = null)
 {
     _client.AssignDialog(to, userOrTeamName);
 }