public async Task <ActionResult <EducationLevel> > Edit(string id, EducationLevel value) { // var product = new Product(value.Id); value.Id = ObjectId.Parse(id); _EducationLevel.Update(value, id); await _uow.Commit(); return(RedirectToAction("Index")); }
public ActionResult Edit(EducationLevelEditModel modelArea) { if (_gradeRepository.Filter(x => x.Name == modelArea.Name && x.Id != modelArea.Id).Any()) { const string titulo = "Error!"; const string contenido = "No se pueden aceptar los cambios ya que existe otro nivel educativo con ese nombre."; _viewMessageLogic.SetNewMessage(titulo, contenido, ViewMessageType.ErrorMessage); return(RedirectToAction("Index")); } var myArea = _areaReposity.GetById(modelArea.Id); myArea = Mapper.Map(modelArea, myArea); myArea = _areaReposity.Update(myArea); const string title = "Nivel de Educación Actualizado"; var content = "El Nivel De Educación" + myArea.Name + " ha sido actualizado exitosamente."; _viewMessageLogic.SetNewMessage(title, content, ViewMessageType.SuccessMessage); return(RedirectToAction("Index")); }
public void Update(short Id, EducationLevelDto model) { var educationLevel = _educationLevelRepository.GetById(Id); if (educationLevel != null) { educationLevel.Name = model.Name; _educationLevelRepository.Update(educationLevel); } }
public ActionResult Edit(EducationLevelEditModel modelArea) { var myArea = Mapper.Map <EducationLevel>(modelArea); myArea.Name = modelArea.Name; EducationLevel area = _areaReposity.Update(myArea); const string title = "Nivel de Educacion Actualizado"; var content = "El Nivel De Educacion" + area.Name + " ha sido actualizado exitosamente."; _viewMessageLogic.SetNewMessage(title, content, ViewMessageType.InformationMessage); return(RedirectToAction("Index")); }
public bool UpdateEducationLevel(EducationLevel educationLevel) { bool isSuccess = true; try { educationLevelRepository.Update(educationLevel); this.SaveRecord(); ServiceUtil <EducationLevel> .WriteActionLog(educationLevel.Id, ENUMOperation.UPDATE, educationLevel); } catch (Exception ex) { isSuccess = false; logger.Error("Error in updating EducationLevel", ex); } return(isSuccess); }