public IActionResult Insert() { TempData["active"] = "yetenek"; var model = new SkillAddDto(); return(View(model)); }
public async Task <IActionResult> Create() { TempData["active"] = "skill"; SkillAddDto skillAddDto = new SkillAddDto(); skillAddDto.CategoryList = new SelectList(await _categoryService.GetListAsync(), "Id", "Name"); return(View(skillAddDto)); }
public async Task <IActionResult> Add(SkillAddDto skillAddDto) { if (ModelState.IsValid) { await _skillService.Add(skillAddDto, "Hasan Erdal"); return(RedirectToAction("Index")); } return(View()); }
public IActionResult Add(SkillAddDto model) { TempData["active"] = "yetenek"; if (ModelState.IsValid) { _genericSkillService.Insert(_mapper.Map <Skill>(model)); TempData["message"] = "Ekleme işleminiz başarılı"; return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult Insert(SkillAddDto model) { if (ModelState.IsValid) { _genericService.Insert(new Skill { Description = model.Description }); TempData["message"] = "İşlem başarıyla tamamlandı."; return(RedirectToAction("Index")); } return(View(model)); }
public async Task <IActionResult> CreateSkill( [FromBody] SkillAddDto model, CancellationToken ct) { var entity = new SkillEntity { Id = Guid.NewGuid(), Name = model.Name, YearsOfExperience = model.YearsOfExperience, Level = model.Level }; await _repository.Create(entity, ct); return(Ok()); }
public async Task <IDataResult <SkillDto> > Add(SkillAddDto skillAddDto, string createdByName) { var skill = _mapper.Map <Skill>(skillAddDto); skill.CreatedByName = createdByName; skill.ModifiedByName = createdByName; skill.ModifiedTime = DateTime.Now; var addedSkill = await _unitOfWork.Skill.AddAsync(skill); await _unitOfWork.SaveAsync(); return(new DataResult <SkillDto>(ResultStatus.Success, $"{addedSkill.Title} isimli yetenek başarılı bir şekilde kayıt edilmiştir.", new SkillDto { Skill = addedSkill, Message = $"{addedSkill.Title} isimli yetenek başarılı bir şekilde kayıt edilmiştir.", ResultStatus = ResultStatus.Success })); }
public async Task <IActionResult> Create(SkillAddDto skillAddDto) { if (ModelState.IsValid) { await _skillService.InsertAsync(new Skill { IsDraft = skillAddDto.IsDraft, LevelPercent = skillAddDto.LevelPercent, SubCategoryId = skillAddDto.SubCategoryId, Text = skillAddDto.Text, Title = skillAddDto.Title, }); return(RedirectToAction("Index")); } skillAddDto.CategoryList = new SelectList(await _categoryService.GetListAsync(), "Id", "Name"); return(View(skillAddDto)); }