private void CreateActionMenu(HtmlContainerControl menuContainer, IList <DataRow> responses, bool isNew) { menuContainer.Controls.Clear(); new HtmlSpan { InnerText = "Select action:" }.AddTo(menuContainer); var dropdown = new HtmlSelect().AddTo(menuContainer); var edit = dropdown.AddItem("Edit this response", "edit"); var add = dropdown.AddItem("Add another response to this question", "add"); var view = dropdown.AddItem("View or edit other responses to this question", "view"); if (responses.Count == 0) { menuContainer.AddCssClasses("hidden"); } else { menuContainer.RemoveCssClass("hidden"); } if (isNew && responses.Count > 0) { edit.Attributes.Add("disabled", "disabled"); add.Attributes.Add("selected", "selected"); } else { edit.Attributes.Add("selected", "selected"); if (responses.Count < 2) { view.Attributes.Add("disabled", "disabled"); } } }
// ReSharper disable VirtualMemberNeverOverriden.Global protected void FormatMultiCountiesMessage(HtmlContainerControl control) { var allCounties = LocalIdsCodes.FormatMultiCountyNames(StateCode, LocalKey, true); if (!IsNullOrWhiteSpace(allCounties)) { control.RemoveCssClass("hidden"); control.InnerText = $"Parts of this local district are in {allCounties}"; } }
protected int FormatOtherCountiesMessage(HtmlContainerControl control) { var otherCounties = LocalIdsCodes.FormatOtherCountyNames(StateCode, CountyCode, LocalKey, out var countyCount, true); if (!IsNullOrWhiteSpace(otherCounties)) { control.RemoveCssClass("hidden"); control.InnerText = $"Parts of this local district are also in {otherCounties}"; } return(countyCount); }