private void btnYETKILIEKLE_Click(object sender, EventArgs e) { try { ENTITYISYERIYETKILI ent = new ENTITYISYERIYETKILI(); ent.KULLANICIAD = txtYETKILIKULLANICIADIEKLE.Text; ent.SIFRE = txtYETKILISIFREEKLE.Text; ent.AD = txtYETKILIADEKLE.Text; ent.SOYAD = txtYETKILISOYADEKLE.Text; ent.TCKIMLIK = mskYETKILITCEKLE.Text; ent.DOGUMTARIHI = mskYETKILIDOGUMEKLE.Text; ent.ADRES = rchYETKILIADRESEKLE.Text; ent.TELEFON = mskYETKILITELEFONEKLE.Text; ent.EPOSTA = txtYETKILIEPOSTAEKLE.Text; BLLISYERIYETKILI.EKLE(ent); MessageBox.Show("YETKİLİ EKLENDİ", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information); temizle(); YETKILILISTELE(); } catch { MessageBox.Show("ZORUNLU ALANLARI LÜTFEN DOLDURUNUZ", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static List <ENTITYISYERIYETKILI> ISYERIYETKILILISTE() { List <ENTITYISYERIYETKILI> degerler = new List <ENTITYISYERIYETKILI>(); SqlCommand komut = new SqlCommand("YETKILILISTELE", SQLBAGLANTISI.baglanti); komut.CommandType = CommandType.StoredProcedure; if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } SqlDataReader dr = komut.ExecuteReader(); while (dr.Read()) { ENTITYISYERIYETKILI ent = new ENTITYISYERIYETKILI(); ent.YETKILIID = Convert.ToInt32(dr["YetkiliID"]); ent.KULLANICIAD = dr["KullaniciAd"].ToString(); ent.SIFRE = dr["Sifre"].ToString(); ent.AD = dr["Ad"].ToString(); ent.SOYAD = dr["Soyad"].ToString(); ent.TCKIMLIK = dr["TC"].ToString(); ent.DOGUMTARIHI = dr["DogumTarihi"].ToString(); ent.EPOSTA = dr["Eposta"].ToString(); ent.ADRES = dr["Adres"].ToString(); ent.TELEFON = dr["TelefonNo"].ToString(); degerler.Add(ent); } dr.Close(); return(degerler); }
public static bool GUNCELLE(ENTITYISYERIYETKILI deger) { if (deger.YETKILIID > 0 && deger.KULLANICIAD != null && deger.SIFRE != null && deger.AD != null && deger.SOYAD != null && deger.ADRES != null && deger.EPOSTA != null && deger.TELEFON != null && deger.TCKIMLIK != null && deger.DOGUMTARIHI != null) { return(FACADEISYERIYETKILI.ISYERIYETKILIGUNCELLE(deger)); } return(false); }
public static bool ISYERIYETKILIGUNCELLE(ENTITYISYERIYETKILI deger) { SqlCommand komut = new SqlCommand("YETKILIGUNCELLE", SQLBAGLANTISI.baglanti); komut.CommandType = CommandType.StoredProcedure; if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } komut.Parameters.AddWithValue("KULLANICIID", deger.YETKILIID); komut.Parameters.AddWithValue("KULLANICIAD", deger.KULLANICIAD); komut.Parameters.AddWithValue("SIFRE", deger.SIFRE); komut.Parameters.AddWithValue("AD", deger.AD); komut.Parameters.AddWithValue("SOYAD", deger.SOYAD); komut.Parameters.AddWithValue("ADRES", deger.ADRES); komut.Parameters.AddWithValue("EPOSTA", deger.EPOSTA); komut.Parameters.AddWithValue("TELEFONNO", deger.TELEFON); komut.Parameters.AddWithValue("TC", deger.TCKIMLIK); komut.Parameters.AddWithValue("DOGUMTARIHI", deger.DOGUMTARIHI); return(komut.ExecuteNonQuery() > 0); }