public static List <EntityClassOgrenci> OgrenciLıstesi() { List <EntityClassOgrenci> values = new List <EntityClassOgrenci>(); SqlCommand cm4 = new SqlCommand("OGRENCILISTESI", ConnectionClass.cn); cm4.CommandType = CommandType.StoredProcedure; if (cm4.Connection.State != ConnectionState.Open) { cm4.Connection.Open(); } SqlDataReader dr = cm4.ExecuteReader(); while (dr.Read()) { EntityClassOgrenci ent = new EntityClassOgrenci(); ent.ID = Convert.ToInt32(dr["ID"].ToString()); ent.AD = dr["AD"].ToString(); ent.SOYAD = dr["SOYAD"].ToString(); ent.FOTOGRAF = dr["FOTOGRAF"].ToString(); ent.KULUPID = Convert.ToInt16(dr["KULUPID"].ToString()); values.Add(ent); } dr.Close(); return(values); }
public static bool GUNCELLE(EntityClassOgrenci entOgrenci) { if (entOgrenci.ID > 0 && entOgrenci.AD != "" && entOgrenci.SOYAD != "" && entOgrenci.KULUPID > 0) { return(FacadeClassOgrenci.GUNCELLE(entOgrenci)); } return(false); }
public static int EKLE(EntityClassOgrenci entOgrenci) { if (entOgrenci.AD != "" && entOgrenci.SOYAD != "" && entOgrenci.KULUPID > 0 && entOgrenci.FOTOGRAF.Length >= 1) { return(FacadeClassOgrenci.EKLE(entOgrenci)); } return(-1); }
private void BTNKAYDET_Click(object sender, EventArgs e) { EntityClassOgrenci ent = new EntityClassOgrenci(); ent.AD = TXTAD.Text; ent.SOYAD = TXTSOYAD.Text; ent.FOTOGRAF = TXTFOTO.Text; ent.KULUPID = Convert.ToInt16(comboBox1.SelectedValue); LogicClassOgrenci.EKLE(ent); MessageBox.Show("YENİ ÖĞRENCİ EKLENDİ!"); OgrenciListesi(); }
private void BTNGUNCELLE_Click(object sender, EventArgs e) { EntityClassOgrenci ent = new EntityClassOgrenci(); ent.ID = Convert.ToInt16(TXTID.Text); ent.AD = TXTAD.Text; ent.SOYAD = TXTSOYAD.Text; ent.FOTOGRAF = TXTFOTO.Text; ent.KULUPID = Convert.ToInt16(comboBox1.SelectedValue); LogicClassOgrenci.GUNCELLE(ent); MessageBox.Show("KAYIT GÜNCELLENDİ!"); OgrenciListesi(); }
public static int EKLE(EntityClassOgrenci entOgrenci) { SqlCommand cm1 = new SqlCommand("OGRENCIEKLE", ConnectionClass.cn); cm1.CommandType = CommandType.StoredProcedure; if (cm1.Connection.State != ConnectionState.Open) { cm1.Connection.Open(); } cm1.Parameters.AddWithValue("AD", entOgrenci.AD); cm1.Parameters.AddWithValue("SOYAD", entOgrenci.SOYAD); cm1.Parameters.AddWithValue("@FOTOGRAF", entOgrenci.KULUPID); cm1.Parameters.AddWithValue("KULUPID", entOgrenci.KULUPID); return(cm1.ExecuteNonQuery()); }