public KullanicilarServis()
 {
     if (kullanicilarRepository == null)
     {
         kullanicilarRepository = new KullanicilarRepository();
     }
 }
Ejemplo n.º 2
0
 private void btn_CalisanEkle_Click(object sender, EventArgs e)
 {
     if (HelperLayer.Helper.AlanKontrol(this))
     {
         KullanicilarRepository repo = new KullanicilarRepository();
         Kullanicilar           b    = new Kullanicilar()
         {
             KullaniciAd     = txt_CalisanAd.Text,
             KullaniciSoyad  = txt_CalisanSoyad.Text,
             KullaniciAdi    = txt_CalisanAdi.Text,
             KullaniciParola = HelperLayer.Helper.MD5eDonustur(txt_CalisanSifre.Text),
             FirmaId         = firmalar.Find(x => x.FirmaAdi == cmb_FirmaId.SelectedItem.ToString()).FirmaId,
             RolId           = 1
         };
         if (repo.Ekle(b))
         {
             MessageBox.Show("Eklendi");
         }
         else
         {
             MessageBox.Show("Kayıt esnasında hata");
         }
     }
     else
     {
         MessageBox.Show("Alanlar boş geçilemez");
     }
 }
Ejemplo n.º 3
0
 public IHttpActionResult KullaniciList()
 {
     using (var kr = new KullanicilarRepository())
     {
         List <kullanicilar> Kullanicilars = kr.KullaniciListele();
         var content = new ResponseContent <kullanicilar>(Kullanicilars);
         return(new StandartResult <kullanicilar>(content, Request));
     }
 }
        private void btn_CalisanListele_Click(object sender, EventArgs e)
        {
            KullanicilarRepository kullanici = new KullanicilarRepository();

            kullanicilar = kullanici.RolIdyeGoreKullaniciGetir(1);
            for (int i = 0; i < kullanicilar.Count; i++)
            {
                dt_CalListele.DataSource = kullanicilar;
            }
        }
Ejemplo n.º 5
0
        public IHttpActionResult KullaniciDelete(int id)
        {
            var content = new ResponseContent <kullanicilar>(null);

            using (var kr = new KullanicilarRepository())
            {
                content.Result = kr.KullaniciDelete(id) ? "1" : "0";

                return(new StandartResult <kullanicilar>(content, Request));
            }
        }
 public bool GetKullaniciById(int id)
 {
     try
     {
         using (var kullanici = new KullanicilarRepository())
         {
             kullanici.GetKullaniciById(id);
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool KullaniciListele()
 {
     try
     {
         using (var kullanici = new KullanicilarRepository())
         {
             kullanici.KullaniciListele();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool KullaniciUpdate(kullanicilar item)
 {
     try
     {
         using (var kullanici = new KullanicilarRepository())
         {
             kullanici.KullaniciUpdate(item);
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool LoginControl(kullanicilar item)
 {
     try
     {
         using (var kullanicilar = new KullanicilarRepository())
         {
             kullanicilar.LoginControl(item);
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 10
0
        public IHttpActionResult UpdateKullanici(int id, kullanicilar kul)
        {
            var content = new ResponseContent <kullanicilar>(null);

            if (kul != null)
            {
                using (var kr = new KullanicilarRepository())
                {
                    content.Result = kr.KullaniciUpdate(kul) ? "1" : "0";

                    return(new StandartResult <kullanicilar>(content, Request));
                }
            }

            content.Result = "0";

            return(new StandartResult <kullanicilar>(content, Request));
        }
Ejemplo n.º 11
0
        public IHttpActionResult KullaniciEkle(kullanicilar kullanicilar)
        {
            var content = new ResponseContent <kullanicilar>(null);

            if (kullanicilar != null)
            {
                using (var kr = new KullanicilarRepository())
                {
                    content.Result = kr.KullaniciInsert(kullanicilar) ? "1" : "0";

                    return(new StandartResult <kullanicilar>(content, Request));
                }
            }

            content.Result = "0";

            return(new StandartResult <kullanicilar>(content, Request));
        }