Ejemplo n.º 1
0
        public void OylamaChatineKatil(Guid BaglananId, Guid OylamaId)
        {
            VotedressUserDetailManager userdetail_Manager = new VotedressUserDetailManager();

            UserDetail kullanici_detayi = new UserDetail();

            kullanici_detayi = userdetail_Manager.GetUserDetail(BaglananId);

            VotedressUser_sade sade_kullanici = new VotedressUser_sade()
            {
                id           = kullanici_detayi.UserId,
                SocialId     = kullanici_detayi.User.SocialId,
                SocialName   = kullanici_detayi.User.SocialName,
                Name         = kullanici_detayi.Name,
                SurName      = kullanici_detayi.SurName,
                Birthday     = kullanici_detayi.Birthday,
                Email        = kullanici_detayi.User.Email,
                ProfileImage = kullanici_detayi.User.ProfileImage,
                Sex          = kullanici_detayi.Sex,
            };

            Clients.Group(OylamaId.ToString()).ChateBiriBaglandi(sade_kullanici);

            Groups.Add(Context.ConnectionId, OylamaId.ToString());

            InVoteChatManager invotechatManager = new InVoteChatManager();

            invotechatManager.AddUserChat(BaglananId, OylamaId);
        }
        public ActionResult Index()
        {
            VotedressUser user = new VotedressUser();

            user = Session["login"] as VotedressUser;

            OylamaManager vote_manager = new OylamaManager();
            Vote_sade     oylama       = vote_manager.OylamaGetirOylamakIcin(user.id);

            if (oylama != null)
            {
                InVoteChatManager invoteChatManager = new InVoteChatManager();
                if (invoteChatManager.Chattemiyim(user.id, oylama.id) == null)
                {
                    VotedressUserDetailManager userdetail_Manager = new VotedressUserDetailManager();
                    UserDetail kullanici_detayi = new UserDetail();
                    kullanici_detayi = userdetail_Manager.GetUserDetail(user.id);
                    VotedressUser_sade sade_kullanici = new VotedressUser_sade()
                    {
                        id           = kullanici_detayi.UserId,
                        SocialId     = kullanici_detayi.User.SocialId,
                        SocialName   = kullanici_detayi.User.SocialName,
                        Name         = kullanici_detayi.Name,
                        SurName      = kullanici_detayi.SurName,
                        Birthday     = kullanici_detayi.Birthday,
                        Email        = kullanici_detayi.User.Email,
                        ProfileImage = kullanici_detayi.User.ProfileImage,
                        Sex          = kullanici_detayi.Sex,
                    };
                    InVoteChatManager repo_invotechatManager = new InVoteChatManager();
                    repo_invotechatManager.AddUserChat(user.id, oylama.id);
                }
            }
            else
            {
                return(View(oylama));//Oylama yok sayfasına yönlerdircen
            }
            return(View(oylama));
        }