Example #1
0
        public static Result <Action> Create(
            ActionPage page, string description, ActionType type, string userId,
            string moduleId  = null, string eventId           = null,
            string subjectId = null, string contentId         = null,
            string concept   = null, string supportMaterialId = null, string questionId = null
            )
        {
            if (description.Length > 200)
            {
                return(Result.Fail <Action>($"Tamanho máximo da descrição da action é de 200 caracteres."));
            }

            var module = new Action()
            {
                Id                = ObjectId.GenerateNewId(),
                Description       = description,
                Page              = page,
                Type              = type,
                ModuleId          = moduleId,
                EventId           = eventId,
                SubjectId         = subjectId,
                ContentId         = contentId,
                Concept           = concept,
                SupportMaterialId = supportMaterialId,
                QuestionId        = questionId,
                CreatedBy         = ObjectId.Parse(userId)
            };

            return(Result.Ok(module));
        }
        public void Action()
        {
            HomePage   home = new HomePage(Driver);
            ActionPage act  = new ActionPage(Driver);

            act.Action();
            Assert.AreEqual(Driver.FindElement(By.XPath("(//*[@class='promotions-section-header'])[1]")).Text, "Предложения для путешественников", "Not Free BreackFast");
            Logger.Log.Debug("Action");
        }
Example #3
0
        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            //
            // HistoryPanel
            //
            historyPanel = new HistoryPage();
            actionPanel  = new ActionPage(Connector);

            this.Name = "DropPanel";
            this.Size = new System.Drawing.Size(200, 300);
            this.ResumeLayout(false);
            this.Visible  = false;
            this.Location = new System.Drawing.Point(830, 80);
        }
Example #4
0
        public override string get_ActionName(int actionNumber)
        {
            switch (actionNumber)
            {
            case ActionSendMessageTANumber:
                using (var page = new ActionPage(HS, pluginConfig, base.Log))
                {
                    return(page.Name());
                }

            default:
                return(string.Empty);
            }
        }
Example #5
0
            public async Task <Result <Action> > Handle(Contract request, CancellationToken cancellationToken)
            {
                try
                {
                    var pageResult = ActionPage.Create(request.PageId);
                    if (pageResult.IsFailure)
                    {
                        return(Result.Fail <Action>(pageResult.Error));
                    }

                    var typeResult = ActionType.Create(request.TypeId);
                    if (typeResult.IsFailure)
                    {
                        return(Result.Fail <Action>(typeResult.Error));
                    }

                    var action = Action.Create(
                        pageResult.Data, request.Description, typeResult.Data, request.UserId,
                        request.ModuleId, request.EventId,
                        request.SubjectId, request.ContentId,
                        request.Concept, request.SupportMaterialId, request.QuestionId
                        );

                    if (action.IsFailure)
                    {
                        return(Result.Fail <Action>(action.Error));
                    }

                    await _db.ActionCollection.InsertOneAsync(
                        action.Data, cancellationToken : cancellationToken
                        );

                    return(action);
                }
                catch (Exception err)
                {
                    Console.WriteLine(err.Message);
                    throw err;
                }
            }
Example #6
0
        public override string ActionBuildUI([AllowNull] string uniqueControlId, IPlugInAPI.strTrigActInfo actionInfo)
        {
            try
            {
                switch (actionInfo.TANumber)
                {
                case ActionTakeSnapshotsTANumber:
                    using (var actionPage = new ActionPage(HS, pluginConfig))
                    {
                        return(actionPage.GetRefreshActionUI(uniqueControlId ?? string.Empty, actionInfo));
                    }

                default:
                    return(base.ActionBuildUI(uniqueControlId, actionInfo));
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(Invariant($"Failed to give build Action UI with {ex.GetFullMessage()}"));
                throw;
            }
        }
Example #7
0
        public override IPlugInAPI.strMultiReturn ActionProcessPostUI([AllowNull] NameValueCollection postData, IPlugInAPI.strTrigActInfo actionInfo)
        {
            try
            {
                switch (actionInfo.TANumber)
                {
                case ActionTakeSnapshotsTANumber:
                    using (var actionPage = new ActionPage(HS, pluginConfig))
                    {
                        return(actionPage.GetRefreshActionPostUI(postData, actionInfo));
                    }

                default:
                    return(base.ActionProcessPostUI(postData, actionInfo));
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(Invariant($"Failed to ActionProcessPostUI with {ex.GetFullMessage()}"));
                throw;
            }
        }