public async Task <IActionResult> Edit(EducationUpdateDto educationUpdateDto) { if (ModelState.IsValid) { await _educationService.Update(educationUpdateDto, "Hasan Erdal"); return(RedirectToAction("Index")); } return(View()); }
public async Task <IHttpActionResult> Update(EducationUpdateDto model) { var result = await _educationService.Update(model); if (!result) { return(BadRequest()); } return(Ok()); }
public async Task <IDataResult <EducationDto> > Update(EducationUpdateDto educationUpdateDto) { if (educationUpdateDto != null) { var education = _mapper.Map <Education>(educationUpdateDto); await _unitOfWork.Education.UpdateAsync(education); await _unitOfWork.SaveAsync(); return(new DataResult <EducationDto>(ResultStatus.Success, new EducationDto { Education = education })); } return(new DataResult <EducationDto>(ResultStatus.Error, "Hata. Girdiğiniz bilgileri kontrol ediniz.", null)); }
public async Task <IDataResult <EducationDto> > Update(EducationUpdateDto educationUpdateDto, string modifiedByName) { var education = _mapper.Map <Education>(educationUpdateDto); education.ModifiedByName = modifiedByName; var updatedEducation = await _unitOfWork.Education.UpdateAsync(education); await _unitOfWork.SaveAsync(); return(new DataResult <EducationDto>(ResultStatus.Success, $"{updatedEducation.Title} başlıklı eğitim başarılı bir şekilde güncellenmiştir.", new EducationDto { ResultStatus = ResultStatus.Success, Education = updatedEducation, Message = $"{updatedEducation.Title} başlıklı eğitim başarılı bir şekilde güncellenmiştir." })); }
public IActionResult Update(EducationUpdateDto model) { if (ModelState.IsValid) { var updatedEntity = _genericService.GetById(model.Id); updatedEntity.StartDate = model.StartDate; updatedEntity.SubTitle = model.SubTitle; updatedEntity.Title = model.Title; updatedEntity.Description = model.Description; updatedEntity.EndDate = model.EndDate; _genericService.Update(updatedEntity); TempData["message"] = "İşlem başarı ile tamamlandı"; return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult Update(int id) { TempData["active"] = "egitim"; var updatedEntity = _genericService.GetById(id); var model = new EducationUpdateDto { Description = updatedEntity.Description, EndDate = updatedEntity.EndDate, StartDate = updatedEntity.StartDate, SubTitle = updatedEntity.SubTitle, Id = updatedEntity.Id, Title = updatedEntity.Title }; return(View(model)); }
public async Task <bool> Update(EducationUpdateDto model) { try { var query = _context.Education.FirstOrDefault(x => x.Id == model.Id); query.GraduationStatus = model.GraduationStatus; query.SchoolName = model.SchoolName; await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public IActionResult Update(EducationUpdateDto model) { if (ModelState.IsValid) { var updatedEducation = _educationGenericService.GetById(model.Id); updatedEducation.StartDate = model.StartDate; updatedEducation.SubTitle = model.SubTitle; updatedEducation.Title = model.Title; updatedEducation.Description = model.Description; updatedEducation.EndDate = model.EndDate; _educationGenericService.Update(updatedEducation); TempData["message"] = "Güncelleme işleminiz başarı ile gerçekleşti"; return(RedirectToAction("Index")); } return(View(model)); }