public KullanicilarServis() { if (kullanicilarRepository == null) { kullanicilarRepository = new KullanicilarRepository(); } }
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"); } }
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; } }
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); } }
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)); }
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)); }