private MaterialDTO BasicInfoInput() { string name = string.Empty; string link = string.Empty; string skills = string.Empty; name = InfoUnit.GetInfoUnit(name, x => !string.IsNullOrEmpty(x.ToString()) && x.ToString().Length > 1, "Enter material name", @"Error! Enter the material name!").ToString(); link = InfoUnit.GetInfoUnit(link, x => !string.IsNullOrEmpty(x.ToString()) && Regex.IsMatch(x.ToString(), urlRegex, RegexOptions.IgnoreCase), "Enter material link!", @"Error! Enter the correct link!").ToString(); skillService.ShowSkills(); List <Skill> skillList = new List <Skill>(); while (true) { string command = string.Empty; command = InfoUnit.GetInfoUnit(command, x => !string.IsNullOrEmpty(x.ToString()) && new List <string> { "0", "1", "2" }.Contains(x.ToString()), "Wanna add new skill(1) or existing one(2) PRESS 0 TO EXIT SKILL ADDING MODE?", @"Error! Enter the correct command!").ToString(); if (command == "0") { break; } if (command == "1") { var skillName = skillInputService.SkillInfoInput(); var skill = skillService.Get(skillName); skillList.Add(skill); } else { string skillName = string.Empty; skillName = InfoUnit.GetInfoUnit(skillName, x => !string.IsNullOrEmpty(x.ToString()) && x.ToString().Length > 1, "Enter skill name", @"Error! skill name invalid!").ToString(); skillList.Add(skillService.Get(skillName.TrimStart())); } } return(new MaterialDTO(name, link, skillList)); }
public IActionResult Get(long id) { try { if (id == 0) { _logger.LogInfo("paramter to get request is 0 or null"); return(BadRequest()); } Skill skill = _skillService.Get(id); if (skill == null) { _logger.LogInfo("skill not present with id" + id); return(NotFound("The Skill record couldn't be found.")); } return(Ok(skill)); } catch (Exception ex) { _logger.LogError(ex.Message); return(BadRequest()); } }
public ActionResult Skills(int managerId) { if (managerId <= 0) { return(HttpNotFound()); } int userId = User.Identity.GetUserId <int>(); // проверяем, владелец ли резюме шлет запрос на его изменение if (!_managerService.IsOwnedBy(userId, managerId)) { return(new HttpUnauthorizedResult()); } ViewBag.ManagerId = managerId; var viewModel = _skillService.Get(managerId); if (viewModel == null) { return(View()); } return(View(viewModel)); }
public async Task <IActionResult> Details(int id) { if (id < 1) { return(NotFound()); } var skill = await _skillService.Get(id); if (skill.ResultStatus == ResultStatus.Success) { return(View(skill.Data)); } if (skill.ResultStatus == ResultStatus.Error) { return(NotFound()); } return(View()); }
public ActionResult <List <SkillDto> > Get([FromHeader] Guid token) { try { ValidateToken(token); return(Ok(_skillService.Get())); } catch (AuthenticationException) { return(Unauthorized()); } catch (ArgumentException e) { return(NotFound(e.Message)); } }
public void Extract(string inputDirectory) { try { _inputDirectory = inputDirectory; _monsterAlgorithm = ChickenContainer.Instance.Resolve <INpcMonsterAlgorithmService>(); _skillService = ChickenContainer.Instance.Resolve <ISkillService>(); _skills = _skillService.Get().ToDictionary(dto => dto.Id); ParseFile(); ExtractFiles(); } catch (Exception e) { Log.Error("Extract", e); } }
public IHttpActionResult GetSkill(int id) { //get the skill first var skill = _skillService.Get(id); if (skill == null) { return(NotFound()); } var model = skill.ToModel(); return(RespondSuccess(new { Skill = model })); }
public ActionResult <Skill> Get(long id) { try { var result = _skillService.Get(id); if (result == null) { return(NotFound()); } else { return(Ok(result)); } } catch (Exception ex) { return(UnprocessableEntity(ex)); } }
public ActionResult AddVideo() { ViewBag.Skills = skillService.Get(); return(View()); }
public ActionResult <Skill> Get(int id) { return(StatusCode(StatusCodes.Status200OK, _skillService.Get(id, RootUrl))); }
public PageResponse <SkillDTO> Get(QuerySettings settings) { return(_service.Get(settings)); }
public IndexViewModel(ISkillService skillService) { this.skillService = skillService; Skills = skillService.Get().OrderBy(o => o.ParentSkillID); }
public BaseResponse <SkillOutputDto> Get(Guid id) { return(_skillService.Get(id)); }
public List <Skill> Get() { return(_skillService.Get()); }
// GET: api/Skills public IEnumerable <SkillDTO> Get() { var skills = skillService.Get(); return(Mapper.Map <IEnumerable <Skill>, IEnumerable <SkillDTO> >(skills)); }