コード例 #1
0
 public ActionResult FindUser(string searchUser)
 {
     var user = Authentication.User;
     //var viewModel = new FriendViewModel(Authentication.User);
     FriendViewModel viewModel = null;
     if (searchUser != "")
     {
         var users = FindUserFactory.Create().FindFriends(searchUser, user);
         viewModel = new FriendViewModel(user, users);
         /*viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });
         viewModel.Friends.Add(new Friend
             {
                 Avatar = "Avatar.jpg",
                 Email = "*****@*****.**",
                 FirstName = "aasdasdasd",
                 LastName = "sasdasda",
                 PostCount = 5
             });*/
     }
     else
     {
         viewModel = new FriendViewModel(user);
     }
     return View(viewModel);
 }
コード例 #2
0
 //
 // GET: /Friend/
 //[Authorize(Roles = "Admin, User", Order = 1, Users = "")]
 public ActionResult Index()
 {
     //SubscribeServiceFactory.Create().GetMany(subscribe => subscribe.)
     var user = Authentication.User;
     var viewModel = new FriendViewModel(user);
     return View(viewModel);
 }