示例#1
0
        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());
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }
示例#7
0
        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);
            }
        }
示例#8
0
        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));
        }