public District(Form form, bool flag) { InitializeComponent(); this.flag = flag; if (flag) { flatForm = (FlatForm)form; } else if (!flag) { searchForm = (SearchForm)form; } }
public SearchForm(List <Flat> flats, SearchType searchType, FlatForm ogForm) { InitializeComponent(); panelRooms.Enabled = false; panelDistrict.Enabled = false; panelYear.Enabled = false; this.flats = flats; if (searchType == SearchType.searchYear) { panelYear.Enabled = true; } if (searchType == SearchType.searchDistrict) { panelDistrict.Enabled = true; } if (searchType == SearchType.searchRooms) { panelRooms.Enabled = true; } this.ogForm = ogForm; }