Exemplo n.º 1
0
        public void TestMethod1()
        {
            Invoker o       = new Invoker();
            Command command = new AddRequirementCommand();

            o.SetCommand(command);
            o.Action();
            //Debug Trace:
            //Requirement Find
            //Code Find
            //Requirement Add
            //Code delete
            //Requirement Plan

            o.SetCommand(new CancelDeletePageCommand());
            o.Action();
            //根据日志,取消操作
        }
Exemplo n.º 2
0
        public async Task <IActionResult> AddRequirement(RequirementCreateModel model)
        {
            if (ModelState.IsValid)
            {
                var cmd    = new AddRequirementCommand(model.VacancyId, model.ClientId, model.SkillType, model.RequirementType, model.Content);
                var result = await _mediator.Send(cmd);

                if (result.IsFailure)
                {
                    ViewBag.Notify = result.Error; // todo: toastr
                }
            }

            if (model.VacancyId != Guid.Empty)
            {
                return(RedirectToAction(nameof(ClientController.Requirements), new { client = model.ClientId, vacancy = model.VacancyId }));
            }
            else
            {
                return(RedirectToAction(nameof(ClientController.Index)));
            }
        }