public void OylamaMesajGonder(Guid OylamaSahibiId, Guid OylamaId, Guid BahsedenId, string Mesaj, List <VotedressUser_sade> Bahsedilenler) { MessangerManager messangerManager = new MessangerManager(); BlockedUserManager blockedUserManager = new BlockedUserManager(); bool banlimi = blockedUserManager.EngelKontrol(BahsedenId, OylamaSahibiId); if (banlimi == true) { Clients.Caller.Engelli(); } else { VoteMessageManager voteMessage_manager = new VoteMessageManager(); VoteMessage_sade sonuc_Mesaj = voteMessage_manager.OylamaMesajEkle(BahsedenId, OylamaId, Mesaj); Clients.Group(OylamaId.ToString()).OylamaMesajGonder(sonuc_Mesaj); VotedressUserDetailManager userdetailManager = new VotedressUserDetailManager(); UserDetail oylamaSahibi = userdetailManager.GetUserDetail(OylamaSahibiId); UserDetail bahseden = userdetailManager.GetUserDetail(BahsedenId); VotedressUser_sade serialize_hatasindan_bahseden = new VotedressUser_sade(); serialize_hatasindan_bahseden.id = bahseden.UserId; serialize_hatasindan_bahseden.Name = bahseden.Name; serialize_hatasindan_bahseden.SurName = bahseden.SurName; serialize_hatasindan_bahseden.ProfileImage = bahseden.User.ProfileImage; serialize_hatasindan_bahseden.Sex = bahseden.Sex; serialize_hatasindan_bahseden.SocialName = bahseden.User.SocialName; serialize_hatasindan_bahseden.SocialId = bahseden.User.SocialId; serialize_hatasindan_bahseden.Email = bahseden.User.Email; serialize_hatasindan_bahseden.Birthday = bahseden.Birthday; string conId; BahsedilenManager bahsedilenManager = new BahsedilenManager(); for (int i = 0; i < Bahsedilenler.Count; i++) { Bahsedilen eklenen = bahsedilenManager.BahsedilenEkleOylama(OylamaId, BahsedenId, Bahsedilenler[i].id, Mesaj); Bahsedilen_sade gidecek = new Bahsedilen_sade() { Bahseden = serialize_hatasindan_bahseden, BahsetmeTarihi = eklenen.BahsedilmeTarihi, GorulmeDurumu = eklenen.GorulmeDurumu, bahsedilenYerAdi = oylamaSahibi.Name + " " + oylamaSahibi.SurName, Mesaj = eklenen.Mesaj, TipId = OylamaId, Tip = "oylama" }; conId = messangerManager.ConnectionIdGetir(Bahsedilenler[i].id); Clients.Client(conId).SizdenBahsedildi(gidecek); } }; }
public void urunYorumunaCevapYap(Guid urunId, int yorumId, Guid yorumaCevapYapanId, string yorum, List <Guid> bahsedilenler) { if (urunId != Guid.Empty && yorumaCevapYapanId != Guid.Empty && yorumId != 0) { VotedressUserManager votedressUserManager = new VotedressUserManager(); VotedressUser bahseden = votedressUserManager.KullaniciGetir(yorumaCevapYapanId); BahsedilenManager bahsedilenManager = new BahsedilenManager(); for (int i = 0; i < bahsedilenler.Count; i++) { bahsedilenManager.BahsedilenEkleUrun(urunId, yorumaCevapYapanId, bahsedilenler[i], yorum); } ProductManager productManager = new ProductManager(); ProductCommentReply productComment = productManager.UrunYorumunaYorumEkle(yorumId, yorumaCevapYapanId, yorum); OnlineUserManager onlineUserManager = new OnlineUserManager(); List <OnlineUser> bahsedilenlerOnlineMi = onlineUserManager.OnlineKullaniciyiGetir(bahsedilenler); Clients.Group(urunId.ToString()).UrunYorumunaCevapYapildi(productComment.id, yorumId, bahseden.id, bahseden.UserDetail.Name + " " + bahseden.UserDetail.SurName, bahseden.ProfileImage, yorum, DateTime.Now); VotedressUser_sade votedressUser_sade_bahseden; Bahsedilen_sade bahsedilen_sade; for (int i = 0; i < bahsedilenlerOnlineMi.Count; i++) { votedressUser_sade_bahseden = new VotedressUser_sade() { id = bahsedilenlerOnlineMi[i].UserId, Birthday = bahsedilenlerOnlineMi[i].User.UserDetail.Birthday, Email = bahsedilenlerOnlineMi[i].User.Email, Name = bahsedilenlerOnlineMi[i].User.UserDetail.Name, ProfileImage = bahsedilenlerOnlineMi[i].User.ProfileImage, Sex = bahsedilenlerOnlineMi[i].User.UserDetail.Sex, SocialId = bahsedilenlerOnlineMi[i].User.SocialId, SocialName = bahsedilenlerOnlineMi[i].User.SocialName, SurName = bahsedilenlerOnlineMi[i].User.UserDetail.SurName }; bahsedilen_sade = new Bahsedilen_sade(); bahsedilen_sade.GorulmeDurumu = false; bahsedilen_sade.BahsetmeTarihi = DateTime.Now; bahsedilen_sade.Mesaj = yorum; bahsedilen_sade.TipId = urunId; bahsedilen_sade.Tip = "product"; bahsedilen_sade.bahsedilenYerAdi = productManager.UrunGetir(urunId).User.UserDetail.CompanyName; bahsedilen_sade.Bahseden = votedressUser_sade_bahseden; Clients.Client(bahsedilenlerOnlineMi[i].ConnectionId).SizdenBahsedildi(bahsedilen_sade); } } }
public List <Bahsedilen_sade> BahsedenleriGetir(Guid kullanici_id) { List <Bahsedilen> bahsedenlerList = unitOfWork.Repository <Bahsedilen>().List(x => x.BahsedilenId.id == kullanici_id && x.GorulmeDurumu == false); List <Bahsedilen_sade> bahsedilen_sadeList = new List <Bahsedilen_sade>(); Bahsedilen_sade bahsedilen_sade; VotedressUser_sade votedressUser_sade_bahseden; for (int i = 0; i < bahsedenlerList.Count; i++) { votedressUser_sade_bahseden = new VotedressUser_sade() { id = bahsedenlerList[i].BahsedenId.id, Birthday = bahsedenlerList[i].BahsedenId.UserDetail.Birthday, Email = bahsedenlerList[i].BahsedenId.Email, Name = bahsedenlerList[i].BahsedenId.UserDetail.Name, ProfileImage = bahsedenlerList[i].BahsedenId.ProfileImage, Sex = bahsedenlerList[i].BahsedenId.UserDetail.Sex, SocialId = bahsedenlerList[i].BahsedenId.SocialId, SocialName = bahsedenlerList[i].BahsedenId.SocialName, SurName = bahsedenlerList[i].BahsedenId.UserDetail.SurName }; if (bahsedenlerList[i].Vote != null) { bahsedilen_sade = new Bahsedilen_sade(); bahsedilen_sade.GorulmeDurumu = bahsedenlerList[i].GorulmeDurumu; bahsedilen_sade.BahsetmeTarihi = bahsedenlerList[i].BahsedilmeTarihi; bahsedilen_sade.Mesaj = bahsedenlerList[i].Mesaj; bahsedilen_sade.TipId = bahsedenlerList[i].Vote.id; bahsedilen_sade.Tip = "vote"; bahsedilen_sade.bahsedilenYerAdi = bahsedenlerList[i].Vote.User.UserDetail.Name + " " + bahsedenlerList[i].Vote.User.UserDetail.SurName; bahsedilen_sade.Bahseden = votedressUser_sade_bahseden; bahsedilen_sadeList.Add(bahsedilen_sade); } else if (bahsedenlerList[i].Product != null) { bahsedilen_sade = new Bahsedilen_sade(); bahsedilen_sade.GorulmeDurumu = bahsedenlerList[i].GorulmeDurumu; bahsedilen_sade.BahsetmeTarihi = bahsedenlerList[i].BahsedilmeTarihi; bahsedilen_sade.Mesaj = bahsedenlerList[i].Mesaj; bahsedilen_sade.TipId = bahsedenlerList[i].Product.id; bahsedilen_sade.Tip = "product"; bahsedilen_sade.bahsedilenYerAdi = bahsedenlerList[i].Product.User.UserDetail.CompanyName; bahsedilen_sade.Bahseden = votedressUser_sade_bahseden; bahsedilen_sadeList.Add(bahsedilen_sade); } else if (bahsedenlerList[i].Collection != null) { bahsedilen_sade = new Bahsedilen_sade(); bahsedilen_sade.GorulmeDurumu = bahsedenlerList[i].GorulmeDurumu; bahsedilen_sade.BahsetmeTarihi = bahsedenlerList[i].BahsedilmeTarihi; bahsedilen_sade.Mesaj = bahsedenlerList[i].Mesaj; bahsedilen_sade.TipId = bahsedenlerList[i].Collection.id; bahsedilen_sade.Tip = "collection"; bahsedilen_sade.bahsedilenYerAdi = bahsedenlerList[i].Collection.User.UserDetail.Name + " " + bahsedenlerList[i].Collection.User.UserDetail.SurName; bahsedilen_sade.Bahseden = votedressUser_sade_bahseden; bahsedilen_sadeList.Add(bahsedilen_sade); } else { bahsedilen_sade = new Bahsedilen_sade(); bahsedilen_sade.GorulmeDurumu = bahsedenlerList[i].GorulmeDurumu; bahsedilen_sade.BahsetmeTarihi = bahsedenlerList[i].BahsedilmeTarihi; bahsedilen_sade.Mesaj = bahsedenlerList[i].Mesaj; bahsedilen_sade.TipId = bahsedenlerList[i].SocialShare.id; bahsedilen_sade.Tip = "socialshare"; bahsedilen_sade.bahsedilenYerAdi = bahsedenlerList[i].SocialShare.VotedressUser.UserDetail.Name + " " + bahsedenlerList[i].SocialShare.VotedressUser.UserDetail.SurName; bahsedilen_sade.Bahseden = votedressUser_sade_bahseden; bahsedilen_sadeList.Add(bahsedilen_sade); } } return(bahsedilen_sadeList); }