/*============================================================================== * ActionResult Index() * Index * * Default action, populates list of groups available to the user * ==============================================================================*/ public ActionResult Index() { //Pulls data from userProfiles database and creates a list of groups Entities db = new Entities(); UserProfile user = db.UserProfiles.Single(u => u.UserId == WebSecurity.CurrentUserId); ScanIndexModel model = new ScanIndexModel() { GroupList = user.GroupsIn }; return View(model); }
public ActionResult Index(ScanIndexModel model) { //Redirecting actions to sepcific pages if (ModelState.IsValid) { if (model.Action == "Upload") return RedirectToAction("Upload", new { groupId = model.selectedGroupId }); if (model.Action == "Delete") return RedirectToAction("Delete", new { groupId = model.selectedGroupId }); if (model.Action == "View") return RedirectToAction("View", new { groupId = model.selectedGroupId }); } return RedirectToAction("Index"); }