public GeneralAttributesModel(string categorie_id) { this.categorie_idA = categorie_id; //-- Generates types select attributeTypes = categorieProvider.getAttributeTypes().Result; List <SelectListItem> _TypeSelectList = new List <SelectListItem>(); foreach (AttributeTypeDTO iType in attributeTypes) { _TypeSelectList.Add(new SelectListItem { Text = iType.type, Value = iType.id_type }); } _TypeSelect = new SelectList(_TypeSelectList, "Value", "Text"); //-- Get attributes generalAttributesDTO = categorieProvider.getGeneralAttributes(categorie_id).Result; }
public AttributesListModel(string attribute_id, string pAttribute_name) { this.attribute_nameVA = pAttribute_name; this.attribute_idVA = attribute_id; //-- Generates types select attributeTypes = categorieProvider.getAttributeTypes().Result; List <SelectListItem> _TypeSelectList = new List <SelectListItem>(); foreach (AttributeTypeDTO iType in attributeTypes) { if (iType.type != "Lista") { _TypeSelectList.Add(new SelectListItem { Text = iType.type, Value = iType.id_type }); } } _TypeSelect = new SelectList(_TypeSelectList, "Value", "Text"); //-- Get attributes attributeListDTO = categorieProvider.getAttributesList(attribute_id).Result; }