/// <summary> /// The Save /// </summary> /// <param name="entity">The entity<see cref="Standard"/></param> /// <returns>The <see cref="ServiceResult"/></returns> public ServiceResult Save(Standard entity) { try { if (entity.Identifier == 0) { _repository.Add(entity); } else { _repository.Update(entity); } return(new ServiceResult(true)); } catch (Exception ex) { return(new ServiceResult(false) { Error = ex.ToString() }); } }
public string Execute(Domain.Standard.Standard standard) { var existStandard = _standardRepository.Get(standard.StandardID); if (standard.Active != existStandard.Active) { standard.Aspects = existStandard.Aspects; } string response = _standardRepository.Update(standard); switch (response) { case "NameExist": throw new DuplicateEntityException(standard.Name, "Ya existe una norma con este nombre o código", 436); case "OneActive": throw new DuplicateEntityException(standard.Name, "Debe existir al menos un aspecto activo.", 436); default: return("Ok"); } }
public void UpdateStandard(Standard standard) { _standardRepository.Update(standard); }
public void updateStandard(Standard Standard) { _standardRepository.Update(Standard); }
} //close addStandard(...) public void updateStandard(Standard updateStandardItem) { _standardRepository.Update(updateStandardItem); } //close updateStandard(...)
public void updateStandard(Standard departments) { standardRepository.Update(departments); }
public void UpdateStandard(Standard standard) { standardRepository.Update(standard); //throw new NotImplementedException(); }