Exemplo n.º 1
0
 public void AddPropertyToAssetType(string assetTypeName, AssetProperty property)
 {
     var assetType = AssetTypeRepository.Find(assetTypeName);
     assetType.AddProperty(property);
     AssetTypeRepository.Update(assetType);
     UnitOfWork.Commit();
 }
Exemplo n.º 2
0
 private static void AddPropertyToViewModel(AssetListViewModel viewModel, AssetProperty property, string fullName, IEnumerable<SelectListItem> possibleValues)
 {
     viewModel.AddProperty(new AssetPropertyViewModel()
         {
             Name = property.Name,
             FullName = fullName,
             Property = property,
             PossibleValues = possibleValues
         });
 }
Exemplo n.º 3
0
        public AssetPropertyValue(Asset asset, AssetProperty property)
        {
            Asset = asset;
            Property = property;

            if (property.Type != null)
            {
                if (property.IsCollection)
                {
                    AssetValues = new List<Asset>();
                }
                else
                {
                    AssetValue = new Asset(property.Type);
                }
            }
        }
Exemplo n.º 4
0
 public ActionResult AddProperty(string name, string propertyName, bool propertyIsUniqueIdentifier, string optionsPropertyType, string selectedSystemValueType, string selectedUnitOfMeasurement, string selectedAssetType)
 {
     var property = new AssetProperty {Name = propertyName, IsUniqueIdentifier = propertyIsUniqueIdentifier};
     if (optionsPropertyType == "optionSystemValueType")
     {
         property.ValueType = (SystemTypes) Enum.Parse(typeof (SystemTypes), selectedSystemValueType);
     }
     else if (optionsPropertyType == "optionUnitOfMeasurement")
     {
         property.UnitOfMeasurement = UnitOfMeasurementService.FindUnitOfMeasurementByName(selectedUnitOfMeasurement);
     }
     else if (optionsPropertyType == "optionAssetType")
     {
         property.Type = AssetTypeService.FindAssetTypeByName(selectedAssetType);
     }
     AssetTypeService.AddPropertyToAssetType(name, property);
     return RedirectToAction("Index");
 }
Exemplo n.º 5
0
 public void AddProperty(AssetProperty property)
 {
     Properties.Add(property);
 }