/// <summary> /// A search form allowing users to see a list of all blocks.Clicking on a block will open a Block Forecast form. /// The user should be able to filter the block list by variety and region. /// Side note: this is the main page. All the index pages are redirecting to this. /// </summary> /// <returns></returns> public ActionResult BlockSearch() { //Start a view model. var model = new BlockSearchViewModel(); //Populate domain values and such. model.PopualteDomainValues(Repository); return(View(model)); }
/// <summary> /// This will take a BlockSearchViewModel like the one used in BlockSearch and fill it's select lists. /// </summary> /// <param name="model">Self</param> /// <param name="repo">Repository that has the data.</param> /// <returns></returns> public static BlockSearchViewModel PopualteDomainValues(this BlockSearchViewModel model, SoftwareTestRepository repo) { model.regions = GetRegions_SelectList(repo); model.varieties = GetVarieties_SelectList(repo); return(model); }