/// <summary> /// This will take the get regions from the repo and turn it into a select list. /// </summary> /// <param name="repo"></param> /// <returns></returns> public static List <SelectListItem> GetRegions_SelectList(this SoftwareTestRepository repo) { return(repo.GetRegions() .Select(x => new SelectListItem() { Value = x.RegionId.ToString(), Text = x.RegionName }).OrderBy(x => x.Text).ToList()); }
public BlockSearchController(SoftwareTestRepository repo) { Repository = repo; }
public BlockSearchController() { Repository = new SoftwareTestRepository(); }
public BlockForecastController(SoftwareTestRepository repo) { Repository = repo; }
public BlockForecastController() { Repository = new SoftwareTestRepository(); }
/// <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); }