Example #1
0
        public ActionResult Details(Guid?roomId, string PIN)
        {
            ChatroomViewModel model = new ChatroomViewModel();

            room = null;
            if (roomId.HasValue)
            {
                room = manager.Get(roomId.Value) as ChatroomLite;

                if (room != null)
                {
                    model.Chatroom = room;
                    model.PIN      = PIN;
                    model.roomId   = roomId.Value;
                    model.IsOwner  = room.IsOwner(PIN);
                }


                model.Users = room.GetUsers(model.PIN);

                Save();

                return(View(model));
            }

            Error("Chat o podanym adresie nie istnieje!");
            return(RedirectToAction("Index", "Home"));
        }
Example #2
0
        public ActionResult Details(Guid?roomId)
        {
            if (roomId.HasValue)
            {
                IChatroom         room  = manager.Get(roomId.Value);
                ChatroomViewModel model = new ChatroomViewModel();
                if (room != null)
                {
                    model.Chatroom = room;
                    model.roomId   = roomId.Value;

                    string PIN = TempData["PIN"] as string;
                    TempData.Remove("PIN");
                    if (!string.IsNullOrWhiteSpace(PIN))
                    {
                        model.PIN     = PIN;
                        model.Users   = room.GetUsers(PIN);
                        model.IsOwner = room.IsOwner(PIN);
                    }

                    if (room != null)
                    {
                        return(View(model));
                    }
                }
            }

            Error("Chat o podanym adresie nie istnieje!");
            return(RedirectToAction("Index", "Home"));
        }