Created
June 29, 2012 12:47
-
-
Save PureKrome/3017720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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