Beispiel #1
0
        public List <KullaniciDTO> Get(int sirketId)
        {
            using (KullaniciRepository kullaniciRepo = new KullaniciRepository())
            {
                try
                {
                    var model        = kullaniciRepo.Get();
                    var Kullanicilar = new List <KullaniciDTO>();
                    foreach (var ent in model.ToList())
                    {
                        if (ent.rolID == 1 && ent.sirketID == sirketId)
                        {
                            var kullanicidto = new KullaniciDTO();
                            kullanicidto.adi         = ent.adi;
                            kullanicidto.kullaniciID = ent.kullaniciID;
                            kullanicidto.password    = ent.password;
                            kullanicidto.rol         = ent.Rol.rol1;
                            kullanicidto.rolID       = ent.rolID;
                            kullanicidto.sirketAdi   = ent.Sirket.sirketAdi;
                            kullanicidto.sirketID    = ent.sirketID;
                            kullanicidto.soyadi      = ent.soyadi;
                            kullanicidto.username    = ent.username;

                            Kullanicilar.Add(kullanicidto);
                        }
                    }
                    return(Kullanicilar);
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        public List <KullaniciDTO> Get()
        {
            using (KullaniciRepository kullaniciRepo = new KullaniciRepository())
            {
                try
                {
                    var model = kullaniciRepo.Get(x => x.KullaniciBilgileri, x => x.KullaniciBilgileri.Il, x => x.KullaniciBilgileri.Ilce, x => x.Randevu, x => x.Rol, x => x.Favori).ToList();

                    return(kullaniciMapper.MapAll(model));
                }
                catch
                {
                    throw;
                }
            }
        }