private AssetManager_Software_AssetType mapViewModelToEntitySoftwareType(
            AssetManager_SoftwareType_vm VMSoftwareType)
        {
            var models = new AssetManager_Software_AssetType
            {
                Id               = VMSoftwareType.Id,
                Name             = VMSoftwareType.Name,
                EndOfLifeMo      = VMSoftwareType.EndOfLifeMo,
                CategoryCode     = VMSoftwareType.CategoryCode,
                DescriptionNotes = VMSoftwareType.DescriptionNotes
            };

            return(models);
        }
        private AssetManager_SoftwareType_vm mapEntityToViewSoftwareType(
            AssetManager_Software_AssetType EFSoftwareType)
        {
            _logger.Debug("Mapping Entity to Software Asset Type View Model.");
            var vmST = new AssetManager_SoftwareType_vm
            {
                Id               = EFSoftwareType.Id,
                Name             = EFSoftwareType.Name,
                EndOfLifeMo      = EFSoftwareType.EndOfLifeMo,
                CategoryCode     = EFSoftwareType.CategoryCode,
                DescriptionNotes = EFSoftwareType.DescriptionNotes
            };

            return(vmST);
        }
Exemple #3
0
 /// <summary>
 /// Puts the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int Put(int id, [FromBody] AssetManager_SoftwareType_vm value)
 {
     _logger.Info("Editing the software type with id " + id);
     return(_assetSoftwareTypeManager.EditSoftwareTypeById(id, value));
 }
Exemple #4
0
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int Post([FromBody] AssetManager_SoftwareType_vm value)
 {
     _logger.Info("Creating a new software type.");
     return(_assetSoftwareTypeManager.CreateSoftwareType(value));
 }
 public int EditSoftwareTypeById(int id, AssetManager_SoftwareType_vm softwareType)
 {
     return(_assetManagerSoftwareTypeRepository.EditSoftwareAssetTypes(id, mapViewModelToEntitySoftwareType(softwareType)));
 }
 public int CreateSoftwareType(AssetManager_SoftwareType_vm softwareType)
 {
     return(_assetManagerSoftwareTypeRepository.CreateSoftwareAssetTypes(mapViewModelToEntitySoftwareType(softwareType)));
 }