Exemplo n.º 1
0
        //
        // GET: /AddContact/
        public ActionResult Index()
        {
            var currnetUser = User.Identity.Name;
            var users       = db.Users.ToList();
            var userContact = db.UserContacts.Where(u => u.CurrnetUser == currnetUser);

            var usersWithUserContact = new UserYouAddedViewModel
            {
                UserContact = userContact,
                Users       = users,
                CurrentUser = currnetUser
            };

            return(View(usersWithUserContact));
        }
Exemplo n.º 2
0
        public ActionResult AddMembersView(int id)
        {
            var group = db.Room.FirstOrDefault(g => g.Id == id);
            //To add members to group
            var currnetUser = User.Identity.Name;
            var users       = db.Users.ToList();
            var userContact = db.UserContacts.Where(u => u.CurrnetUser == currnetUser);
            //var room = db.Room.Where();
            var userRoom             = db.UserRoom.ToList();
            var usersWithUserContact = new UserYouAddedViewModel
            {
                UserRoom    = userRoom,
                Users       = users,
                CurrentUser = currnetUser,
                Group       = group
            };

            if (group == null)
            {
                return(HttpNotFound());
            }

            return(View(usersWithUserContact));
        }