Skip to content

Instantly share code, notes, and snippets.

@PureKrome
Created June 29, 2012 12:47
Show Gist options
  • Save PureKrome/3017720 to your computer and use it in GitHub Desktop.
Save PureKrome/3017720 to your computer and use it in GitHub Desktop.
private readonly IWebService _webService;
public DocumentController(IWebService webService)
{
_webService = webService;
}
public ActionResult Index(int? id)
{
var indexViewModel = new IndexViewModel();
if (id == null)
{
indexViewModel.Title = "Select a Category:";
indexViewModel.List = webService.GetCategories();
}
else
{
Session["CategoryID"] = (int)id; // Not sure what this is for. I know what sessions are for....
indexViewModel.Title = "Select a Definition:";
indexViewModel.CategoryId = id;
indexViewModel.List = webService.GetDefinitions((int)id);
}
if (list == null || list.Count <= 0)
indexViewModel.Description = "None found.";
return View(indexViewModel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment