public Task <IEnumerable <Attribute> > GetAllAttributes() { var attr1 = new Attribute { Type = "*", ObjectId = "1", Key = "Number of Shelter Kits" }; var attr2 = new Attribute { Type = "*", ObjectId = "2", Key = "Number of Hygiene Kits" }; var attr3 = new Attribute { Type = "S", ObjectId = "3", Key = "Number of Host Families" }; var attr4 = new Attribute { Type = "A", ObjectId = "4", Key = "Number of Evacuation Centers" }; var attr5 = new Attribute { Type = "S", ObjectId = "5", Key = "Hotlines" }; var attr6 = new Attribute { Type = "*", ObjectId = "6", Key = "Number of Hospitals" }; var attr7 = new Attribute { Type = "S", ObjectId = "7", Key = "Available Capacity" }; var attr8 = new Attribute { Type = "*", ObjectId = "8", Key = "Others" }; return(Task.FromResult(new List <Attribute> { attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8 } as IEnumerable <Attribute>)); }
public void AddOrUpdateAttribute(Attribute attribute, string value) { ValuedAttribute attr; if (!_attributesMap.TryGetValue(attribute.Key, out attr)) { attr = ItemHandler.CreateAttributeFrom(attribute); attr.ObjectId = null; _attributesMap.Add(attribute.Key, attr); _modifiedAttributes.RemoveAll(v => v.Key == attribute.Key); _modifiedAttributes.Add(attr); SetAvailableAttributes(); } attr.Value = value; }
public ValuedAttribute CreateAttributeFrom(Attribute source) { return(source.CreateValuedAttribute <ShelterAttribute>()); }
public ValuedAttribute CreateAttributeFrom(Attribute source) { return(source.CreateValuedAttribute <AssessmentAttribute>()); }