Exemple #1
0
        public ActionResult Index(int?id)
        {
            //[email protected]       ID = 760
            //[email protected]         ID = 3681
            if (!id.HasValue)
            {
                //pull out of a repository - Username (Email)
                string userID = User.Identity.Name;
                id = _custRepo.getCustomerID(userID);       //See Repository

                //pass the user's customerID to the URL
                return(RedirectToAction("Index", new { id = id }));
            }

            if (!User.IsInRole("Customer"))
            {
                return(View("Unauthorized"));
            }

            //this will establish current allotment at the menu bar
            ViewBag.CurrentAllotment = _custRepo.getCurrentAllotment(id.Value);

            var std = _custRepo.ActiveRequests(id.Value);

            return(View(std));
        }