Exemplo n.º 1
0
        public ActionResult Duzenle(int id)
        {
            Kullanici dbKullanici = _kullaniciRepository.GetById(id);

            if (dbKullanici == null)
            {
                throw new Exception("Kullanıcı Bulunamadı");
            }
            return(View(dbKullanici));
        }
Exemplo n.º 2
0
        public KullaniciDTO GetById(int id)
        {
            using (KullaniciRepository kullaniciRepo = new KullaniciRepository())
            {
                try
                {
                    var ent          = kullaniciRepo.GetById(id);
                    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;

                    return(kullanicidto);
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        public KullaniciDTO GetById(int id)
        {
            using (KullaniciRepository kullaniciRepo = new KullaniciRepository())
            {
                try
                {
                    var model = kullaniciRepo.GetById(x => x.kullaniciID == id, x => x.KullaniciBilgileri, x => x.KullaniciBilgileri.Il, x => x.KullaniciBilgileri.Ilce, x => x.Randevu, x => x.Rol, x => x.Favori);

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