public HtmlString GetSubTypes(int projectTypeId) { var projectSubTypes = ProjectSubTypeService.FindAll(t => (t as ProjectSubType).ProjectTypeId == projectTypeId); var sb = new StringBuilder(); sb.Append("<select class=\"form-control\" id=\"ProjectSubTypeId\" name=\"ProjectSubTypeId\">"); foreach (var subTypeItem in projectSubTypes) { sb.Append($"<option value=\"{subTypeItem.Id}\">{subTypeItem.Name}</option >"); } sb.Append("</select>"); return(new HtmlString(sb.ToString())); }
public HtmlString GetSubTypes(int projectTypeId) { var sb = new StringBuilder(); sb.Append("<div class=\"d-flex flex-nowrap\">"); var projectSubTypes = ProjectSubTypeService.FindAll(t => (t as ProjectSubType).ProjectTypeId == projectTypeId); var index = 0; foreach (var subType in projectSubTypes) { sb.Append($"<div class=\"project-type-item project_sub_type\" onclick=\"loadProject({projectTypeId},{subType.Id},{index++})\">"); sb.Append($"<input type=\"hidden\" name=\"project_sub_type_id\" value=\"{subType.Id}\" />"); sb.Append(@"<div class=""text"">"); sb.Append($"{subType.Name}"); sb.Append("</div></div>"); } sb.Append("</div>"); return(new HtmlString(sb.ToString())); }