Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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;
        }