private void LoadCityCouncilDistricts() { CityCouncilTableBody.Controls.Clear(); var districts = CityCouncil .GetCityCouncilDistrictsByTigerCode(StateCode, TigerPlaceCode).Rows .OfType <DataRow>().OrderBy(r => r.CityCouncilCode()).ToList(); foreach (var d in districts) { var tr = new TableRow(); tr.AddTo(CityCouncilTableBody); new TableCell().AddTo(tr, "delete").Controls .Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "exists").Controls.Add( new HtmlInputCheckBox { Disabled = true, Checked = d.LocalKey() != null }); new TableCell().AddTo(tr, "create").Controls .Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "code").Controls.Add(new HtmlInputText { Value = d.CityCouncilCode(), Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "in-shapefile").Controls .Add(new HtmlInputCheckBox { Checked = d.IsInShapefile() }); new TableCell().AddTo(tr, "district").Controls .Add(new HtmlInputText { Value = d.District() }); new TableCell().AddTo(tr, "name").Controls .Add(new HtmlInputText { Value = d.Name() }); } SetCouncilPrefix2(districts.Count > 0 ? districts[0].CityCouncilCode() : null); BulkAddCityCouncil.Disabled = districts.Count > 0; }
private void LoadSchoolSubDistricts() { // SchoolDistrictTableBody.Controls.Clear(); var districts = SchoolDistrictDistricts .GetSchoolDistrictDistrictsByTigerTypeTigerCode(StateCode, TigerSchoolType, TigerSchoolCode).Rows.OfType <DataRow>() .OrderBy(r => r.SchoolDistrictDistrictCode()).ToList(); foreach (var d in districts) { var tr = new TableRow(); tr.AddTo(SchoolDistrictTableBody); new TableCell().AddTo(tr, "delete").Controls .Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "exists").Controls.Add( new HtmlInputCheckBox { Disabled = true, Checked = d.LocalKey() != null }); new TableCell().AddTo(tr, "create").Controls .Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "code").Controls.Add(new HtmlInputText { Value = d.SchoolDistrictDistrictCode(), Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "in-shapefile").Controls .Add(new HtmlInputCheckBox { Checked = d.IsInShapefile() }); new TableCell().AddTo(tr, "name").Controls .Add(new HtmlInputText { Value = d.Name() }); } SetSubDistrictPrefix(districts.Count > 0 ? districts[0].SchoolDistrictDistrictCode() : null); BulkAddSchoolDistrict.Disabled = districts.Count > 0; }
private void LoadCityCouncilDistricts(ICollection <CityCouncilItem> items) { CityCouncilTableBody.Controls.Clear(); foreach (var s in items) { var tr = new TableRow(); tr.AddTo(CityCouncilTableBody, s.New ? "new" : null); new TableCell().AddTo(tr, $"delete {s.ErrorClass(nameof(CityCouncilItem.Delete))}") .Controls.Add(new HtmlInputCheckBox { Disabled = s.Exists, Checked = s.Delete }); new TableCell().AddTo(tr, $"exists {s.ErrorClass(nameof(CityCouncilItem.Exists))}") .Controls.Add(new HtmlInputCheckBox { Disabled = true, Checked = s.Exists }); new TableCell().AddTo(tr, $"create {nameof(CityCouncilItem.Create)}").Controls .Add(new HtmlInputCheckBox { Disabled = s.Exists, Checked = s.Create }); new TableCell().AddTo(tr, "code").Controls.Add( new HtmlInputText { Value = s.Id, Disabled = s.Exists }.AddCssClasses( s.ErrorClass(nameof(CityCouncilItem.Id)))); new TableCell() .AddTo(tr, $"in-shapefile {s.ErrorClass(nameof(CityCouncilItem.InShapefile))}") .Controls.Add(new HtmlInputCheckBox { Checked = s.InShapefile }); new TableCell().AddTo(tr, "district").Controls.Add( new HtmlInputText { Value = s.District }.AddCssClasses( s.ErrorClass(nameof(CityCouncilItem.District)))); new TableCell().AddTo(tr, "name").Controls.Add( new HtmlInputText { Value = s.Name }.AddCssClasses( s.ErrorClass(nameof(CityCouncilItem.Name)))); } BulkAddCityCouncil.Disabled = items.Count > 0; }
private void LoadCountySupervisorDistricts() { CountySupervisorsTableBody.Controls.Clear(); var districts = CountySupervisors .GetCountySupervisorsDistrictsByCountyCode(StateCode, CountyCode).Rows .OfType <DataRow>().OrderBy(r => r.CountySupervisorsCode()).ToList(); foreach (var d in districts) { var tr = new TableRow(); tr.AddTo(CountySupervisorsTableBody); new TableCell().AddTo(tr, "delete").Controls.Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "exists").Controls.Add(new HtmlInputCheckBox { Disabled = true, Checked = d.LocalKey() != null }); new TableCell().AddTo(tr, "create").Controls.Add(new HtmlInputCheckBox { Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "code").Controls.Add(new HtmlInputText { Value = d.CountySupervisorsCode(), Disabled = d.LocalKey() != null }); new TableCell().AddTo(tr, "in-shapefile").Controls.Add(new HtmlInputCheckBox { Checked = d.IsInShapefile() }); new TableCell().AddTo(tr, "name").Controls.Add(new HtmlInputText { Value = d.Name() }); } BulkAddCountySupervisors.Disabled = districts.Count > 0; }
private void LoadCountySupervisorDistricts(ICollection <CountySupervisor> supervisors) { CountySupervisorsTableBody.Controls.Clear(); foreach (var s in supervisors) { var tr = new TableRow(); tr.AddTo(CountySupervisorsTableBody, s.New ? "new" : null); new TableCell().AddTo(tr, $"delete {s.ErrorClass("Delete")}") .Controls.Add(new HtmlInputCheckBox { Disabled = s.Exists, Checked = s.Delete }); new TableCell().AddTo(tr, $"exists {s.ErrorClass("Exists")}").Controls.Add(new HtmlInputCheckBox { Disabled = true, Checked = s.Exists }); new TableCell().AddTo(tr, $"create {s.ErrorClass("Create")}").Controls.Add(new HtmlInputCheckBox { Disabled = s.Exists, Checked = s.Create }); new TableCell().AddTo(tr, "code").Controls.Add(new HtmlInputText { Value = s.Id, Disabled = s.Exists }.AddCssClasses(s.ErrorClass("Id"))); new TableCell().AddTo(tr, $"in-shapefile {s.ErrorClass("IsInShapefile")}").Controls.Add(new HtmlInputCheckBox { Checked = s.InShapefile }); new TableCell().AddTo(tr, "name").Controls.Add(new HtmlInputText { Value = s.Name }.AddCssClasses(s.ErrorClass("Name"))); } BulkAddCountySupervisors.Disabled = supervisors.Count > 0; }