Beispiel #1
0
        public void KullaniciKurumYetkiEkle(KullaniciKurumYetkiDto kurumyetki)
        {
            var ent = Context.KullaniciKurumYetkiler.FirstOrDefault(x => x.Id == kurumyetki.Id);

            if (ent == null)
            {
                ent = new KullaniciKurumYetki();
                Context.KullaniciKurumYetkiler.Add(ent);
            }
            ent.Aktif       = kurumyetki.Aktif;
            ent.KullaniciId = kurumyetki.KullaniciId;
            ent.KurumId     = kurumyetki.KurumId;
            Context.SaveChanges();
        }
Beispiel #2
0
        public void KullaniciYetkiGuncelle(KullaniciKurumYetkiDto dto)
        {
            var ent = Context.KullaniciKurumYetkiler.FirstOrDefault(x => x.KullaniciId == dto.Id);

            if (ent == null)
            {
                ent = new KullaniciKurumYetki();

                ent.KullaniciId = dto.KullaniciId;
                // ent.Id = Context.KullaniciKurumYetkiler.Max(x => x.Id) + 1;

                Context.KullaniciKurumYetkiler.Add(ent);
            }
            ent.KurumId = dto.KurumId;
            ent.Aktif   = dto.Aktif;


            Context.SaveChanges();
        }