Esempio n. 1
0
        public ChatList(User user, ChatVM chatVM)
        {
            InitializeComponent();
            ChatListVM chatListVM = new ChatListVM();

            this.chatVM             = chatVM;
            this.DataContext        = chatListVM;
            chatListVM.CurrentChats = chatRestClient.GetAllChatsforUser(user.Id);
            foreach (Models.Chat chat in chatListVM.CurrentChats)
            {
                chat.Members = chatRestClient.GetAllMembersToChat(chat.Id);
            }
        }
        public ActionResult AdminChatListing()
        {
            long       AdminId    = Convert.ToInt64(Session["AdminId"]);
            ChatListVM chatListVM = new ChatListVM();
            var        result     = propertyService.GetChat(AdminId);

            if (result != null)
            {
                if (result.Count > 0)
                {
                    chatListVM.chatUser = result;
                }
            }
            return(View(chatListVM));
        }
        public ActionResult ChatListing()
        {
            ChatListVM chatListVM = new ChatListVM();
            var        userId     = Convert.ToInt64(Session["UserId"]);

            if (userId != 0)
            {
                var result = propertyService.GetChat(userId);
                if (result != null)
                {
                    if (result.Count > 0)
                    {
                        chatListVM.chatUser = result;
                    }
                }
                return(View(chatListVM));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
        }