Beispiel #1
0
        public void Connect(string userName)
        {
            var id = _kullanici.GetByMail(userName).ID.ToString();

            // var id = Context.ConnectionId;


            if (ConnectedUsers.Count(x => x.ConnectionId == id) == 0)
            {
                ConnectedUsers.Add(new UserDetail {
                    ConnectionId = id, UserName = userName
                });

                // send to caller
                Clients.Caller.onConnected(id, userName, ConnectedUsers, CurrentMessage);

                // send to all except caller client
                Clients.AllExcept(id).onNewUserConnected(id, userName);
            }
        }
Beispiel #2
0
        public ActionResult Chat()
        {
            string    ad = Session["KullaniciEmail"].ToString();
            Kullanici k  = _kullanici.GetByMail(ad);

            int        rol = Convert.ToInt32(Session["Rol"]);
            WebChatHub hub = new WebChatHub();

            //hub.Connect(mail);
            ViewBag.ad  = ad;
            ViewBag.rol = rol;
            ViewBag.id  = k.ID;
            return(View());
        }
Beispiel #3
0
 public JsonResult Ekle(Kullanici kullanici)
 {
     try
     {
         Kullanici kln = _kullaniciRepository.GetByMail(kullanici.Mail);
         if (kln == null)
         {
             _kullaniciRepository.Insert(kullanici);
             _kullaniciRepository.Save();
             return(Json("Kullanıcı Kaydı Başarıyla Yapıldı"));
         }
         return(Json("Girdiğiniz E-Mail Sisteme Kayıtlı"));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message));
     }
 }