public ActionResult Details(int id) { if (Request.IsAuthenticated) { ViewBag.UserId = AuthorizeUtilities.GetUserId(this); } var repo = new MobileSuitRepositoryADO(); var model = repo.GetDetails(id); return(View(model)); }
public void CanLoadGundamDetails() { var repo = new MobileSuitRepositoryADO(); Detail_Result gundams = repo.GetDetails(2); Assert.AreEqual("UC", gundams.Century); Assert.AreEqual(79, gundams.Year); Assert.AreEqual("Custom", gundams.Type); Assert.AreEqual("Red", gundams.Interior); Assert.AreEqual("Red", gundams.Color); Assert.AreEqual("Zaku II Char Custom", gundams.Name); }
public ActionResult Details(int id) { var repo = new MobileSuitRepositoryADO(); var modelfirst = repo.GetDetails(id); var model = new SalesViewModel(); var statesrepo = new StateRepositoryADO(); model.States = new SelectList(statesrepo.GetAll(), "StateId", "Name"); var purchaseRepo = new PurchaseRepoADO(); model.Purchase = new SelectList(purchaseRepo.GetAll(), "TypeId", "Type"); model.MobileSuit = modelfirst; if (User.Identity.IsAuthenticated) { var user = User.Identity; ViewBag.Name = user.Name; ViewBag.displayMenu = "No"; if (IsAdminUser()) { ViewBag.displayMenu = "Yes"; } if (Request.IsAuthenticated) { ViewBag.UserId = AuthorizeUtilities.GetUserId(this); } return(View(model)); } else { ViewBag.Name = "Not Logged IN"; return(View(model)); } }