public string UpdateComponents(ComponentsModel componentsModel) { Components UpdateComponents = _componentRepository.GetComponentsByID(componentsModel.ID); if (UpdateComponents != null) { UpdateComponents.ID = componentsModel.ID; UpdateComponents.ComponentName = componentsModel.ComponentName; UpdateComponents.ComponentTypeID = componentsModel.ComponentTypeID; UpdateComponents.Description = componentsModel.Description; } _componentRepository.UpdateComponent(UpdateComponents); return(componentsModel.ToString()); }
public int UpdateComponents(ComponentsModel componentsModel) { Components UpdateComponents = _componentRepository.GetComponentsByID(componentsModel.ID); if (UpdateComponents != null) { UpdateComponents.ID = componentsModel.ID; UpdateComponents.ComponentName = componentsModel.ComponentName; UpdateComponents.ComponentTypeID = componentsModel.ComponentTypeID; UpdateComponents.Description = componentsModel.Description; } UpdateComponents = _componentRepository.UpdateComponent(UpdateComponents); componentsModel.ID = UpdateComponents.ID; return componentsModel.ID; }