//public List<Link> linkToShow;
 //public Link l;
 public ActionResult Index()
 {
     //int x = 1;
     ViewModel vm = new ViewModel();
     UserManager um = new UserManager(ConnectionString);
     LinkManager lm = new LinkManager(ConnectionString);
     //ViewBag.Counter = x;
     vm.Alllink = lm.GetAllLinks();
     return View(vm);
 }
        public ActionResult Secret()
        {
            ViewModel vm = new ViewModel();
            UserManager um = new UserManager(ConnectionString);
            LinkManager lm = new LinkManager(ConnectionString);

            string username = User.Identity.Name;
            vm.UserId = um.GetUserbyUsername(username);
            vm.LoginUsers = um.GetAllUser();
            vm.User = um.GetUserbyUsernameReturnUser(username);
            vm.Date = DateTime.Now;
            vm.Alllink = lm.GetAllLinks();
            vm.linksByUser = lm.GetLinkbyUsers(username);
            //linkToShow.Add(l);
            //vm.linkToShow = linkToShow;

            return View(vm);
        }
 public ActionResult Users(int userId)
 {
     ViewModel vm = new ViewModel();
     LinkManager lm = new LinkManager(ConnectionString);
     UserManager um = new UserManager(ConnectionString);
     IEnumerable<Link> linkById = lm.GetLinkbyUserId(userId);
     vm.UserId = um.GetUserId(userId);
     vm.linksByUser = linkById;
     return View(vm);
 }